@deveco-test/deveco-cli-common 1.3.12-Test.2 → 1.3.12-Test.3

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
@@ -12,7 +12,7 @@
12
12
  </p>
13
13
  </div>
14
14
 
15
- `DevEco CLI` 将 `DevEco Studio` 工具链统一封装为一个 `CLI`,统一调用由 `DevEco Studio` / `Command Line Tools` 提供的 `ohpm`、`hvigor`、`hdc`、`emulator`、`hilog` 工具,同时集成 HarmonyOS 技能安装、项目脚手架、本地 HarmonyOS 文档检索、`ArkTS` 调试和 `MCP` 服务。工具链(`DevEco Studio` 或 `Command Line Tools`)需单独安装。
15
+ `DevEco CLI` 将 `DevEco Studio` 工具链统一封装为一个 `CLI`,统一调用由 `DevEco Studio` / `Command Line Tools` 提供的 `ohpm`、`hvigor`、`hdc`、`emulator`、`hilog` 工具,同时集成 HarmonyOS 技能安装、项目脚手架、本地 HarmonyOS 文档检索和 `MCP` 服务。工具链(`DevEco Studio` 或 `Command Line Tools`)需单独安装。
16
16
 
17
17
  > 关于数据采集与隐私(遥测打点内容、存储加密、上报及关闭方式),请参阅 [PRIVACY.md](./PRIVACY.md)。
18
18
 
@@ -96,6 +96,8 @@ devecocli device list
96
96
 
97
97
  `devecocli` 支持中国大陆(CN)、香港(HK)和澳门(MO)三个区域。其他地区的在线能力(登录、签名、协议查询、镜像下载、知识库下载等)不可用,纯本地命令(`create`/`build`/`device` 等)不受影响。
98
98
 
99
+ 港澳地区(HK/MO)下,Skills 市场云端命令(`skills list`/`find`/`add`)不可用;已安装 skills 为本地文件,不受影响。
100
+
99
101
  ## AI Agent 集成
100
102
 
101
103
  ### Agent 插件
@@ -2163,79 +2165,6 @@ devecocli run --module entry --hotreload-apply changes.txt
2163
2165
  - 无可启动的 `Ability`,或使用 `--hotreload` / `--hotreload-apply` 时,跳过冒烟检查。
2164
2166
  - 冒烟检查取证前默认等待 `3000` 毫秒(供应用完成冷启动),可通过环境变量 `DEVECO_CLI_SMOKE_WAIT_MS`(毫秒)调整:设为 `0` 立即取证;冷启动较慢的设备可适当调大以避免误报。
2165
2167
 
2166
- ### `debug`
2167
-
2168
- ArkTS 调试器(断点、日志断点、变量读写、事件流),经 `hdc fport` + CDP 直连设备,无需 IDE。
2169
-
2170
- **命令格式:**
2171
-
2172
- ```bash
2173
- devecocli debug start [-b <bundle>] [--module <name>] [--ability <name>] [--product <p>] [--device <name|serial>] [--stop-at-entry] [--skip-build] [--logpath <file>] [--json]
2174
- devecocli debug attach -b <bundle> [--pid <n>] [--module <name>] [--device <name|serial>] [--logpath <file>] [--json]
2175
- devecocli debug status [--json]
2176
- devecocli debug stop [--session <sN>] [--json]
2177
- devecocli debug bp add --path <file> --line <n> [--column <c>] [--condition <expr>] [--hit-count <N|=N|>=N|<=N|%N>] [--log <expr>] [--level <debug|info|warn|error>] [--disabled] [--session <sN>] [--json]
2178
- devecocli debug bp remove (--id <bpId> | --path <file> [--line <n>] | --all [--kind <breakpoint|logpoint|all>]) [--json]
2179
- devecocli debug bp list [--kind <breakpoint|logpoint|all>] [--session <sN>] [--json]
2180
- devecocli debug bp enable | disable (--id <bpId> | --path <file> --line <n> | --all) [--json]
2181
- devecocli debug resume [--thread <main|workerThread_<tid>|instanceId|all>] [--session <sN>] [--json]
2182
- devecocli debug pause [--thread <id|name>] [--session <sN>] [--json]
2183
- devecocli debug step [--into | --over | --out] [--thread <id|name>] [--session <sN>] [--json]
2184
- devecocli debug stack [--frame <N>] [--max <N>] [--thread <id|name>] [--session <sN>] [--json]
2185
- devecocli debug vars [--name <varPath>] [--frame <N>] [--thread <id|name>] [--session <sN>] [--json]
2186
- devecocli debug eval <expr> [--frame <N>] [--thread <id|name>] [--session <sN>] [--json]
2187
- devecocli debug set --name <var> --value <expr> [--frame <N>] [--thread <id|name>] [--session <sN>] [--json]
2188
- devecocli debug events [--follow] [--filter <type[:level][,type[:level]]>] [--session <sN>] [--json]
2189
- ```
2190
-
2191
- **参数:**
2192
-
2193
- | 参数 | 说明 |
2194
- | ------------------------- | ----------------------------------------------------- |
2195
- | `-b, --bundle <bundle>` | `start` 缺省从工程推导,`attach` 必填 |
2196
- | `--device <name\|serial>` | 设备名或序列号;多设备时必填,缺失报错并列出设备 |
2197
- | `--stop-at-entry` | 等待入口暂停,`resume` 依次放行。等待超时返回 `TIMEOUT`,调试连接断开时返回 `CDP_ERROR`。 |
2198
- | `--skip-build` | 跳过编译,直接安装上次 debug 产物 |
2199
- | `--logpath <file>` | 事件 NDJSON 追加落盘,CLI 退出后仍持续写入 |
2200
- | `--session <sN>` | 会话 id;单会话可省略,多会话未指定报 `MULTI_SESSION` |
2201
- | `--thread <id\|name>` | 主线程 / Worker / TaskPool 线程目标 |
2202
- | `--json` | 单行紧凑 JSON 输出(`events --follow` 为 NDJSON 流) |
2203
-
2204
- **子命令:**
2205
-
2206
- | 子命令 | 说明 |
2207
- | ------------------------------------- | ---------------------------------------------------------------------------------------- |
2208
- | `start` | 构建 → 安装 → 拉起应用并建立调试会话 |
2209
- | `attach` | 直挂已运行的应用(`--pid` 或自动解析),不重新构建 |
2210
- | `status` | 查看守护进程、会话、线程与暂停位置 |
2211
- | `stop` | 结束会话并清理端口转发;应用进程继续运行 |
2212
- | `bp add` | 按源码位置下断点;`--log` 不中断日志断点、`--condition` 条件放行、`--hit-count` 计数触发 |
2213
- | `bp remove / list / enable / disable` | 删除(`--id`/`--path`/`--all`)、列表、停用与恢复断点 |
2214
- | `resume / pause / step` | 放行全部线程、暂停、单步(into / over / out) |
2215
- | `stack / vars / eval / set` | 暂停态查看调用栈、变量、求值与写回 |
2216
- | `events` | 事件流;`--follow` 实时输出,`--filter` 按类型与级别过滤 |
2217
-
2218
- **示例:**
2219
-
2220
- ```bash
2221
- devecocli debug start --stop-at-entry --json # 构建+安装+入口暂停(AI 须走 Start-Process 封装,见说明)
2222
- devecocli debug resume # 放行启动停靠
2223
- devecocli debug bp add --path entry/src/main/ets/pages/Index.ets --line 30
2224
- devecocli debug bp add --path entry/src/main/ets/pages/Index.ets --line 25 --log count --hit-count ">=3" # 不中断日志断点
2225
- devecocli debug events --follow --filter logpoint # 背景作业方式运行,见说明
2226
- devecocli debug stack --json # 命中后查看调用栈
2227
- devecocli debug vars --frame 0 --json # 查看当前帧变量
2228
- devecocli debug resume # 放行继续
2229
- devecocli debug stop --json # 结束会话(应用进程继续运行)
2230
- ```
2231
-
2232
- **说明:**
2233
-
2234
- - 所有命令经单个全局后台守护进程中转(首条调试命令自动拉起,30 分钟无活动且无会话自动退出);同一 bundle 同时只允许一个会话,与 IDE 调试互斥。
2235
- - **AI/自动化代理禁止直接执行会拉起守护进程的调试命令**(守护进程继承控制台句柄会使外层 shell 永不返回),须用 `Start-Process` 文件重定向封装并轮询输出;`events --follow` 为持续流,同样只能背景作业运行。详见 `SKILL.md`。
2236
- - 真机 VM 限制:`Debugger.evaluateOnCallFrame` 仅解析简单标识符;点路径表达式(`this.message`)由守护进程经属性链补齐,`@State` 变量自动解包,运算/调用/下标仍返回 `undefined`。详见 `SKILL.md`。
2237
- - 失败统一 `{"ok":false,"error":{"code","message"}}` 且退出码 1;RPC 明细记录在守护进程目录 `daemon.log`,原始 CDP 帧可经 `DEBUG_FRAME_LOG=<file>` 环境变量开启落盘。
2238
-
2239
2168
  ### `log`
2240
2169
 
2241
2170
  查看`hilog`普通日志或崩溃日志,或对本地故障日志/采样栈文件做结构化分析
@@ -2598,9 +2527,9 @@ devecocli skills remove --skill skillname --agent agentname # skillname需替
2598
2527
 
2599
2528
  管理白名单内的 AI 智能体插件。插件以 npm 包形式分发,版本取白名单 `npmPackage` 坐标上可选 `@tag` 后缀指定的 dist-tag(如 `@scope/pkg@cli` 用 `cli` 标签;未写后缀默认 `latest`),CLI 负责白名单校验、包下载与完整性校验、契约加载和生命周期编排;安装、卸载、更新的具体行为完全由各插件的 `install` / `uninstall` / `update` hook 定义。
2600
2529
 
2601
- **CLI 不保存任何安装状态**:`<数据目录>/plugins/store/<插件名>/<版本>/` 中的包缓存是唯一状态。install/update 每次都会重新执行 hook(幂等性由插件保证);`plugin uninstall` 不会删除包缓存(`<数据目录>/plugins/store/<插件名>/`)与插件私有数据(`<数据目录>/plugins/data/<插件名>/`),需要清理时请手动删除。
2530
+ **CLI 不保存任何安装状态**:`<数据目录>/plugins/store/<插件名>/<版本>/` 中的包缓存是唯一状态,`plugin list` 通过扫描这些目录判定"已下载"。install/update 每次都会重新执行 hook(幂等性由插件保证);`plugin uninstall` 不会删除包缓存(`<数据目录>/plugins/store/<插件名>/`)与插件私有数据(`<数据目录>/plugins/data/<插件名>/`),需要清理时请手动删除。
2602
2531
 
2603
- - `plugin list [-l|--long]`:按白名单顺序列出插件名称(每行一个,与 `skills list` 一致);`--long` 追加插件描述。
2532
+ - `plugin list [-l|--long]`:以表格列出白名单插件及本地已下载版本(列 `Name / Version / Status`,每个版本一行、升序,无版本显示 `not installed`);`--long` 追加 `NpmPackage` 与 `Desc` 列。
2604
2533
  - `plugin install <name> [--agent <a,b…>] [--project <path>] [-f|--force]`:下载最新包后,对"检测到的智能体 ∩ 插件支持的智能体"逐个执行 `install` hook;`--force` 先用本地最高旧版本执行 `uninstall` hook。目标全部失败时回滚删除本次新建的版本目录。显式 `--agent` + `--project` 时与 `init --project --agent` 一致——缺失的目标 skills 目录(含 `.<agent>` 根目录)会在 hook 前自动创建。
2605
2534
  - `plugin update <name> [--agent <a,b…>] [--project <path>]`:拉取最新版本并执行 `update` hook(携带 `from`/`to`,`from` 为下载前快照的最高版本;`from === to` 表示无本地版本或最新版已缓存,按修复/补装处理,不要求本地已有版本);显式 `--agent` + `--project` 时与 install 一致,缺失的目标 skills 目录(含 `.<agent>` 根目录)会在 hook 前自动创建。
2606
2535
  - `plugin uninstall <name> [--agent <a,b…>] [--project <path>]`:以本地最高可加载版本执行 `uninstall` hook。
@@ -2624,7 +2553,7 @@ devecocli plugin uninstall <name> --agent <agents> --project <path>
2624
2553
  | --agent | 可选,智能体名称,多个以英文逗号分隔;缺省时对检测到的全部智能体中受支持者执行 |
2625
2554
  | --project | 可选,工程根目录,切换到项目作用域;相对路径按当前目录解析 |
2626
2555
  | --force | 可选(仅 install),先执行旧版本的 uninstall hook 再安装 |
2627
- | --long | 可选(仅 list),追加显示插件描述,默认每行一个插件名 |
2556
+ | --long | 可选(仅 list),显示插件描述与 npm 包坐标 |
2628
2557
 
2629
2558
  **示例:**
2630
2559
 
@@ -1,39 +1,10 @@
1
1
  This file was generated with the generate-license-file npm package!
2
2
  https://www.npmjs.com/package/generate-license-file
3
3
 
4
- The following npm package may be included in this product:
5
-
6
- - ws@8.21.1
7
-
8
- This package contains the following license:
9
-
10
- Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
11
- Copyright (c) 2013 Arnout Kazemier and contributors
12
- Copyright (c) 2016 Luigi Pinca and contributors
13
-
14
- Permission is hereby granted, free of charge, to any person obtaining a copy of
15
- this software and associated documentation files (the "Software"), to deal in
16
- the Software without restriction, including without limitation the rights to
17
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
18
- the Software, and to permit persons to whom the Software is furnished to do so,
19
- subject to the following conditions:
20
-
21
- The above copyright notice and this permission notice shall be included in all
22
- copies or substantial portions of the Software.
23
-
24
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
26
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
27
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
28
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
-
31
- -----------
32
-
33
4
  The following npm packages may be included in this product:
34
5
 
35
- - @deveco-test/deveco-cli-knowledgebase@1.3.12-Test.2
36
- - @deveco-test/deveco-cli@1.3.12-Test.2
6
+ - @deveco-test/deveco-cli-knowledgebase@1.3.12-Test.3
7
+ - @deveco-test/deveco-cli@1.3.12-Test.3
37
8
 
38
9
  These packages each contain the following license:
39
10
 
@@ -73,7 +44,7 @@ SOFTWARE.
73
44
 
74
45
  The following npm package may be included in this product:
75
46
 
76
- - @deveco-test/deveco-cli-common@1.3.12-Test.2
47
+ - @deveco-test/deveco-cli-common@1.3.12-Test.3
77
48
 
78
49
  This package contains the following license:
79
50