@milisp/keke 0.1.54 → 0.2.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 ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 OpenAI
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,110 @@
1
+ # keke
2
+
3
+ [中文文档](README.zh-CN.md) | [Architecture](docs/architecture.md) | [Configuration](docs/configuration/README.md) | [Roadmap](docs/ROADMAP.md)
4
+
5
+ [![npm](https://img.shields.io/npm/v/@milisp/keke)](https://www.npmjs.com/package/@milisp/keke)
6
+ [![CI](https://github.com/milisp/keke-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/milisp/keke-agent/actions/workflows/ci.yml)
7
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
8
+ ![Platforms](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey)
9
+
10
+ **keke** is a local coding agent written in Rust. Sign in with the ChatGPT or
11
+ Grok subscription you already pay for, or bring any API key, all from one tool.
12
+ The TUI, `keke exec`, and desktop apps (over ACP) drive the same session.
13
+
14
+ Subagents, MCP, skills, Claude-compatible plugins, hooks, plan mode,
15
+ per-turn checkpoints, and OS sandboxing are built in. Memory and repository
16
+ plugins stay off until you turn them on.
17
+
18
+ https://github.com/user-attachments/assets/d8858043-f3ab-4c70-a493-fb1f6edbc196
19
+
20
+ ## Why keke?
21
+
22
+ - **One session, every surface.** Interactive TUI and `keke exec` for scripts
23
+ and CI, both on one session protocol. Concurrent subagents (bounded, and a
24
+ child cannot spawn another), background shell tasks, and `/loop` for a prompt
25
+ that comes back later. Plan mode can research and write a plan, not the repo.
26
+
27
+ - **Use what you already pay for.** Sign in with ChatGPT (Codex) or Grok, or
28
+ any API key. Codex, Grok, Claude, OpenAI-compatible endpoints, Ollama, and
29
+ vLLM — Chat Completions, Responses, or Anthropic Messages. Several accounts
30
+ for one provider, picked by the directory you are in. A compatible endpoint
31
+ is a few lines of `config.toml`; it does not require a new build. The engine
32
+ crates cannot depend on any vendor plugin — CI fails the build if they do
33
+ ([`scripts/check-layering.py`](scripts/check-layering.py)).
34
+
35
+ - **Off by default.** Skills can be disabled. Persistent memory
36
+ is off until you set a directory. Hooks and MCP servers that ship with a
37
+ repository don't run on `git clone` (see [Safety](#safety)).
38
+
39
+ - **Checkpoints outside your repo.** Each turn snapshots the working
40
+ tree in a store outside your repository, so reverting the agent's edits is
41
+ not a stash and not a commit.
42
+
43
+ ## Install
44
+
45
+ ### npm
46
+
47
+ ```sh
48
+ npm install -g @milisp/keke
49
+ ```
50
+
51
+ You can also grab a binary directly from the
52
+ [latest release](https://github.com/milisp/keke-agent/releases/latest), or build
53
+ from source with `cargo build --release`.
54
+
55
+ ### Shell
56
+
57
+ ```sh
58
+ curl -fsSL https://raw.githubusercontent.com/milisp/keke-agent/main/scripts/install.sh | sh
59
+ ```
60
+
61
+ This downloads the latest prebuilt binary for your platform into
62
+ `~/.local/bin` (override with `KEKE_INSTALL_DIR`). Piping a remote script into
63
+ `sh` runs it with your privileges — inspect it first if that matters to you:
64
+ `curl -fsSL .../install.sh | less`.
65
+
66
+ ## Try it (30 seconds)
67
+
68
+ ```sh
69
+ keke doctor # see which providers/logins resolve, before you rely on one
70
+
71
+ # Sign in with a subscription you already pay for...
72
+ keke login codex
73
+ keke login grok
74
+ # ...or bring a key
75
+ export ANTHROPIC_API_KEY=sk-ant-...
76
+
77
+ keke exec "what does this project do?" # one-shot, for scripts and CI
78
+ keke # interactive TUI
79
+ keke resume # pick the last conversation back up
80
+ ```
81
+
82
+ In the TUI, Option+↑/↓ (Alt+↑/↓ on Linux) jumps between your earlier messages.
83
+
84
+ Provider routes, API keys, local models, gateways, per-directory accounts, and
85
+ all other settings are documented in the [configuration guide](docs/configuration/README.md).
86
+
87
+ ## Safety
88
+
89
+ - **Sandboxing & approvals** — shell commands run under an OS sandbox
90
+ (Seatbelt on macOS, Landlock + seccomp on Linux): by default they may write
91
+ only inside the workspace and have no direct network access; on macOS, and
92
+ on Linux with the opt-in bubblewrap backend, domains and ports can be
93
+ approved per command. Git hooks and config are read-only
94
+ (enforced on macOS). Stepping outside is reviewed each time — by the guardian
95
+ in Auto mode, otherwise by you; `approval_policy = "never"` skips that
96
+ review. On Windows, which has no sandbox, every command asks you instead. A
97
+ repository's own config can tighten that but never loosen it. CI fails
98
+ rather than skips if the runner cannot enforce the sandbox. See
99
+ [`docs/configuration/sandbox.md`](docs/configuration/sandbox.md).
100
+ - **Plugin trust** — repository-provided plugins (hooks, MCP servers) never
101
+ execute on `git clone` alone; a person must approve them, keyed to their
102
+ exact contents, not their path, and nothing they add can undo a denial.
103
+ There's no flag to turn that gate off.
104
+
105
+ ## License
106
+
107
+ Apache-2.0. See [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE). Design rationale
108
+ and source attribution are documented in
109
+ [`docs/architecture.md`](docs/architecture.md#why-it-is-shaped-this-way) and
110
+ `THIRD_PARTY_NOTICES.md` files in the relevant crates.
@@ -0,0 +1,89 @@
1
+ # keke
2
+
3
+ [English](README.md) | [架构设计](docs/architecture.md) | [配置文档](docs/configuration/README.md) | [路线图](docs/ROADMAP.md)
4
+
5
+ [![npm](https://img.shields.io/npm/v/@milisp/keke)](https://www.npmjs.com/package/@milisp/keke)
6
+ [![CI](https://github.com/milisp/keke-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/milisp/keke-agent/actions/workflows/ci.yml)
7
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
8
+ ![Platforms](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey)
9
+
10
+ **keke** 是用 Rust 写的本地编码 agent。用你已经在付费的 ChatGPT 或 Grok 订阅登录,或任意 API Key,都在同一个工具里完成。
11
+ TUI、`keke exec` 和桌面应用(通过 ACP)共用同一个会话。
12
+
13
+ 子 agent、MCP、skills、兼容 Claude 目录结构的插件、hooks、规划模式、
14
+ 按轮次的检查点和操作系统级沙箱都已内置。
15
+ 记忆和仓库自带的插件默认关闭,直到你打开它们。
16
+
17
+ https://github.com/user-attachments/assets/d8858043-f3ab-4c70-a493-fb1f6edbc196
18
+
19
+ ## 为什么选择 keke?
20
+
21
+ - **一个会话,所有入口。** 交互式 TUI 与面向脚本和 CI 的 `keke exec`
22
+ 共用一套会话协议。并发子 agent(有上限,子 agent 不能再派生子 agent)、后台
23
+ shell 任务,以及 `/loop`:一条稍后会再送回来的提示。规划模式可以调研并写下计划,但不能改仓库。
24
+
25
+ - **用你已经在付的账。** 用 ChatGPT(Codex)或 Grok 订阅登录,或任意 API Key。
26
+ Codex、Grok、Claude、OpenAI 兼容端点、Ollama、vLLM —— Chat Completions、
27
+ Responses 或 Anthropic Messages。同一供应商可登录多个账户,按所在目录选用。
28
+ 兼容端点在 `config.toml` 里写几行即可,不必重新编译。引擎 crate 不能依赖任何厂商插件,
29
+ 违反时 CI 会直接失败([`scripts/check-layering.py`](scripts/check-layering.py))。
30
+
31
+ - **默认关闭。** Skills 可以禁用。持久记忆在设定目录之前是关闭的。
32
+ 随仓库提供的 hooks 和 MCP 服务器不会因为 `git clone` 就执行(见[安全](#安全))。
33
+
34
+ - **检查点在仓库之外。** 每一轮都把工作区快照存到仓库之外的存储里,
35
+ 回退 agent 的修改既不是 stash,也不是一次提交。
36
+
37
+ ## 安装
38
+
39
+ ### npm
40
+
41
+ ```sh
42
+ npm install -g @milisp/keke
43
+ ```
44
+
45
+ 也可以从
46
+ [最新 Release](https://github.com/milisp/keke-agent/releases/latest) 直接下载二进制,
47
+ 或用 `cargo build --release` 从源码构建。
48
+
49
+ ### Shell
50
+
51
+ ```sh
52
+ curl -fsSL https://raw.githubusercontent.com/milisp/keke-agent/main/scripts/install.sh | sh
53
+ ```
54
+
55
+ 脚本会把适合当前平台的最新预编译二进制下载到
56
+ `~/.local/bin`(可用 `KEKE_INSTALL_DIR` 覆盖)。把远程脚本管道进
57
+ `sh` 会以你的权限执行——若在意这一点,先检查内容:
58
+ `curl -fsSL .../install.sh | less`。
59
+
60
+ ## 快速试用(30 秒)
61
+
62
+ ```sh
63
+ keke doctor # 先看清哪些 provider / 登录能解析,再依赖其中之一
64
+
65
+ # 用已有付费订阅登录……
66
+ keke login codex
67
+ keke login grok
68
+ # ……或直接提供 Key
69
+ export ANTHROPIC_API_KEY=sk-ant-...
70
+
71
+ keke exec "what does this project do?" # 一次性运行,适合脚本与 CI
72
+ keke # 交互式 TUI
73
+ keke resume # 接上一次对话
74
+ ```
75
+
76
+ 在 TUI 里,Option+↑/↓(Linux 上为 Alt+↑/↓)可在你之前发过的消息之间跳转。
77
+
78
+ Provider 路由、API Key、本地模型、网关、按目录账户及其他设置,见[配置文档](docs/configuration/README.md)。
79
+
80
+ ## 安全
81
+
82
+ - **沙箱与审批** — shell 命令运行在操作系统级沙箱中(macOS 用 Seatbelt,Linux 用 Landlock + seccomp):默认只能写入工作区、没有直接联网能力;macOS 上,以及 Linux 启用可选的 bubblewrap 后端时,域名和端口可按命令逐次审批;Git 的 hooks 和 config 只读(macOS 上强制)。越过沙箱时每次都会审查:Auto 模式由 guardian 审查,其他模式由你确认;`approval_policy = "never"` 会跳过审查。Windows 没有沙箱,每条命令都会先询问你。仓库自带的配置只能收紧、不能放宽沙箱。运行环境无法强制执行沙箱时,CI 会失败而不是跳过。详见 [`docs/configuration/sandbox.md`](docs/configuration/sandbox.md)。
83
+ - **插件信任** — 仓库自带的插件(hooks、MCP servers)不会仅因 `git clone` 就执行;必须由人按**内容**(而非路径)批准,且它们不能把已有的拒绝改回允许。没有关闭该门禁的开关。
84
+
85
+ ## 许可证
86
+
87
+ Apache-2.0。见 [`LICENSE`](LICENSE) 与 [`NOTICE`](NOTICE)。设计理由与源码归属见
88
+ [`docs/architecture.md`](docs/architecture.md#why-it-is-shaped-this-way)
89
+ 以及相关 crate 中的 `THIRD_PARTY_NOTICES.md`。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milisp/keke",
3
- "version": "0.1.54",
3
+ "version": "0.2.1",
4
4
  "description": "keke is a multi-vendor terminal coding agent.",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -18,12 +18,12 @@
18
18
  "win32"
19
19
  ],
20
20
  "optionalDependencies": {
21
- "@milisp/keke-darwin-x64": "0.1.54",
22
- "@milisp/keke-darwin-arm64": "0.1.54",
23
- "@milisp/keke-linux-x64": "0.1.54",
24
- "@milisp/keke-linux-arm64": "0.1.54",
25
- "@milisp/keke-win32-x64": "0.1.54",
26
- "@milisp/keke-win32-arm64": "0.1.54"
21
+ "@milisp/keke-darwin-x64": "0.2.1",
22
+ "@milisp/keke-darwin-arm64": "0.2.1",
23
+ "@milisp/keke-linux-x64": "0.2.1",
24
+ "@milisp/keke-linux-arm64": "0.2.1",
25
+ "@milisp/keke-win32-x64": "0.2.1",
26
+ "@milisp/keke-win32-arm64": "0.2.1"
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",