@luban-code/luban-code 0.0.0-stage → 1.66.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/LICENSE +204 -0
- package/README.md +99 -2
- package/README.zh.md +151 -0
- package/dist/cli.js +1014 -0
- package/dist/extension.js +899 -0
- package/package.json +551 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 eppen (liuhualiang)
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
203
|
+
|
|
204
|
+
Copyright 2026 eppen (liuhualiang)
|
package/README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Luban
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://marketplace.visualstudio.com/items?itemName=liuhualiang.luban)
|
|
4
|
+
[](https://marketplace.visualstudio.com/items?itemName=liuhualiang.luban)
|
|
5
|
+
[](https://github.com/eppen/luban/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
**A side-bar coding agent for VS Code and VSCodium.** Describe what you want — it edits files in your workspace, runs a script or the build to verify, then tells you what changed. No patched editor, no takeover of the native chat: a normal extension that installs from the Marketplace.
|
|
8
|
+
|
|
9
|
+
**中文简介**:装在侧边栏里的编码 agent。说人话 → 它改文件、跑命令、自己验证,然后告诉你改了什么。零源码补丁,可从 VS Code 市场 / Open VSX / VSIX 安装,也能用脚本装成 App 的内置扩展。[完整中文说明 →](https://github.com/eppen/luban/blob/main/README.zh.md)
|
|
10
|
+
|
|
11
|
+
<!-- 截图占位:把图片放进 media/screenshots/ 后,取消下面两行的注释 -->
|
|
12
|
+
<!--  -->
|
|
13
|
+
<!--  -->
|
|
14
|
+
|
|
15
|
+
## Highlights
|
|
16
|
+
|
|
17
|
+
- **Plan first, execute after you approve** — Plan mode is read-only by construction (write tools are not registered, commands are checked). The plan is saved as a Markdown file you can edit; executing it re-reads that file. You can also pick a Cursor plan (`~/.cursor/plans/*.plan.md`) from the command palette and execute it with Luban.
|
|
18
|
+
- **Review in the editor, not in chat** — every write opens a real diff: accept or reject hunk by hunk from CodeLens or the diff title bar.
|
|
19
|
+
- **Context without ceremony** — `@file`, `@folder/`, `#selection`, or right-click a file or folder in the Explorer → **Add File / Folder to Luban Chat**; select code in the editor and right-click **Add Selection to Luban Chat** (or `Cmd/Ctrl+Alt+A`) to drop a `#selection path:start-end` token that carries its own position, so several selections can stack; plus automatic context from the editor around your cursor; a local BM25 index backs `search_code`, with `glob` for filenames and `grep` for regex.
|
|
20
|
+
- **Real edits, reversible** — `write_file` / `replace_in_file` / `apply_patch` (multi-file add/update/delete), plus `delete_file` / `move_file`; every change lands in REVIEW with per-hunk accept/undo, and `read_lints` lets the agent see type/syntax errors right after writing.
|
|
21
|
+
- **Any OpenAI-compatible provider** — DeepSeek, Ollama, llama.cpp, vLLM and friends via `~/.luban/providers.json`. API keys go to SecretStorage, never to disk.
|
|
22
|
+
- **Sessions that survive a reload** — history on disk, several concurrent tabs, a message queue while a turn is running, opt-in multi-turn memory. Sent prompts can be edited in place (`✎`): pressing Send truncates everything after it and reruns the turn with the edited text. The history popup has a search box: titles filter as you type, 2+ characters also scan message text, tool results and file references.
|
|
23
|
+
- **Built for cheap multi-turn** — message layout is aligned to token prefix caching (typically 95%+ cache hits after the second turn); each turn shows input / output / cache / context usage, and a local ledger feeds a token dashboard.
|
|
24
|
+
- **Extensible** — local stdio MCP servers and `SKILL.md` skills join the same tool loop; Plan mode only sees tools declared read-only.
|
|
25
|
+
- **Optional real-browser view** — `browser` drives a local headless Chrome/Edge over CDP (read-only: open, accessibility snapshot, screenshot, console, failed requests). Off by default via `luban.browser.enabled`; screenshots are only visible to models with `vision` enabled.
|
|
26
|
+
- **Optional desktop control (macOS and Windows)** — `computer` screenshots the real screen, reads on-screen text via OCR (macOS; on Windows it falls back to viewing the screenshot), lists windows, and can click / double-click / drag / scroll / type / send key combos. Off by default via `luban.computer.enabled`; the first action that touches mouse or keyboard asks for confirmation; unavailable in Plan mode; models without `vision` automatically fall back to OCR text.
|
|
27
|
+
- **Optional tab completion** — DeepSeek FIM completion, off by default.
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
| Where | How |
|
|
32
|
+
|---|---|
|
|
33
|
+
| VS Code | Extensions panel → search `Luban` → install, or use the [Marketplace page](https://marketplace.visualstudio.com/items?itemName=liuhualiang.luban) |
|
|
34
|
+
| VSCodium / Open VSX | Extensions panel → search `Luban` → install |
|
|
35
|
+
| VSIX | Download `luban-v*.vsix` from [Releases](https://github.com/eppen/luban/releases), then `⋯` → **Install from VSIX…** |
|
|
36
|
+
| Built-in extension | `./install-into-vscodium.sh` — installs Luban as an app-level extension (VSCodium only, re-run after every app upgrade) |
|
|
37
|
+
|
|
38
|
+
Requirements: VS Code / VSCodium **1.100+**, plus at least one provider (a remote one needs an API key; a loopback endpoint such as Ollama / llama.cpp / vLLM runs without one).
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
1. **Configure a provider** — click **⚙** at the bottom of the panel (or run `Provider settings`), fill in base URL, models and API key, then hit *Test connection*.
|
|
43
|
+
2. **Open the panel** — Luban icon in the activity bar, or `Cmd+Shift+L`.
|
|
44
|
+
3. **Ask for something** — e.g. `新建 utils.js,导出 debounce(fn, ms) 和 throttle(fn, ms),然后用 node 测一下两者行为`.
|
|
45
|
+
|
|
46
|
+
Editing `~/.luban/providers.json` by hand works too (run `Reload providers.json` after):
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"defaultModel": "deepseek::deepseek-flash",
|
|
51
|
+
"providers": [
|
|
52
|
+
{
|
|
53
|
+
"id": "deepseek",
|
|
54
|
+
"name": "DeepSeek",
|
|
55
|
+
"baseUrl": "https://api.deepseek.com/v1",
|
|
56
|
+
"apiKeyEnv": "DEEPSEEK_API_KEY",
|
|
57
|
+
"models": [
|
|
58
|
+
{ "id": "deepseek-flash", "name": "DeepSeek Flash",
|
|
59
|
+
"maxInputTokens": 65536, "maxOutputTokens": 8192, "toolCalling": true }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Modes
|
|
67
|
+
|
|
68
|
+
| Mode | What it can do |
|
|
69
|
+
|---|---|
|
|
70
|
+
| **Agent** | Read / write files and run commands, then verify the result. |
|
|
71
|
+
| **Plan** | Read-only investigation; produces a plan file and touches nothing until you press *Execute*. |
|
|
72
|
+
| **Chat** | Plain Q&A, no file access. Add `@web` to search first. |
|
|
73
|
+
|
|
74
|
+
## Documentation
|
|
75
|
+
|
|
76
|
+
The Marketplace only renders this page, so the details live on GitHub:
|
|
77
|
+
|
|
78
|
+
| | |
|
|
79
|
+
|---|---|
|
|
80
|
+
| [Usage and features](https://github.com/eppen/luban/blob/main/docs/usage.md) | Shortcuts, three modes, plan files, `@` `#` references, web search |
|
|
81
|
+
| [Tools, MCP and skills](https://github.com/eppen/luban/blob/main/docs/tools.md) | Every built-in tool, stdio MCP servers, `SKILL.md` |
|
|
82
|
+
| [Reviewing changes](https://github.com/eppen/luban/blob/main/docs/review.md) | Editor diff, per-hunk accept / reject |
|
|
83
|
+
| [Sessions and memory](https://github.com/eppen/luban/blob/main/docs/sessions.md) | History layout, tabs, multi-turn memory, message queue |
|
|
84
|
+
| [How it works](https://github.com/eppen/luban/blob/main/docs/internals.md) | Request flow, tool-loop budgets, prefix caching, usage, dashboard |
|
|
85
|
+
| [Configuration](https://github.com/eppen/luban/blob/main/docs/configuration.md) | Provider panel, `providers.json`, all settings, code layout |
|
|
86
|
+
| [Known limitations](https://github.com/eppen/luban/blob/main/docs/limitations.md) | What is deliberately not supported |
|
|
87
|
+
| [Troubleshooting](https://github.com/eppen/luban/blob/main/docs/troubleshooting.md) | Symptom → cause → fix |
|
|
88
|
+
| [Verification](https://github.com/eppen/luban/blob/main/docs/verification.md) | Test results per release |
|
|
89
|
+
| [Debugging and release](https://github.com/eppen/luban/blob/main/docs/development.md) | Headless `op` channel, release pipeline |
|
|
90
|
+
| [Changelog](https://github.com/eppen/luban/blob/main/docs/changelog.md) | Per-version changes |
|
|
91
|
+
|
|
92
|
+
## Safety
|
|
93
|
+
|
|
94
|
+
`run_command` executes in **your own shell** — there is no OS-level sandbox. Plan mode adds a heuristic read-only check on commands, and file tools may touch paths outside the workspace (`luban.fs.allowOutsideWorkspace=false` restricts them). MCP servers run as child processes with your user's permissions: only configure servers you trust. See [known limitations](https://github.com/eppen/luban/blob/main/docs/limitations.md).
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
Apache-2.0 © 2026 eppen (liuhualiang). See [LICENSE](https://github.com/eppen/luban/blob/main/LICENSE) and [NOTICE](https://github.com/eppen/luban/blob/main/NOTICE).
|
|
99
|
+
|
|
100
|
+
The Luban name and icon are not licensed under Apache-2.0.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Luban(鲁班)
|
|
2
|
+
|
|
3
|
+
[](https://marketplace.visualstudio.com/items?itemName=liuhualiang.luban)
|
|
4
|
+
[](https://marketplace.visualstudio.com/items?itemName=liuhualiang.luban)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
VSCodium / VS Code 里的**侧边栏 AI 编码助手**:说人话 → 它改文件、跑命令、自己验证,然后告诉你改了什么。
|
|
8
|
+
零源码补丁(不动编辑器源码):可以从 VS Code 市场 / Open VSX / VSIX 作为普通扩展安装,也可以用脚本装成 App 的内置扩展。
|
|
9
|
+
|
|
10
|
+
版本 **1.23.2** · [English](README.md) · [全部文档](docs/README.md)
|
|
11
|
+
|
|
12
|
+
<!-- 截图占位:把图片放进 media/screenshots/ 后,取消下面两行的注释 -->
|
|
13
|
+
<!--  -->
|
|
14
|
+
<!--  -->
|
|
15
|
+
|
|
16
|
+
## 它是什么
|
|
17
|
+
|
|
18
|
+
一个装在侧边栏里的编码 agent。你描述要做什么,它直接读写你工作区里的文件、跑命令验证,最后用一两句话汇报。
|
|
19
|
+
|
|
20
|
+
**四个不一样的地方**
|
|
21
|
+
|
|
22
|
+
- **审阅在编辑器里**:每写一个文件自动开出原生 diff,标题栏与两侧 CodeLens 逐块保留 / 撤销,聊天区只留一行摘要
|
|
23
|
+
- **只读是真的只读**:Plan 模式下写文件的工具根本没注册,命令还要过一道只读校验,产出的计划落成 Markdown 文件,你改完再执行就按改后的走
|
|
24
|
+
- **为省 token 而设计**:消息排布对齐前缀缓存(第 2 轮起通常 95%+ 命中),每轮显示输入 / 输出 / 缓存 / 上下文占用,另有本地账本与用量看板
|
|
25
|
+
- **不挑模型**:任何 OpenAI 兼容端点(DeepSeek / Ollama / llama.cpp / vLLM…),API key 存 SecretStorage 不落盘
|
|
26
|
+
|
|
27
|
+
**能做的事**
|
|
28
|
+
|
|
29
|
+
- 生成代码:新建文件、整体重写
|
|
30
|
+
- 修改代码:读原文 → 精确局部替换(不做"整文件重写"式瞎改)
|
|
31
|
+
- 自我验证:写完自己跑 `node xxx.js` / `npx tsc --noEmit`,用真实输出说话
|
|
32
|
+
- 先计划后执行:Plan 模式只读调研出计划,你确认了才动文件;命令面板也能读取 Cursor 的计划文件(`~/.cursor/plans/*.plan.md`)直接执行
|
|
33
|
+
- 多 provider:DeepSeek / 任何 OpenAI 兼容端点,配置里加一段就行
|
|
34
|
+
- 多轮记忆:同一会话里的追问会带上前几轮的提问与回答(只带正文,按轮数 / 字符预算自动裁剪)
|
|
35
|
+
- 历史查询:会话弹层顶部有搜索框 —— 标题即时过滤,输入 2 个字以上连正文一起查(回答、工具结果、`@` 引用路径都能搜到),命中词高亮、命中行带一段摘要
|
|
36
|
+
- 改历史:已发出的提问点气泡上的 `✎` 就能就地改,点「发送」自动截掉这条之后的记录并用改后的内容重新开跑一轮
|
|
37
|
+
- 代码引用:`@` 选文件、`@` 选文件夹、`#` 引用编辑器选区;在编辑器里选中代码后右键「Add Selection to Luban Chat」(或 `Cmd/Ctrl+Alt+A`)可插入带位置与行号的 `#selection 路径:起始-结束`,多次选区、跨文件都能叠加,发送时各自展开成一份引用
|
|
38
|
+
- 自动上下文:不写 `@` 也会把**本会话用过的文件**(`@` 引用过 / 带选区带过)的代码附在消息末尾(有选区给选区,否则光标附近约 200 行);别的会话正在看的文件不会被带进来,新会话首轮要带文件请用 `@` 或选中一段
|
|
39
|
+
- 代码检索:`search_code` 本地词法索引 + BM25,返回「路径:行号: 命中行」,大仓库不用再 `list_files` 全量扫
|
|
40
|
+
- Tab 补全:DeepSeek FIM 续写光标处代码,`Tab` 接受(默认关闭,命令面板一键开)
|
|
41
|
+
- 联网搜索:`@web` 先搜再答并列出来源;Agent / Plan 也能自己调 `web_search` / `web_fetch`
|
|
42
|
+
- 看真实页面:`browser` 用本机 Chrome / Edge 的无头实例打开地址、取可访问性大纲、截图、看 console 与失败请求(默认关闭,设置 `luban.browser.enabled=true`;只读,不点击不输入;截图只在开了 `vision` 的模型下才会被看到)
|
|
43
|
+
- 操作本机桌面(macOS / Windows):`computer` 截屏 / 识别屏幕文字 / 列窗口 / 点击 / 双击 / 拖动 / 滚动 / 输入 / 组合键(默认关闭,设置 `luban.computer.enabled=true`;首次动键鼠要确认一次;Plan 模式不可用;macOS 上没开 `vision` 的模型会自动改走 OCR 文字,Windows 暂未实现 OCR、只能看图)
|
|
44
|
+
- 工具循环按预算收敛:主约束是上下文窗口(工具结果占位压缩)+ 墙钟 + 死循环检测,轮数上限只作安全阀(默认 100,可配,0 = 不限)
|
|
45
|
+
- 每轮 usage:回答下方一行显示输入 / 输出 / 缓存命中 / 上下文占用 / 请求数,header 常驻上下文占用条(按模型窗口算百分比)
|
|
46
|
+
- 外部工具:本地 stdio MCP server 的工具并入同一个工具循环(`mcp__<server>__<tool>`),Plan 模式只放行声明只读的工具
|
|
47
|
+
- 技能:扫描 `~/.luban/skills`、`~/.claude/skills`、`~/.cursor/skills` 与项目同名目录,把 `SKILL.md` 的 name/description 注入系统提示,模型需要时用 `read_skill` 读全文
|
|
48
|
+
- 审阅改动:写完自动在编辑器开出 diff(标题栏「全部保留 / 全部撤销」+ 两侧 hunk 逐块 CodeLens)+ 行内 diff 高亮 + 侧边栏摘要卡片
|
|
49
|
+
|
|
50
|
+
**不做的事**(要做就得 fork 编辑器源码,明确冻结):next-edit prediction、向量语义检索。Tab 补全与本地词法检索已在 1.13.0 补上。
|
|
51
|
+
|
|
52
|
+
**和原生 chat 的关系**:没有关系。它不注册 chatAgent、不占用原生聊天窗口、不需要 `@luban`,VS Code 怎么改 chat 层都影响不到它。
|
|
53
|
+
|
|
54
|
+
## 安装
|
|
55
|
+
|
|
56
|
+
| 途径 | 做法 |
|
|
57
|
+
|---|---|
|
|
58
|
+
| VS Code 官方市场 | 扩展面板搜 `Luban`,或 <https://marketplace.visualstudio.com/items?itemName=liuhualiang.luban> |
|
|
59
|
+
| Open VSX(VSCodium 默认) | 扩展面板搜 `Luban` |
|
|
60
|
+
| VSIX | 从 [Releases](https://github.com/eppen/luban/releases) 下载 `luban-v*.vsix`,扩展面板 `⋯` → **Install from VSIX…**;或命令行 `code --install-extension luban-v1.23.2.vsix`(VSCodium 用 `codium`) |
|
|
61
|
+
| 内置扩展(仅 VSCodium) | `./install-into-vscodium.sh`,装成 App 级扩展;每次升级 VSCodium 后要重跑 |
|
|
62
|
+
|
|
63
|
+
前置条件:
|
|
64
|
+
|
|
65
|
+
- VS Code / VSCodium **1.100+**
|
|
66
|
+
- `~/.luban/providers.json` 里至少配好一个 provider
|
|
67
|
+
- 对应的 API key(环境变量或 `~/.hermes/.env`);**本机端点免 key**(`localhost` / `127.x` 的 Ollama、llama.cpp、vLLM 等直接用)
|
|
68
|
+
|
|
69
|
+
### 装成内置扩展(脚本)
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
cd ~/luban
|
|
73
|
+
./install-into-vscodium.sh # 默认装到 ~/Applications/VSCodium.app
|
|
74
|
+
# 或指定路径:./install-into-vscodium.sh /Applications/VSCodium.app
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
脚本做四件事:
|
|
78
|
+
|
|
79
|
+
1. 复制扩展到 `VSCodium.app/Contents/Resources/app/extensions/luban`
|
|
80
|
+
2. 备份 `product.json`(`.orig`,只备一次)并把 `nameShort` / `nameLong` 改成 `Luban`
|
|
81
|
+
3. 删掉 `~/.vscode-oss/extensions/` 下的同名副本和 `extensions.json`
|
|
82
|
+
4. 提示你重启
|
|
83
|
+
|
|
84
|
+
重启后侧边栏会**自动打开**(可用设置项 `luban.autoOpen` 关掉)。这种方式不跟随市场自动更新,日常建议用市场版。
|
|
85
|
+
|
|
86
|
+
## 快速开始
|
|
87
|
+
|
|
88
|
+
1. **配 provider**:面板底部 **⚙**(或命令面板 `Provider settings`),填 `baseUrl` / 模型 / API key,点「测试连接」
|
|
89
|
+
2. **打开面板**:活动栏 Luban 图标,或 `Cmd+Shift+L`
|
|
90
|
+
3. **提需求**:`新建 utils.js,导出 debounce(fn, ms) 和 throttle(fn, ms),然后用 node 测一下两者行为`
|
|
91
|
+
|
|
92
|
+
也可以手改 `~/.luban/providers.json`(改完跑命令 `Reload providers.json` 热重载):
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"defaultModel": "deepseek::deepseek-flash",
|
|
97
|
+
"providers": [
|
|
98
|
+
{
|
|
99
|
+
"id": "deepseek",
|
|
100
|
+
"name": "DeepSeek",
|
|
101
|
+
"baseUrl": "https://api.deepseek.com/v1",
|
|
102
|
+
"apiKeyEnv": "DEEPSEEK_API_KEY",
|
|
103
|
+
"models": [
|
|
104
|
+
{ "id": "deepseek-flash", "name": "DeepSeek Flash",
|
|
105
|
+
"maxInputTokens": 65536, "maxOutputTokens": 8192, "toolCalling": true }
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
字段、key 解析顺序、Ollama 等本地端点的注意事项见 [配置](docs/configuration.md)。
|
|
113
|
+
|
|
114
|
+
## 三档模式
|
|
115
|
+
|
|
116
|
+
| 模式 | 能做什么 |
|
|
117
|
+
|---|---|
|
|
118
|
+
| **Agent** | 读写文件、跑命令、自己验证;需要外部信息时自己联网 |
|
|
119
|
+
| **Plan** | 只读调研,产出「目标 / 现状 / 步骤 / 验证方式 / 风险」计划并落盘,点「▶ 执行这个计划」才动文件 |
|
|
120
|
+
| **Chat** | 纯问答,不碰文件;带 `@web` 时先联网搜索再回答 |
|
|
121
|
+
|
|
122
|
+
## 文档
|
|
123
|
+
|
|
124
|
+
市场页面只渲染 `README.md`,细节都在 [docs/](docs/README.md):
|
|
125
|
+
|
|
126
|
+
| 文档 | 内容 |
|
|
127
|
+
|---|---|
|
|
128
|
+
| [用法与能力](docs/usage.md) | 快捷键、三档模式、Plan 计划文件、`@` `#` 引用、联网搜索 |
|
|
129
|
+
| [工具集、MCP 与技能](docs/tools.md) | 每个内置工具的参数与限制、stdio MCP、`SKILL.md` |
|
|
130
|
+
| [审阅变更](docs/review.md) | 编辑器内 diff、逐块保留 / 撤销 |
|
|
131
|
+
| [会话、多轮记忆与消息队列](docs/sessions.md) | 会话落盘、多标签、记忆派生、排队接力 |
|
|
132
|
+
| [工作原理与内部机制](docs/internals.md) | 请求链路、工具循环闸门、前缀缓存、usage、用量看板 |
|
|
133
|
+
| [配置](docs/configuration.md) | Provider 面板、`providers.json`、全部设置项、代码结构 |
|
|
134
|
+
| [已知限制](docs/limitations.md) | 功能冻结后明确不做的部分 |
|
|
135
|
+
| [竞品对比](docs/competitive-analysis.zh.md) | 同类编码 agent 的对比矩阵、差异点与短板 |
|
|
136
|
+
| [常见故障处理](docs/troubleshooting.md) | 按现象查原因 |
|
|
137
|
+
| [验证记录](docs/verification.md) | 各版本的真机 / 桩测试结果 |
|
|
138
|
+
| [调试、无头验证与发布](docs/development.md) | 无头 `op` 列表、维护者发布流程 |
|
|
139
|
+
| [变更历史](docs/changelog.md) | 按版本记录的改动要点 |
|
|
140
|
+
|
|
141
|
+
## 安全须知
|
|
142
|
+
|
|
143
|
+
`run_command` 跑的就是**你本机的 shell**,没有 OS 级沙箱;Plan 模式额外加一道启发式只读校验。文件工具默认允许操作工作区外的路径(`luban.fs.allowOutsideWorkspace=false` 可收回)。MCP server 是权限等同当前用户的子进程,只配置可信 server。详见 [已知限制](docs/limitations.md)。
|
|
144
|
+
|
|
145
|
+
## 许可
|
|
146
|
+
|
|
147
|
+
Apache-2.0 © 2026 eppen (liuhualiang)
|
|
148
|
+
|
|
149
|
+
版权与归属声明见 `NOTICE`;名称与图标不随 Apache-2.0 授权。
|
|
150
|
+
|
|
151
|
+
本协议自 1.7.1 起生效。
|