@quicktvui/ai 1.1.18 → 1.1.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quicktvui/ai",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "QuickTVUI AI 开发规范与脚手架注入工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-component.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # 创建 QuickTVUI 组件
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-page.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # 创建 TV 页面
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-project.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # 创建 QuickTVUI 项目
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lookup-api.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # 查询 QuickTVUI 组件 API
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lookup-css.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # 查询 QuickTVUI CSS 属性
package/rules/.clinerules CHANGED
@@ -79,9 +79,10 @@ Hard requirements:
79
79
  `adb -s <serial> shell "pm query-activities --brief --components -a android.intent.action.VIEW -d 'esapp://' -c android.intent.category.BROWSABLE"`
80
80
  - For each resolved package, AI MUST output: component, package path (`pm path <pkg>`), and version (`dumpsys package <pkg> | grep -m 1 versionName`).
81
81
  - After `quicktvui-ai run-dev --project <project-path>` reaches runtime launcher page, AI MUST send a confirm action (`adb shell input keyevent 23` or `66`, or equivalent click) on the runtime start button so runtime pulls/loads the dev bundle.
82
- - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result from logs or foreground activity status.
82
+ - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result via `quicktvui_runtime_status` / `quicktvui-ai runtime-status` when available, otherwise via logs or foreground activity status.
83
83
  - If user asks to launch a specific ES app/version/source, run:
84
84
  `quicktvui-ai run-esapp --project <project-path> --pkg <es-package> [options]`
85
+ - After `run-esapp` or any other quick-app launch action, if the task is to confirm whether launch succeeded or whether the runtime reported an error, AI SHOULD query `quicktvui_runtime_status` / `quicktvui-ai runtime-status`.
85
86
 
86
87
  ## Runtime Debug Data Workflow (CRITICAL)
87
88
 
@@ -104,12 +105,13 @@ AI MUST NOT claim it inspected runtime data unless MCP or `quicktvui-ai debug-*`
104
105
 
105
106
  ## Plugin Server Workflow (CRITICAL)
106
107
 
107
- When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`):
108
+ When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`) or recent runtime load status from `/status`:
108
109
 
109
110
  1. Prefer connected `quicktvui-ai-mcp` plugin tools:
110
111
  - `plugin_server_check`
111
112
  - `plugin_server_hello`
112
113
  - `plugin_server_status`
114
+ - `quicktvui_runtime_status`
113
115
  - `plugin_upload_so`
114
116
  - `plugin_upload_plugin`
115
117
  2. Otherwise use `quicktvui-ai plugin-*`
@@ -126,7 +128,10 @@ Required order:
126
128
  3. Read current state:
127
129
  - `plugin_server_status`
128
130
  - or `quicktvui-ai plugin-status --device <serial>`
129
- 4. Upload So zip:
131
+ 4. If the task is to inspect recent runtime load state or latest error info after quick-app/plugin load:
132
+ - `quicktvui_runtime_status`
133
+ - or `quicktvui-ai runtime-status --device <serial>`
134
+ 5. Upload So zip:
130
135
  - choose the archive matching `ro.product.cpu.abi` on the service-corresponding device
131
136
  - `quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
132
137
  5. Upload plugin APK:
@@ -136,6 +141,7 @@ Hard requirements:
136
141
 
137
142
  - Runtime endpoint behavior overrides markdown docs.
138
143
  - Probe `/hello`, `/status`, `/uploadSo`, `/uploadPlugin` with `POST`, not `GET`.
144
+ - `/status` may include `data.loadStatus`, which is the authoritative recent runtime load-state/error map for quick-app/plugin startup. After `run-dev`, `run-esapp`, page-side install, or a startup failure, query `quicktvui_runtime_status` / `runtime-status` and report the package key plus `__debug__`.
139
145
  - Resolve plugin server address in this order:
140
146
  - explicit `baseUrl` / `--plugin-base-url`
141
147
  - adb-connected device service address
@@ -154,7 +160,9 @@ Hard requirements:
154
160
  - After uploading a newly rebuilt or replaced plugin package, restart the host/runtime process before validating page-side usage or startup; the running host does not hot-swap new plugin bytes automatically.
155
161
  - Consult:
156
162
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
163
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
157
164
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
165
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
158
166
 
159
167
 
160
168
  ## Plugin Scaffold Workflow (CRITICAL)
@@ -79,9 +79,10 @@ Hard requirements:
79
79
  `adb -s <serial> shell "pm query-activities --brief --components -a android.intent.action.VIEW -d 'esapp://' -c android.intent.category.BROWSABLE"`
80
80
  - For each resolved package, AI MUST output: component, package path (`pm path <pkg>`), and version (`dumpsys package <pkg> | grep -m 1 versionName`).
81
81
  - After `quicktvui-ai run-dev --project <project-path>` reaches runtime launcher page, AI MUST send a confirm action (`adb shell input keyevent 23` or `66`, or equivalent click) on the runtime start button so runtime pulls/loads the dev bundle.
82
- - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result from logs or foreground activity status.
82
+ - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result via `quicktvui_runtime_status` / `quicktvui-ai runtime-status` when available, otherwise via logs or foreground activity status.
83
83
  - If user asks to launch a specific ES app/version/source, run:
84
84
  `quicktvui-ai run-esapp --project <project-path> --pkg <es-package> [options]`
85
+ - After `run-esapp` or any other quick-app launch action, if the task is to confirm whether launch succeeded or whether the runtime reported an error, AI SHOULD query `quicktvui_runtime_status` / `quicktvui-ai runtime-status`.
85
86
 
86
87
  ## Runtime Debug Data Workflow (CRITICAL)
87
88
 
@@ -104,12 +105,13 @@ AI MUST NOT claim it inspected runtime data unless MCP or `quicktvui-ai debug-*`
104
105
 
105
106
  ## Plugin Server Workflow (CRITICAL)
106
107
 
107
- When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`):
108
+ When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`) or recent runtime load status from `/status`:
108
109
 
109
110
  1. Prefer connected `quicktvui-ai-mcp` plugin tools:
110
111
  - `plugin_server_check`
111
112
  - `plugin_server_hello`
112
113
  - `plugin_server_status`
114
+ - `quicktvui_runtime_status`
113
115
  - `plugin_upload_so`
114
116
  - `plugin_upload_plugin`
115
117
  2. Otherwise use `quicktvui-ai plugin-*`
@@ -126,7 +128,10 @@ Required order:
126
128
  3. Read current state:
127
129
  - `plugin_server_status`
128
130
  - or `quicktvui-ai plugin-status --device <serial>`
129
- 4. Upload So zip:
131
+ 4. If the task is to inspect recent runtime load state or latest error info after quick-app/plugin load:
132
+ - `quicktvui_runtime_status`
133
+ - or `quicktvui-ai runtime-status --device <serial>`
134
+ 5. Upload So zip:
130
135
  - choose the archive matching `ro.product.cpu.abi` on the service-corresponding device
131
136
  - `quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
132
137
  5. Upload plugin APK:
@@ -136,6 +141,7 @@ Hard requirements:
136
141
 
137
142
  - Runtime endpoint behavior overrides markdown docs.
138
143
  - Probe `/hello`, `/status`, `/uploadSo`, `/uploadPlugin` with `POST`, not `GET`.
144
+ - `/status` may include `data.loadStatus`, which is the authoritative recent runtime load-state/error map for quick-app/plugin startup. After `run-dev`, `run-esapp`, page-side install, or a startup failure, query `quicktvui_runtime_status` / `runtime-status` and report the package key plus `__debug__`.
139
145
  - Resolve plugin server address in this order:
140
146
  - explicit `baseUrl` / `--plugin-base-url`
141
147
  - adb-connected device service address
@@ -154,7 +160,9 @@ Hard requirements:
154
160
  - After uploading a newly rebuilt or replaced plugin package, restart the host/runtime process before validating page-side usage or startup; the running host does not hot-swap new plugin bytes automatically.
155
161
  - Consult:
156
162
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
163
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
157
164
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
165
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
158
166
 
159
167
 
160
168
  ## Plugin Scaffold Workflow (CRITICAL)
@@ -25,6 +25,7 @@ http://<tv-ip>:36366/api/v1
25
25
  6. `abi` 只在上传 So 时才需要。CLI / MCP 如果在 `uploadSo` 时未显式传 `abi`,会尝试读取当前插件服务对应设备的 `ro.product.cpu.abi` 并按需补齐;`check` / `hello` / `status` / `uploadPlugin` 不会主动查询 ABI。
26
26
  7. `uploadPlugin` 返回成功,只代表插件包已上传到插件服务缓存;如果 Vue 页面需要实际使用该插件,还必须在页面侧通过 `useESPlugin()` 监听并调用 `installPlugin({ pkg })`,不能把“上传成功”误当成“页面已安装完成”。
27
27
  8. 上传新的插件包到服务后,当前宿主 / runtime 进程不会自动热更新到新字节码;复测启动、注册或页面接入前,必须先重启宿主进程。
28
+ 9. 当快应用、插件或页面刚刚发起加载后,若需要继续查看最近一次加载状态与错误信息,应优先查询 `/status` 中的 `data.loadStatus`,推荐参考同目录 `runtime-status.md`。
28
29
 
29
30
  ## 二、开启服务
30
31
 
@@ -70,15 +71,30 @@ quicktvui-ai plugin-enable-api --device <serial>
70
71
  "soList": [
71
72
  "eskit.so.player.v1"
72
73
  ],
73
- "pluginList": []
74
+ "pluginList": [],
75
+ "loadStatus": {
76
+ "es.extscreen.runtime.error": {
77
+ "status": "SUCCESS",
78
+ "message": ""
79
+ },
80
+ "__debug__": {
81
+ "status": "ERROR",
82
+ "message": "网络不可用,请检查网络后重试"
83
+ }
84
+ }
74
85
  }
75
86
  }
76
87
  ```
77
88
 
78
89
  说明:
79
90
 
80
- 1. `soList` / `pluginList` 反映的是当前服务返回的数据,不应脑补额外状态。
91
+ 1. `soList` / `pluginList` / `loadStatus` 都以当前服务实际返回为准,不应脑补额外状态。
81
92
  2. 即使上传插件成功,`pluginList` 也可能仍为空。
93
+ 3. `loadStatus` 用于表达最近一次加载状态映射,key 一般是包名或 `__debug__`。
94
+ 4. 当快应用加载失败、页面没起来、或插件安装后仍不可用时,AI 应优先继续分析 `loadStatus` 中对应项的 `status` / `message`。
95
+ 5. QuickTVUI AI 推荐命令:
96
+ - CLI:`quicktvui-ai runtime-status --device <serial>`
97
+ - MCP:`quicktvui_runtime_status`
82
98
 
83
99
  ### 3.3 `POST /uploadSo`
84
100
 
@@ -0,0 +1,95 @@
1
+ ---
2
+ title: Runtime Status API
3
+ lang: zh-CN
4
+ ---
5
+
6
+ # 运行状态接口
7
+
8
+ ## 一、用途
9
+
10
+ 当快应用已经发起加载、插件已经上传或安装、页面启动失败,且 AI 需要继续查看最近一次加载状态与错误信息时,应读取插件服务的 `/status` 返回中的 `data.loadStatus`。
11
+
12
+ 典型场景:
13
+
14
+ 1. `run-dev` / `run-esapp` 后页面没有正常起来
15
+ 2. 插件安装成功回调后,模块 / 组件仍未可用
16
+ 3. 需要确认最近一次加载到底是 `SUCCESS` 还是 `ERROR`
17
+ 4. 需要拿到最近一次失败消息继续诊断
18
+
19
+ ## 二、接口信息
20
+
21
+ ```http
22
+ POST /api/v1/status
23
+ ```
24
+
25
+ 说明:
26
+
27
+ 1. 该接口是 `POST`,不要用 `GET`
28
+ 2. 根路径默认是 `http://<tv-ip>:36366/api/v1`
29
+ 3. 在调用前,应先通过 Toolkit 广播打开 `RESTFUL_API`
30
+
31
+ ## 三、关键字段
32
+
33
+ | 字段 | 类型 | 说明 |
34
+ | ---- | ---- | ---- |
35
+ | `soList` | array | 当前已加载的 So 键列表 |
36
+ | `pluginList` | array | 当前已加载的插件包名列表 |
37
+ | `loadStatus` | object | 最近一次加载状态映射,key 一般是包名或 `__debug__` |
38
+
39
+ `loadStatus` 子字段:
40
+
41
+ | 字段 | 类型 | 说明 |
42
+ | ---- | ---- | ---- |
43
+ | `status` | string | `SUCCESS` 或 `ERROR` |
44
+ | `message` | string | 最近一次错误信息;成功时通常为空字符串 |
45
+
46
+ ## 四、建议读取方式
47
+
48
+ 优先使用 QuickTVUI AI 工具,而不是直接手写 curl。
49
+
50
+ ### 4.1 CLI
51
+
52
+ ```bash
53
+ quicktvui-ai runtime-status --device <serial>
54
+ ```
55
+
56
+ ### 4.2 MCP
57
+
58
+ - `quicktvui_runtime_status`
59
+
60
+ ## 五、判断规则
61
+
62
+ 1. `plugin-status` / `plugin_server_status` 更适合读原始 `/status`
63
+ 2. `runtime-status` / `quicktvui_runtime_status` 更适合聚焦 `loadStatus`
64
+ 3. 分析时应同时看:
65
+ - 业务包名对应项
66
+ - `__debug__`
67
+ 4. 如果 `message` 非空,应优先把它当成最近一次加载失败的直接线索
68
+ 5. `status.pluginList` 为空,不代表 `loadStatus` 也没有信息
69
+
70
+ ## 六、示例
71
+
72
+ ```json
73
+ {
74
+ "code": 0,
75
+ "message": "success",
76
+ "data": {
77
+ "soList": [
78
+ "demo_arm64-v8a"
79
+ ],
80
+ "pluginList": [
81
+ "eskit.plugin.test"
82
+ ],
83
+ "loadStatus": {
84
+ "es.extscreen.runtime.error": {
85
+ "status": "SUCCESS",
86
+ "message": ""
87
+ },
88
+ "__debug__": {
89
+ "status": "ERROR",
90
+ "message": "网络不可用,请检查网络后重试"
91
+ }
92
+ }
93
+ }
94
+ }
95
+ ```
@@ -45,7 +45,24 @@ quicktvui-ai plugin-check --device <serial>
45
45
  quicktvui-ai plugin-status --device <serial>
46
46
  ```
47
47
 
48
- ### 2.4 上传 So
48
+ 说明:
49
+
50
+ 1. 该命令适合读取原始 `/status`
51
+ 2. 重点关注 `soList`、`pluginList` 与原始 `data` 结构
52
+
53
+ ### 2.4 查看最近加载状态与错误信息
54
+
55
+ ```bash
56
+ quicktvui-ai runtime-status --device <serial>
57
+ ```
58
+
59
+ 说明:
60
+
61
+ 1. 该命令同样读取 `/status`,但会把 `data.loadStatus` 作为重点输出字段
62
+ 2. 当快应用刚加载、插件刚安装、页面没起来、或需要继续看最近一次错误信息时,应优先使用这个命令
63
+ 3. 重点关注具体包名对应项,以及 `__debug__` 下的 `status` / `message`
64
+
65
+ ### 2.5 上传 So
49
66
 
50
67
  ```bash
51
68
  quicktvui-ai plugin-upload-so \
@@ -61,7 +78,7 @@ quicktvui-ai plugin-upload-so \
61
78
  2. 建议总是同时传 `--tag` 和 `--pkg`
62
79
  3. So zip 必须和设备 ABI 一致
63
80
 
64
- ### 2.5 上传插件 APK
81
+ ### 2.6 上传插件 APK
65
82
 
66
83
  ```bash
67
84
  quicktvui-ai plugin-upload-plugin \
@@ -76,7 +93,7 @@ quicktvui-ai plugin-upload-plugin \
76
93
  2. 如果上传的是新构建或覆盖上传的插件包,复测前必须先重启宿主 / runtime 进程
77
94
  3. 宿主重启后,再继续做 Vue 页面安装、注册校验或启动验证
78
95
 
79
- ### 2.6 Vue 侧安装插件
96
+ ### 2.7 Vue 侧安装插件
80
97
 
81
98
  `plugin-upload-plugin` 成功,只代表插件包已经进入插件服务缓存;如果页面里需要真正使用插件,还必须在 Vue 侧补齐安装流程。
82
99
 
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: Runtime Status
3
+ lang: zh-CN
4
+ ---
5
+
6
+ # 运行状态 CLI
7
+
8
+ ## 一、用途
9
+
10
+ 当快应用加载后页面未正常起来、插件安装后组件/模块仍未注册、或用户明确要求查看最近一次加载状态与错误信息时,优先使用:
11
+
12
+ ```bash
13
+ quicktvui-ai runtime-status --device <serial>
14
+ ```
15
+
16
+ 这个命令底层仍调用 `/api/v1/status`,但会把 `data.loadStatus` 作为重点输出字段,方便 AI 继续判断最近一次加载是成功还是失败。
17
+
18
+ ## 二、推荐时机
19
+
20
+ 1. `quicktvui-ai run-dev` / `run-esapp` 之后
21
+ 2. `plugin-upload-plugin` 或页面侧 `installPlugin({ pkg })` 之后
22
+ 3. 页面空白、组件未注册、模块调用失败之后
23
+ 4. 设备日志以外,还需要再看服务侧最近一次加载状态时
24
+
25
+ ## 三、命令示例
26
+
27
+ ```bash
28
+ quicktvui-ai runtime-status --device <serial>
29
+ ```
30
+
31
+ 也可以显式指定服务地址:
32
+
33
+ ```bash
34
+ quicktvui-ai runtime-status --plugin-base-url http://<tv-ip>:36366
35
+ ```
36
+
37
+ ## 四、重点字段
38
+
39
+ 1. `loadStatus.<pkg>.status`
40
+ 2. `loadStatus.<pkg>.message`
41
+ 3. `loadStatus.__debug__.status`
42
+ 4. `loadStatus.__debug__.message`
43
+
44
+ ## 五、判断规则
45
+
46
+ 1. 这个命令适合查最近一次加载状态与错误信息
47
+ 2. `plugin-status` 更适合读取原始 `/status` 缓存状态
48
+ 3. 如果 `pluginList` 为空,也不能跳过 `loadStatus`
49
+ 4. 如果刚重传了新插件版本,复测前应先重启宿主 / runtime 进程,再重新查询运行状态
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: copilot-instructions.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # copilot-instructions.md - QuickTVUI AI Development Guide
@@ -70,12 +70,13 @@ AI MUST NOT say it has checked logs/screenshots unless one of those MCP/CLI read
70
70
 
71
71
  ## Plugin Server Workflow (CRITICAL)
72
72
 
73
- When the task is to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`), AI MUST use this priority:
73
+ When the task is to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`) or recent runtime load status from `/status`, AI MUST use this priority:
74
74
 
75
75
  1. Prefer connected `quicktvui-ai-mcp` plugin tools:
76
76
  - `plugin_server_check`
77
77
  - `plugin_server_hello`
78
78
  - `plugin_server_status`
79
+ - `quicktvui_runtime_status`
79
80
  - `plugin_upload_so`
80
81
  - `plugin_upload_plugin`
81
82
  2. Otherwise use `quicktvui-ai plugin-*`
@@ -92,6 +93,9 @@ Required order:
92
93
  - Read current state:
93
94
  - `plugin_server_status`
94
95
  - or `quicktvui-ai plugin-status --device <serial>`
96
+ - If the task is to inspect recent runtime load state or latest error info after quick-app/plugin load:
97
+ - `quicktvui_runtime_status`
98
+ - or `quicktvui-ai runtime-status --device <serial>`
95
99
  - Resolve plugin server address:
96
100
  - explicit `baseUrl` / `--plugin-base-url`
97
101
  - adb-connected device service address
@@ -108,6 +112,7 @@ Hard requirements:
108
112
 
109
113
  - Runtime endpoint behavior overrides markdown docs.
110
114
  - Probe `/hello`, `/status`, `/uploadSo`, `/uploadPlugin` with `POST`, not `GET`.
115
+ - `/status` may include `data.loadStatus`, which is the authoritative recent runtime load-state/error map for quick-app/plugin startup. After `run-dev`, `run-esapp`, page-side install, or a startup failure, query `quicktvui_runtime_status` / `runtime-status` and report the package key plus `__debug__`.
111
116
  - If AI is working inside the `quicktvui-ai` repo and finds doc/runtime drift, AI MUST update the docs.
112
117
  - `uploadSo` currently has `pkg` / `tag` drift. AI SHOULD send both fields and trust successful `data.tag`.
113
118
  - Default demo identifiers:
@@ -120,7 +125,9 @@ Hard requirements:
120
125
  - After uploading a newly rebuilt or replaced plugin package, restart the host/runtime process before validating page-side usage or startup; the running host does not hot-swap new plugin bytes automatically.
121
126
  - Consult:
122
127
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
128
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
123
129
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
130
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
124
131
 
125
132
 
126
133
  ## Plugin Scaffold Workflow (CRITICAL)
@@ -79,9 +79,10 @@ Hard requirements:
79
79
  `adb -s <serial> shell "pm query-activities --brief --components -a android.intent.action.VIEW -d 'esapp://' -c android.intent.category.BROWSABLE"`
80
80
  - For each resolved package, AI MUST output: component, package path (`pm path <pkg>`), and version (`dumpsys package <pkg> | grep -m 1 versionName`).
81
81
  - After `quicktvui-ai run-dev --project <project-path>` reaches runtime launcher page, AI MUST send a confirm action (`adb shell input keyevent 23` or `66`, or equivalent click) on the runtime start button so runtime pulls/loads the dev bundle.
82
- - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result from logs or foreground activity status.
82
+ - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result via `quicktvui_runtime_status` / `quicktvui-ai runtime-status` when available, otherwise via logs or foreground activity status.
83
83
  - If user asks to launch a specific ES app/version/source, run:
84
84
  `quicktvui-ai run-esapp --project <project-path> --pkg <es-package> [options]`
85
+ - After `run-esapp` or any other quick-app launch action, if the task is to confirm whether launch succeeded or whether the runtime reported an error, AI SHOULD query `quicktvui_runtime_status` / `quicktvui-ai runtime-status`.
85
86
 
86
87
  ## Runtime Debug Data Workflow (CRITICAL)
87
88
 
@@ -104,12 +105,13 @@ AI MUST NOT claim it inspected runtime data unless MCP or `quicktvui-ai debug-*`
104
105
 
105
106
  ## Plugin Server Workflow (CRITICAL)
106
107
 
107
- When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`):
108
+ When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`) or recent runtime load status from `/status`:
108
109
 
109
110
  1. Prefer connected `quicktvui-ai-mcp` plugin tools:
110
111
  - `plugin_server_check`
111
112
  - `plugin_server_hello`
112
113
  - `plugin_server_status`
114
+ - `quicktvui_runtime_status`
113
115
  - `plugin_upload_so`
114
116
  - `plugin_upload_plugin`
115
117
  2. Otherwise use `quicktvui-ai plugin-*`
@@ -126,7 +128,10 @@ Required order:
126
128
  3. Read current state:
127
129
  - `plugin_server_status`
128
130
  - or `quicktvui-ai plugin-status --device <serial>`
129
- 4. Upload So zip:
131
+ 4. If the task is to inspect recent runtime load state or latest error info after quick-app/plugin load:
132
+ - `quicktvui_runtime_status`
133
+ - or `quicktvui-ai runtime-status --device <serial>`
134
+ 5. Upload So zip:
130
135
  - choose the archive matching `ro.product.cpu.abi` on the service-corresponding device
131
136
  - `quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
132
137
  5. Upload plugin APK:
@@ -136,6 +141,7 @@ Hard requirements:
136
141
 
137
142
  - Runtime endpoint behavior overrides markdown docs.
138
143
  - Probe `/hello`, `/status`, `/uploadSo`, `/uploadPlugin` with `POST`, not `GET`.
144
+ - `/status` may include `data.loadStatus`, which is the authoritative recent runtime load-state/error map for quick-app/plugin startup. After `run-dev`, `run-esapp`, page-side install, or a startup failure, query `quicktvui_runtime_status` / `runtime-status` and report the package key plus `__debug__`.
139
145
  - Resolve plugin server address in this order:
140
146
  - explicit `baseUrl` / `--plugin-base-url`
141
147
  - adb-connected device service address
@@ -154,7 +160,9 @@ Hard requirements:
154
160
  - After uploading a newly rebuilt or replaced plugin package, restart the host/runtime process before validating page-side usage or startup; the running host does not hot-swap new plugin bytes automatically.
155
161
  - Consult:
156
162
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
163
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
157
164
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
165
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
158
166
 
159
167
 
160
168
  ## Plugin Scaffold Workflow (CRITICAL)
package/rules/AGENTS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: AGENTS.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # AGENTS.md - QuickTVUI AI Development Guide
@@ -111,9 +111,10 @@ Hard requirements:
111
111
  `adb -s <serial> shell "pm query-activities --brief --components -a android.intent.action.VIEW -d 'esapp://' -c android.intent.category.BROWSABLE"`
112
112
  - For each resolved package, AI MUST output: component, package path (`pm path <pkg>`), and version (`dumpsys package <pkg> | grep -m 1 versionName`).
113
113
  - After `quicktvui-ai run-dev --project <project-path>` reaches runtime launcher page, AI MUST send a confirm action (`adb shell input keyevent 23` or `66`, or equivalent click) on the runtime start button so runtime pulls/loads the dev bundle.
114
- - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result from logs or foreground activity status.
114
+ - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result from `quicktvui_runtime_status` / `quicktvui-ai runtime-status` when available, otherwise from logs or foreground activity status.
115
115
  - If user asks to launch a specific ES app/version/source, run:
116
116
  `quicktvui-ai run-esapp --project <project-path> --pkg <es-package> [options]`
117
+ - After `run-esapp` or any other quick-app launch action, if the task is to confirm whether launch succeeded or whether the runtime reported an error, AI SHOULD query `quicktvui_runtime_status` / `quicktvui-ai runtime-status` before concluding success or failure.
117
118
 
118
119
  ## Runtime Debug Data Workflow (CRITICAL)
119
120
 
@@ -133,6 +134,7 @@ Required non-MCP command order:
133
134
  4. `quicktvui-ai debug-events --client-id <clientId> --limit 100`
134
135
  5. `quicktvui-ai debug-native-logs --client-id <clientId> --limit 100`
135
136
  6. `quicktvui-ai debug-screenshot --client-id <clientId> --project <project-path>`
137
+ 7. If the task is to confirm recent quick-app launch/load success or error state, `quicktvui-ai runtime-status --device <serial>` or MCP `quicktvui_runtime_status`
136
138
 
137
139
  Hard requirements:
138
140
 
@@ -140,15 +142,17 @@ Hard requirements:
140
142
  - If `debug-targets` returns an empty list, AI MUST clearly state that no active `ESDebugServer /ai/targets` are available yet.
141
143
  - If `debug-native-logs` or `debug-screenshot` fails, AI MUST report the concrete command/error instead of fabricating fallback observations.
142
144
  - When user asks for a screenshot and CLI mode is used, AI SHOULD prefer the file path returned by `quicktvui-ai debug-screenshot` rather than asking the user to locate the image manually.
145
+ - When the user is asking about recent quick-app load state, startup failure, or the latest runtime-side error message after load, AI SHOULD also query `quicktvui_runtime_status` / `quicktvui-ai runtime-status` and report the relevant package key plus `__debug__` from `data.loadStatus`.
143
146
 
144
147
  ## Plugin Server Workflow (CRITICAL)
145
148
 
146
- When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`), AI MUST use this priority:
149
+ When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`) or recent runtime load status from `/status`, AI MUST use this priority:
147
150
 
148
151
  1. Prefer connected `quicktvui-ai-mcp` plugin tools:
149
152
  - `plugin_server_check`
150
153
  - `plugin_server_hello`
151
154
  - `plugin_server_status`
155
+ - `quicktvui_runtime_status`
152
156
  - `plugin_upload_so`
153
157
  - `plugin_upload_plugin`
154
158
  2. If MCP is unavailable but shell/CLI execution is available, AI MUST use `quicktvui-ai plugin-*`.
@@ -165,22 +169,26 @@ Required workflow:
165
169
  3. Read current state:
166
170
  - MCP: `plugin_server_status`
167
171
  - CLI: `quicktvui-ai plugin-status --device <serial>`
168
- 4. Resolve plugin server address:
172
+ 4. If the user needs recent runtime load state or latest error info after quick-app/plugin load:
173
+ - MCP: `quicktvui_runtime_status`
174
+ - CLI: `quicktvui-ai runtime-status --device <serial>`
175
+ 5. Resolve plugin server address:
169
176
  - If `baseUrl` / `--plugin-base-url` is explicitly provided, use it
170
177
  - Otherwise, if adb already has a connected target, use that target's plugin service address first
171
178
  - If the target host cannot be inferred, use adb port forward and `http://127.0.0.1:36366`
172
179
  - If multiple adb devices are connected, AI MUST ask the user to choose `serial` or provide service IP / `baseUrl`
173
180
  - If no adb-connected device exists, AI MUST ask the user for service IP / `baseUrl`, and MUST NOT invent or hardcode a developer-specific TV IP
174
- 5. Upload So zip:
181
+ 6. Upload So zip:
175
182
  - choose the zip whose ABI matches `ro.product.cpu.abi` on the device that serves the current plugin endpoint
176
183
  - CLI: `quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
177
- 6. Upload plugin APK:
184
+ 7. Upload plugin APK:
178
185
  - CLI: `quicktvui-ai plugin-upload-plugin --device <serial> --pkg eskit.plugin.imagequality --file <apk-path>`
179
186
 
180
187
  Hard requirements:
181
188
 
182
189
  - AI MUST treat live endpoint behavior as the source of truth over markdown docs.
183
190
  - AI MUST probe `/hello`, `/status`, `/uploadSo`, `/uploadPlugin` with `POST`, not `GET`.
191
+ - `/status` may include `data.loadStatus`, which is the authoritative recent runtime load-state/error map for quick-app/plugin startup. After `run-dev`, `run-esapp`, page-side plugin install, or a startup failure, AI SHOULD query `quicktvui_runtime_status` / `runtime-status` and report the relevant package key plus `__debug__`.
184
192
  - If AI is working inside the `quicktvui-ai` repository and docs disagree with the live interface, AI MUST update the docs to match the runtime behavior.
185
193
  - `uploadSo` currently has observed `pkg` / `tag` drift. AI SHOULD send both `pkg` and `tag`, and treat successful response field `data.tag` as authoritative.
186
194
  - The default demo identifiers are:
@@ -193,7 +201,9 @@ Hard requirements:
193
201
  - Uploading a newly rebuilt or replaced plugin package to the plugin service does NOT hot-swap the already running host/runtime process. Before validating startup, registration, or page-side usage after a new plugin upload, AI MUST restart the host/runtime process so the new plugin bytes can take effect.
194
202
  - AI SHOULD consult these packaged docs before generating commands or guidance:
195
203
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
204
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
196
205
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
206
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
197
207
 
198
208
  ## Plugin Scaffold Workflow (CRITICAL)
199
209
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: AI_HANDOFF.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # QuickTVUI AI 集成 - 工作交接文档
@@ -84,6 +84,7 @@ AI 在编写业务逻辑时,极易带入传统 Web 开发习惯导致严重报
84
84
  - `debug-targets` 返回空数组时,应先回到 run/dev 链路,确认 `ESDebugServer /ai/targets` 已建立
85
85
  - `debug-screenshot` 默认会把图片写到 `<project>/.quicktvui-ai/debug-screenshots/`,后续 AI 应优先使用命令返回的 `savedTo` 路径
86
86
  - `debug-native-logs` 与 `debug-screenshot` 的失败信息应直接向用户透明披露,不要二次包装成模糊描述
87
+ - 如果接手时正在排查 `run-dev`、`run-esapp`、`run_to_tv` 或其他快应用拉起后“到底有没有真正成功”这类问题,应优先补一份 `quicktvui_runtime_status` / `quicktvui-ai runtime-status` 快照,再下结论
87
88
 
88
89
  ## 插件服务工作流 (CRITICAL)
89
90
 
@@ -104,22 +105,26 @@ AI 在编写业务逻辑时,极易带入传统 Web 开发习惯导致严重报
104
105
  3. 读取状态
105
106
  - MCP:`plugin_server_status`
106
107
  - CLI:`quicktvui-ai plugin-status --device <serial>`
107
- 4. 解析插件服务地址
108
+ 4. 如果任务需要最近一次 runtime 加载状态与错误信息
109
+ - MCP:`quicktvui_runtime_status`
110
+ - CLI:`quicktvui-ai runtime-status --device <serial>`
111
+ 5. 解析插件服务地址
108
112
  - 如果显式传了 `baseUrl` / `--plugin-base-url`,优先使用该地址
109
113
  - 否则,如果 adb 已连接设备,先尝试使用该设备的插件服务地址
110
114
  - 如果无法从目标设备推断 host,则改用 adb 端口转发和 `http://127.0.0.1:36366`
111
115
  - 如果同时连接了多台 adb 设备,后续 AI 必须要求用户选择 `serial` 或提供服务 IP / `baseUrl`
112
116
  - 如果没有任何 adb 已连接设备,后续 AI 必须向用户索要服务 IP / `baseUrl`,不得脑补或写死某个开发者自己的电视 IP
113
- 5. 上传 So
117
+ 6. 上传 So
114
118
  - 必须先根据当前插件服务对应设备的 `ro.product.cpu.abi` 选择 zip
115
119
  - CLI:`quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
116
- 6. 上传插件 APK
120
+ 7. 上传插件 APK
117
121
  - CLI:`quicktvui-ai plugin-upload-plugin --device <serial> --pkg eskit.plugin.imagequality --file <apk-path>`
118
122
 
119
123
  接手注意事项:
120
124
 
121
125
  - 文档与接口返回不一致时,统一以接口真实返回为准
122
126
  - `/hello`、`/status`、`/uploadSo`、`/uploadPlugin` 必须使用 `POST` 探测,不能用 `GET` 判断服务是否可用
127
+ - `/status` 中的 `data.loadStatus` 是最近一次 runtime 加载状态与错误信息的权威来源;接手后若要继续排查加载失败,应优先调用 `quicktvui_runtime_status` / `quicktvui-ai runtime-status`,并同时报告相关包名项与 `__debug__`
123
128
  - 如果此时正在 `quicktvui-ai` 仓库中改规则或文档,必须同步把差异写回文档
124
129
  - `uploadSo` 目前存在 `pkg` / `tag` 漂移,调用时应尽量同时传这两个字段
125
130
  - 测试 Demo 固定标识:
@@ -129,7 +134,9 @@ AI 在编写业务逻辑时,极易带入传统 Web 开发习惯导致严重报
129
134
  - 重新上传新的插件包后,接手方在复测前必须先重启宿主 / runtime 进程;当前进程不会自动热更新到新插件字节码
130
135
  - 优先参考包内文档:
131
136
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
137
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
132
138
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
139
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
133
140
 
134
141
  ## 插件脚手架工作流 (CRITICAL)
135
142
 
package/rules/CLAUDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: CLAUDE.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # QuickTVUI - AI 开发指南
@@ -111,9 +111,10 @@ Hard requirements:
111
111
  `adb -s <serial> shell "pm query-activities --brief --components -a android.intent.action.VIEW -d 'esapp://' -c android.intent.category.BROWSABLE"`
112
112
  - For each resolved package, AI MUST output: component, package path (`pm path <pkg>`), and version (`dumpsys package <pkg> | grep -m 1 versionName`).
113
113
  - After `quicktvui-ai run-dev --project <project-path>` reaches runtime launcher page, AI MUST send a confirm action (`adb shell input keyevent 23` or `66`, or equivalent click) on the runtime start button so runtime pulls/loads the dev bundle.
114
- - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result from logs or foreground activity status.
114
+ - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result by first querying `quicktvui_runtime_status` / `quicktvui-ai runtime-status`; if that path is unavailable, fall back to logs or foreground activity status.
115
115
  - If user asks to launch a specific ES app/version/source, run:
116
116
  `quicktvui-ai run-esapp --project <project-path> --pkg <es-package> [options]`
117
+ - `run-esapp` 或其他快应用拉起动作后,如果任务目标是确认是否拉起成功、是否有 runtime 报错,AI 也应优先补查 `quicktvui_runtime_status` / `quicktvui-ai runtime-status`。
117
118
 
118
119
  ## Runtime Debug Data Workflow (CRITICAL)
119
120
 
@@ -133,21 +134,24 @@ Hard requirements:
133
134
  4. `quicktvui-ai debug-events --client-id <clientId> --limit 100`
134
135
  5. `quicktvui-ai debug-native-logs --client-id <clientId> --limit 100`
135
136
  6. `quicktvui-ai debug-screenshot --client-id <clientId> --project <project-path>`
137
+ 7. 如果任务是确认最近一次快应用拉起 / 加载是否成功,或是否有 runtime 错误,还应补查 `quicktvui_runtime_status` / `quicktvui-ai runtime-status`
136
138
 
137
139
  硬约束:
138
140
 
139
141
  - AI 未通过 MCP 或 `quicktvui-ai debug-*` 实际读取到数据前,不得声称自己已经检查过运行时日志、native logs 或截图
140
142
  - `debug-targets` 为空时,必须明确说明当前 `ESDebugServer /ai/targets` 还没有可读 target
141
143
  - `debug-native-logs` 或 `debug-screenshot` 失败时,必须原样报告命令和错误,不得编造兜底结论
144
+ - 如果用户要查最近一次快应用加载状态、启动失败,或最近一次 runtime 侧错误信息,AI 还应优先补查 `quicktvui_runtime_status` / `quicktvui-ai runtime-status`,并同时报告相关包名项与 `__debug__`
142
145
 
143
146
  ## Plugin Server Workflow (CRITICAL)
144
147
 
145
- 当用户要求 AI 检查、上传或联调电视插件服务接口(`/hello`、`/status`、`/uploadSo`、`/uploadPlugin`)时,AI 必须遵循以下优先级:
148
+ 当用户要求 AI 检查、上传或联调电视插件服务接口(`/hello`、`/status`、`/uploadSo`、`/uploadPlugin`),或要求查看最近一次 runtime 加载状态与错误信息时,AI 必须遵循以下优先级:
146
149
 
147
150
  1. 优先使用已连接的 `quicktvui-ai-mcp` 插件工具:
148
151
  - `plugin_server_check`
149
152
  - `plugin_server_hello`
150
153
  - `plugin_server_status`
154
+ - `quicktvui_runtime_status`
151
155
  - `plugin_upload_so`
152
156
  - `plugin_upload_plugin`
153
157
  2. 如果没有 MCP,但具备 shell/CLI 能力,则必须使用 `quicktvui-ai plugin-*`
@@ -164,22 +168,26 @@ Hard requirements:
164
168
  3. 读取当前状态
165
169
  - MCP:`plugin_server_status`
166
170
  - CLI:`quicktvui-ai plugin-status --device <serial>`
167
- 4. 解析插件服务地址
171
+ 4. 如果任务需要最近一次 runtime 加载状态或错误信息
172
+ - MCP:`quicktvui_runtime_status`
173
+ - CLI:`quicktvui-ai runtime-status --device <serial>`
174
+ 5. 解析插件服务地址
168
175
  - 如果显式传了 `baseUrl` / `--plugin-base-url`,优先使用该地址
169
176
  - 否则,如果 adb 已连接设备,先尝试使用该设备的插件服务地址
170
177
  - 如果无法从目标设备推断 host,则改用 adb 端口转发和 `http://127.0.0.1:36366`
171
178
  - 如果同时连接了多台 adb 设备,AI 必须要求用户选择 `serial` 或提供服务 IP / `baseUrl`
172
179
  - 如果没有任何 adb 已连接设备,AI 必须向用户索要服务 IP / `baseUrl`,不得脑补或写死某个开发者自己的电视 IP
173
- 5. 上传 So
180
+ 6. 上传 So
174
181
  - 必须根据当前插件服务对应设备的 `ro.product.cpu.abi` 选择匹配的 zip
175
182
  - CLI:`quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
176
- 6. 上传插件 APK
183
+ 7. 上传插件 APK
177
184
  - CLI:`quicktvui-ai plugin-upload-plugin --device <serial> --pkg eskit.plugin.imagequality --file <apk-path>`
178
185
 
179
186
  硬约束:
180
187
 
181
188
  - 运行中接口返回永远优先于 markdown 文档。
182
189
  - `/hello`、`/status`、`/uploadSo`、`/uploadPlugin` 必须使用 `POST` 探测,不能用 `GET` 判断服务是否可用。
190
+ - `/status` 中的 `data.loadStatus` 是最近一次 runtime 加载状态与错误信息的权威来源。执行 `run-dev`、`run-esapp`、页面侧安装插件、或启动失败后,AI 应优先查询 `quicktvui_runtime_status` / `runtime-status`,并同时报告相关包名项与 `__debug__`。
183
191
  - 如果 AI 正在 `quicktvui-ai` 仓库内工作,且文档与实机接口不一致,必须回写文档。
184
192
  - `uploadSo` 目前存在 `pkg` / `tag` 字段漂移,AI 应同时传 `pkg` 和 `tag`,成功后以返回的 `data.tag` 为准。
185
193
  - 默认测试标识固定为:
@@ -192,7 +200,9 @@ Hard requirements:
192
200
  - 重新上传新的插件包后,当前宿主 / runtime 进程不会自动热更新到新字节码;在重新验证启动、注册或页面接入之前,AI 必须先重启宿主 / runtime 进程。
193
201
  - 生成命令或说明前,应优先查阅以下包内文档:
194
202
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
203
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
195
204
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
205
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
196
206
 
197
207
  ## Plugin Scaffold Workflow (CRITICAL)
198
208
 
package/rules/GEMINI.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: GEMINI.md
3
- version: 1.1.18
3
+ version: 1.1.20
4
4
  ---
5
5
 
6
6
  # GEMINI.md - QuickTVUI AI 开发指南
@@ -102,9 +102,10 @@ Hard requirements:
102
102
  `adb -s <serial> shell "pm query-activities --brief --components -a android.intent.action.VIEW -d 'esapp://' -c android.intent.category.BROWSABLE"`
103
103
  - For each resolved package, AI MUST output: component, package path (`pm path <pkg>`), and version (`dumpsys package <pkg> | grep -m 1 versionName`).
104
104
  - After `quicktvui-ai run-dev --project <project-path>` reaches runtime launcher page, AI MUST send a confirm action (`adb shell input keyevent 23` or `66`, or equivalent click) on the runtime start button so runtime pulls/loads the dev bundle.
105
- - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result from logs or foreground activity status.
105
+ - AI MUST NOT stop at launcher page before triggering that confirm action, and MUST verify launch/bundle load result via `quicktvui_runtime_status` / `quicktvui-ai runtime-status` when available, otherwise via logs or foreground activity status.
106
106
  - If user asks to launch a specific ES app/version/source, run:
107
107
  `quicktvui-ai run-esapp --project <project-path> --pkg <es-package> [options]`
108
+ - After `run-esapp` or any other quick-app launch action, if the task is to confirm whether launch succeeded or whether the runtime reported an error, AI SHOULD query `quicktvui_runtime_status` / `quicktvui-ai runtime-status` before concluding success or failure.
108
109
 
109
110
  ## Runtime Debug Data Workflow (CRITICAL)
110
111
 
@@ -124,21 +125,24 @@ Required non-MCP order:
124
125
  4. `quicktvui-ai debug-events --client-id <clientId> --limit 100`
125
126
  5. `quicktvui-ai debug-native-logs --client-id <clientId> --limit 100`
126
127
  6. `quicktvui-ai debug-screenshot --client-id <clientId> --project <project-path>`
128
+ 7. If the task is to confirm recent quick-app launch/load success or runtime error state, also query `quicktvui_runtime_status` / `quicktvui-ai runtime-status`
127
129
 
128
130
  Hard requirements:
129
131
 
130
132
  - AI MUST NOT claim it inspected runtime data unless MCP or `quicktvui-ai debug-*` actually returned that data
131
133
  - If `debug-targets` is empty, AI MUST say that `ESDebugServer /ai/targets` is still empty
132
134
  - If `debug-native-logs` or `debug-screenshot` fails, AI MUST report the real command/error instead of inventing fallback observations
135
+ - When the task is to inspect recent quick-app load state, startup failure, or the latest runtime-side error message after load, AI SHOULD also query `quicktvui_runtime_status` / `quicktvui-ai runtime-status` and report the relevant package key plus `__debug__` from `data.loadStatus`
133
136
 
134
137
  ## Plugin Server Workflow (CRITICAL)
135
138
 
136
- When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`):
139
+ When the user asks AI to inspect, upload, or debug TV plugin server endpoints (`/hello`, `/status`, `/uploadSo`, `/uploadPlugin`) or recent runtime load status from `/status`:
137
140
 
138
141
  1. Prefer connected `quicktvui-ai-mcp` plugin tools:
139
142
  - `plugin_server_check`
140
143
  - `plugin_server_hello`
141
144
  - `plugin_server_status`
145
+ - `quicktvui_runtime_status`
142
146
  - `plugin_upload_so`
143
147
  - `plugin_upload_plugin`
144
148
  2. Otherwise use `quicktvui-ai plugin-*`
@@ -155,22 +159,26 @@ Required order:
155
159
  3. Read current state
156
160
  - MCP: `plugin_server_status`
157
161
  - CLI: `quicktvui-ai plugin-status --device <serial>`
158
- 4. Resolve plugin server address
162
+ 4. If the user needs recent runtime load state or latest error info after quick-app/plugin load
163
+ - MCP: `quicktvui_runtime_status`
164
+ - CLI: `quicktvui-ai runtime-status --device <serial>`
165
+ 5. Resolve plugin server address
159
166
  - If `baseUrl` / `--plugin-base-url` is explicitly provided, use it
160
167
  - Otherwise, if adb already has a connected target, use that target's plugin service address first
161
168
  - If the target host cannot be inferred, use adb port forward and `http://127.0.0.1:36366`
162
169
  - If multiple adb devices are connected, AI MUST ask the user to choose `serial` or provide service IP / `baseUrl`
163
170
  - If no adb-connected device exists, AI MUST ask the user for service IP / `baseUrl`, and MUST NOT invent a developer-specific TV IP
164
- 5. Upload So zip
171
+ 6. Upload So zip
165
172
  - choose the archive that matches `ro.product.cpu.abi` on the device behind the current plugin service
166
173
  - CLI: `quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
167
- 6. Upload plugin APK
174
+ 7. Upload plugin APK
168
175
  - CLI: `quicktvui-ai plugin-upload-plugin --device <serial> --pkg eskit.plugin.imagequality --file <apk-path>`
169
176
 
170
177
  Hard requirements:
171
178
 
172
179
  - Runtime endpoint behavior overrides markdown docs.
173
180
  - Probe `/hello`, `/status`, `/uploadSo`, `/uploadPlugin` with `POST`, not `GET`.
181
+ - `/status` may include `data.loadStatus`, which is the authoritative recent runtime load-state/error map for quick-app/plugin startup. After `run-dev`, `run-esapp`, page-side plugin install, or a startup failure, AI SHOULD query `quicktvui_runtime_status` / `runtime-status` and report the relevant package key plus `__debug__`.
174
182
  - When AI is editing the `quicktvui-ai` repo itself and finds doc/runtime drift, AI MUST update docs.
175
183
  - `uploadSo` currently shows `pkg` / `tag` drift. AI SHOULD send both `pkg` and `tag`, and trust `data.tag` in successful responses.
176
184
  - Default demo identifiers:
@@ -183,7 +191,9 @@ Hard requirements:
183
191
  - Uploading a newly rebuilt or replaced plugin package does NOT hot-swap the already running host/runtime process. Before validating startup, registration, or page-side usage after a new upload, AI MUST restart the host/runtime process.
184
192
  - AI SHOULD consult:
185
193
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
194
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
186
195
  - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
196
+ - `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
187
197
 
188
198
  ## Plugin Scaffold Workflow (CRITICAL)
189
199