@deveco-test/deveco-code-darwin-arm64 0.1.0-TD.4.9 → 0.1.1-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/README.md CHANGED
@@ -1,6 +1,328 @@
1
- # DevEco Code
1
+ <p align="center">
2
+ <h1 align="center">DevEco Code</h1>
3
+ </p>
4
+ <p align="center">面向 HarmonyOS 开发场景的 AI Agent 工具。</p>
5
+ <p align="center">
6
+ <a href="README.en.md">English</a> · 简体中文
7
+ </p>
2
8
 
3
- 项目主文档已移至仓库根目录,请查看:
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@deveco/deveco-code"><img alt="NPM Version" src="https://img.shields.io/npm/v/@deveco/deveco-code.svg" /></a>
11
+ <a href="https://www.npmjs.com/package/@deveco/deveco-code"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/@deveco/deveco-code.svg" /></a>
12
+ <img alt="Node.js" src="https://img.shields.io/badge/Node.js-%3E%3D22-green.svg" />
13
+ <img alt="platform" src="https://img.shields.io/badge/platform-macOS%20(Arm%20%7C%20x64)%20%7C%20Windows-blue.svg" />
14
+ <a href="https://developer.huawei.com/consumer/cn/deveco-studio/"><img alt="DevEco Studio" src="https://img.shields.io/badge/DevEco%20Studio-%3E%3D6.1-orange.svg" /></a>
15
+ <a href="https://gitcode.com/openharmony-sig/deveco-code/blob/develop/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-MIT-green.svg" /></a>
16
+ </p>
4
17
 
5
- - [README.md(简体中文)](../../README.md)
6
- - [README_EN.md(English)](../../README_EN.md)
18
+ <p align="center">
19
+ <img src="https://raw.gitcode.com/openharmony-sig/deveco-code/raw/develop/assets/readme/readme-screenshot.png" alt="DevEco Code" width="600">
20
+ </p>
21
+
22
+ ***
23
+
24
+ ## 快速开始
25
+
26
+ ```bash
27
+ # 1. 安装
28
+ npm install -g @deveco/deveco-code
29
+
30
+ # 2. 启动
31
+ deveco
32
+
33
+ # 3. 开始对话 —— 在终端中直接描述你的 HarmonyOS 开发需求
34
+ 提示词示例:
35
+ - 解释一下代码库的架构
36
+ - 帮我重构login_check这个函数
37
+ - 帮我检查并修复语法错误
38
+ ```
39
+
40
+ > 建议使用 [npm 官方源](https://registry.npmjs.org/) 或 [淘宝镜像源](https://registry.npmmirror.com/) 安装,其他镜像源可能因同步延迟导致安装失败或版本滞后。
41
+
42
+ > 如需编译构建、设备运行等能力,请先安装 [DevEco Studio](https://developer.huawei.com/consumer/cn/deveco-studio/) 并配置 `DEVECO_HOME` 环境变量。
43
+
44
+ ## 简介
45
+
46
+ DevEco Code 是一款面向 HarmonyOS 开发场景的 AI Agent 工具,支持代码编写、编译构建、设备运行、文档查阅、运行时调试及 ArkTS 问题修复等能力。
47
+
48
+ DevEco Code 基于开源项目 OpenCode 扩展开发,保留了 OpenCode 的终端交互、配置体系、 Provider / MCP / Skill / Plugin 等能力,并针对 HarmonyOS 工程增加了 DevEco Studio、Hvigor、HDC、Skill、HarmonyOS 知识库、ArkTS 检查和设备调试相关集成。
49
+
50
+ ## 支持平台
51
+
52
+ DevEco Code 当前通过 npm 提供以下平台安装包:
53
+
54
+ | 平台 | 架构 | 说明 |
55
+ | --- | --- | --- |
56
+ | Windows | x64 | Windows 11 |
57
+ | macOS | arm64(Apple Silicon) | M 系列芯片 |
58
+ | macOS | x64(Intel) | Intel 芯片 Mac |
59
+
60
+ > 暂不支持 Linux。HarmonyOS 编译构建、模拟器与真机调试依赖 [DevEco Studio](https://developer.huawei.com/consumer/cn/deveco-studio/),且目前仅提供 Windows 与 macOS 版本。
61
+
62
+ ## 推荐配置
63
+
64
+ **操作系统**
65
+
66
+ - **Windows**:Windows 11 22H2 及以上
67
+ - **macOS**:macOS 15 Sequoia 及以上
68
+
69
+ **硬件**
70
+
71
+ - **日常使用**(短会话、单模块改动、以对话与代码编辑为主):8 GB 及以上内存
72
+ - **重度使用**(大工程、长会话、频繁编译构建与模拟器/真机调试):16 GB 及以上内存;建议为 DevEco Studio、SDK、模拟器与构建缓存预留 20 GB 及以上可用磁盘空间
73
+
74
+ **运行时与工具链**
75
+
76
+ - [Node.js](https://nodejs.org) **22 及以上**
77
+ - [DevEco Studio](https://developer.huawei.com/consumer/cn/deveco-studio/) **6.1 及以上**(编译构建、Hvigor、HDC、模拟器/真机运行)
78
+ - 已配置 `DEVECO_HOME` 环境变量,指向 DevEco Studio 安装目录
79
+
80
+ **终端 Shell**
81
+
82
+ - Windows:PowerShell 7+(推荐)、PowerShell 5.1+
83
+ - macOS:Zsh(推荐)、Bash
84
+
85
+ **网络**
86
+
87
+ - 需要稳定的互联网连接(华为账号登录、模型调用、HarmonyOS 知识库检索等)
88
+
89
+ ## 安装前置
90
+
91
+ DevEco Code 通过 npm 分发,安装前请先准备以下环境:
92
+
93
+ 1. 安装 [Node.js](https://nodejs.org),**推荐使用 22 及更高版本**
94
+ 2. (可选)安装 [DevEco Studio](https://developer.huawei.com/consumer/cn/deveco-studio/),**推荐使用 6.1 及更高版本**;若不安装,HarmonyOS 应用构建、推包等工具将无法使用
95
+ 3. (可选)配置 `DEVECO_HOME` 环境变量指向 DevEco Studio 安装目录,默认路径示例:
96
+ - **macOS**:`/Applications/DevEco-Studio.app`
97
+ - **Windows**:`C:\Program Files\Huawei\DevEco Studio`
98
+
99
+ 可先在终端验证 Node.js 环境:
100
+
101
+ ```bash
102
+ node -v
103
+ npm -v
104
+ ```
105
+
106
+ ## 安装与卸载
107
+
108
+ 安装:
109
+
110
+ ```bash
111
+ npm install -g @deveco/deveco-code
112
+ ```
113
+
114
+ 查看版本、启动:
115
+
116
+ ```bash
117
+ deveco --version
118
+ deveco
119
+ ```
120
+
121
+ 更新:
122
+
123
+ ```bash
124
+ deveco upgrade
125
+ ```
126
+
127
+ 卸载运行时数据与全局包:
128
+
129
+ ```bash
130
+ deveco uninstall
131
+ npm uninstall -g @deveco/deveco-code
132
+ ```
133
+
134
+ ## 登录与登出
135
+
136
+ 使用 DevEco Code 需先通过华为账号登录。首次执行 `deveco` 时会在终端内引导完成登录;也可单独执行登录命令:
137
+
138
+ ```bash
139
+ deveco auth login
140
+ ```
141
+
142
+ 登出会清除当前华为账号的本地登录状态,下次启动需重新登录。执行:
143
+
144
+ ```bash
145
+ deveco auth logout
146
+ ```
147
+
148
+ ## 模型配置
149
+
150
+ 登录后可使用 DevEco Code 提供的免费模型通道。
151
+
152
+ 在 DevEco Code 中输入 `/models` 可进入模型配置界面。当前免费提供 `GLM-5.1` 模型,单账号默认每分钟 50 次请求。也可以通过 `Ctrl+A` 进入 Provider 选择界面,配置支持的第三方模型。
153
+
154
+ 也可以通过 `deveco.jsonc` 配置模型:
155
+
156
+ ```jsonc
157
+ {
158
+ "$schema": "https://opencode.ai/config.json",
159
+ "provider": {
160
+ "deveco": {
161
+ "name": "DevEco Code",
162
+ "models": {
163
+ "glm-5": {
164
+ "tool_call": true,
165
+ "limit": {
166
+ "context": 200000,
167
+ "output": 8192
168
+ }
169
+ }
170
+ },
171
+ "options": {
172
+ "baseURL": "https://api.openbitfun.com/v1",
173
+ "apiKey": "{env:DEVECO_API_KEY}"
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ **UI 检查配置**
181
+
182
+ UI 检查是功能验证阶段的可选能力,用于验证界面是否符合需求描述。
183
+
184
+ 该功能需调用多模态模型:已登录账号时默认使用内置 Qwen3-VL 模型,未登录时则跳过UI检查。
185
+
186
+ 如需配置第三方多模态模型(仅支持 Qwen 系列),可在 `deveco.jsonc` 的 `agent` 中指定,以qwen3-vl-plus为例:
187
+
188
+ ```jsonc
189
+ {
190
+ "$schema": "https://opencode.ai/config.json",
191
+ "provider": {
192
+ "myprovider": {
193
+ "npm": "@ai-sdk/openai-compatible",
194
+ "name": "alibaba",
195
+ "options": {
196
+ "baseURL": "https://dashscope.aliyuncs.com/compatible-mode/v1",
197
+ "apiKey": "your-api-key",
198
+ },
199
+ "models": {
200
+ "qwen3-vl-plus": {
201
+ "modalities": {
202
+ "input": ["text", "image"],
203
+ "output": ["text"],
204
+ },
205
+ },
206
+ },
207
+ },
208
+ },
209
+ "agent": {
210
+ "ui_verification": {
211
+ "mode": "subagent",
212
+ "model": "myprovider/qwen3-vl-plus", // 格式为<provider-name>/<model-name>
213
+ "hidden": true,
214
+ },
215
+ },
216
+ }
217
+ ```
218
+
219
+ 配置文件读取优先级:
220
+
221
+ 1. 项目目录下 `.deveco/deveco.jsonc`
222
+ 2. 项目目录下 `deveco.jsonc`
223
+ 3. 用户目录下 `.config/deveco/deveco.jsonc`
224
+
225
+ ## Agent 配置
226
+
227
+ DevEco Code 面向 HarmonyOS 开发提供以下 Agent 配置(按 `Tab` 键切换):
228
+
229
+ - `Build`:默认模式,适合工程生成、代码生成、配置修正、测试执行、推包运行和发布执行
230
+ - `Plan`:适合需求拆解、技术方案、发布规划、测试规划和文档生成
231
+ - `Goal`:适合 SDD 五阶段从需求到实现与构建验证的端到端特性交付
232
+
233
+ ## HarmonyOS 场景能力
234
+
235
+ DevEco Code 集成了常用 HarmonyOS 开发工具能力:
236
+
237
+ | 工具 | 说明 |
238
+ | ------------------------ | -------------------- |
239
+ | `build_project` | 执行编译构建并导出构建产物 |
240
+ | `start_app` | 在模拟器或真机上运行应用 |
241
+ | `hdc_log` | 收集/清理设备日志/查看连接模拟器 |
242
+ | `verify_ui` | 执行 UI 操作验证功能是否正确 |
243
+ | `check_ets_files` | ArkTS 静态语法检查 |
244
+ | `arkts_knowledge_search` | HarmonyOS 知识搜索 |
245
+ | `switch_cwd` | 切换构建项目路径 |
246
+
247
+ 常见场景包括:从零到一创建 HarmonyOS 工程、增量开发页面、修复编译报错、真机调试。
248
+
249
+ ## 扩展能力
250
+
251
+ DevEco Code 兼容 OpenCode 的 Skill、MCP 和 Plugin 扩展方式。
252
+
253
+ > 新增或修改 Skill、MCP、Plugin 配置后,需退出并重新执行 `deveco` 启动后才会生效。
254
+
255
+ ### Skills
256
+
257
+ ```bash
258
+ npx skills add vercel-labs/agent-skills
259
+ ```
260
+
261
+ 也可以把 Skill 放到 `~/.config/deveco/skills` 目录。
262
+
263
+ ### MCP
264
+
265
+ 可在 `~/.config/deveco/deveco.jsonc` 中配置 MCP:
266
+
267
+ ```jsonc
268
+ {
269
+ "$schema": "https://opencode.ai/config.json",
270
+ "mcp": {
271
+ "playwright": {
272
+ "type": "local",
273
+ "command": ["npx", "@playwright/mcp@latest"],
274
+ "enabled": true
275
+ }
276
+ }
277
+ }
278
+ ```
279
+
280
+ ### Plugins
281
+
282
+ ```bash
283
+ npm install -g oh-my-opencode
284
+ ```
285
+
286
+ 然后在 `deveco.jsonc` 中配置插件入口:
287
+
288
+ ```jsonc
289
+ {
290
+ "plugin": [
291
+ "node_modules/oh-my-opencode/dist/index.js"
292
+ ]
293
+ }
294
+ ```
295
+
296
+ ## 从 OpenCode 迁移
297
+
298
+ 如果需要从 OpenCode 迁移到 DevEco Code,请将配置文件迁移到 DevEco Code 目录。主配置文件可参考:
299
+
300
+ ```powershell
301
+ # Windows PowerShell
302
+ Copy-Item -Force "{源路径}\opencode.jsonc" "~\.config\deveco\deveco.jsonc"
303
+ ```
304
+
305
+ ```bash
306
+ # macOS
307
+ cp {源路径}/opencode.jsonc ~/.config/deveco/deveco.jsonc
308
+ ```
309
+
310
+ Skills、Agents、Plugins 也可以迁移到 `~/.config/deveco` 下的对应目录;MCP 配置项可迁移到 `deveco.jsonc` 中。
311
+
312
+ ## 参与贡献
313
+
314
+ 欢迎贡献!请在提交 Pull Request 前阅读 [CONTRIBUTING.md](CONTRIBUTING.md)。
315
+
316
+ ## 帮助与支持
317
+
318
+ - 常见问题请参阅 [FAQ 文档](https://gitcode.com/openharmony-sig/deveco-code/wiki/FAQ.md)
319
+ - 终端常用命令(如 `/models`、`/connect` 等)请参阅 [OpenCode TUI 文档](https://opencode.ai/docs/zh-cn/tui/)
320
+ - 反馈与交流 [GitCode Issue](https://gitcode.com/openharmony-sig/deveco-code/issues)
321
+
322
+ ## 开源许可
323
+
324
+ [MIT License](LICENSE)
325
+
326
+ ## 基于 OpenCode 构建的声明
327
+
328
+ 本项目基于开源项目 [OpenCode](https://opencode.ai) 扩展开发。DevEco Code **并非** OpenCode 团队出品,也与 OpenCode 团队无任何附属或关联关系。如有与 DevEco Code 相关的问题,请通过 [GitCode Issue](https://gitcode.com/openharmony-sig/deveco-code/issues) 反馈,而非联系 OpenCode 社区。
package/bin/deveco CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deveco-test/deveco-code-darwin-arm64",
3
- "version": "0.1.0-TD.4.9",
3
+ "version": "0.1.1-1",
4
4
  "preferUnplugged": true,
5
5
  "os": [
6
6
  "darwin"
@@ -11,6 +11,7 @@
11
11
  "files": [
12
12
  "bin/**/*",
13
13
  "vendor/**/*",
14
- "README.md"
14
+ "README.md",
15
+ "assets/**/*"
15
16
  ]
16
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deveco-codegenie/mcp-bridge-darwin-arm64",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "@deveco-codegenie/mcp-bridge darwin native module",
5
5
  "os": [
6
6
  "darwin"