@quicktvui/ai 1.1.16 → 1.1.19
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 +44 -0
- package/package.json +1 -1
- package/rules/.claude/commands/create-component.md +1 -1
- package/rules/.claude/commands/create-page.md +1 -1
- package/rules/.claude/commands/create-project.md +1 -1
- package/rules/.claude/commands/lookup-api.md +1 -1
- package/rules/.claude/commands/lookup-css.md +1 -1
- package/rules/.clinerules +128 -0
- package/rules/.cursorrules +128 -0
- package/rules/.docs/zh-CN/tool/api/overview.md +4 -0
- package/rules/.docs/zh-CN/tool/api/plugin-scaffold-mcp.md +46 -0
- package/rules/.docs/zh-CN/tool/api/plugin-server-api.md +214 -0
- package/rules/.docs/zh-CN/tool/api/runtime-status.md +95 -0
- package/rules/.docs/zh-CN/tool/cli/introduction.md +7 -0
- package/rules/.docs/zh-CN/tool/cli/plugin-create-component.md +101 -0
- package/rules/.docs/zh-CN/tool/cli/plugin-create-module.md +88 -0
- package/rules/.docs/zh-CN/tool/cli/plugin-create-project.md +106 -0
- package/rules/.docs/zh-CN/tool/cli/plugin-server.md +169 -0
- package/rules/.docs/zh-CN/tool/cli/runtime-status.md +49 -0
- package/rules/.github/copilot-instructions.md +129 -1
- package/rules/.windsurfrules +128 -0
- package/rules/AGENTS.md +130 -1
- package/rules/AI_HANDOFF.md +113 -1
- package/rules/CLAUDE.md +131 -1
- package/rules/GEMINI.md +131 -1
package/rules/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: CLAUDE.md
|
|
3
|
-
version: 1.1.
|
|
3
|
+
version: 1.1.19
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# QuickTVUI - AI 开发指南
|
|
@@ -139,6 +139,136 @@ Hard requirements:
|
|
|
139
139
|
- AI 未通过 MCP 或 `quicktvui-ai debug-*` 实际读取到数据前,不得声称自己已经检查过运行时日志、native logs 或截图
|
|
140
140
|
- `debug-targets` 为空时,必须明确说明当前 `ESDebugServer /ai/targets` 还没有可读 target
|
|
141
141
|
- `debug-native-logs` 或 `debug-screenshot` 失败时,必须原样报告命令和错误,不得编造兜底结论
|
|
142
|
+
- 如果用户要查最近一次快应用加载状态、启动失败,或最近一次 runtime 侧错误信息,AI 还应优先补查 `quicktvui_runtime_status` / `quicktvui-ai runtime-status`,并同时报告相关包名项与 `__debug__`
|
|
143
|
+
|
|
144
|
+
## Plugin Server Workflow (CRITICAL)
|
|
145
|
+
|
|
146
|
+
当用户要求 AI 检查、上传或联调电视插件服务接口(`/hello`、`/status`、`/uploadSo`、`/uploadPlugin`),或要求查看最近一次 runtime 加载状态与错误信息时,AI 必须遵循以下优先级:
|
|
147
|
+
|
|
148
|
+
1. 优先使用已连接的 `quicktvui-ai-mcp` 插件工具:
|
|
149
|
+
- `plugin_server_check`
|
|
150
|
+
- `plugin_server_hello`
|
|
151
|
+
- `plugin_server_status`
|
|
152
|
+
- `quicktvui_runtime_status`
|
|
153
|
+
- `plugin_upload_so`
|
|
154
|
+
- `plugin_upload_plugin`
|
|
155
|
+
2. 如果没有 MCP,但具备 shell/CLI 能力,则必须使用 `quicktvui-ai plugin-*`
|
|
156
|
+
3. 只有 MCP 和 CLI 都不可用时,才允许退回到手工 `adb` + `curl`
|
|
157
|
+
|
|
158
|
+
推荐执行顺序:
|
|
159
|
+
|
|
160
|
+
1. 先打开 Toolkit RESTful API
|
|
161
|
+
- CLI:`quicktvui-ai plugin-enable-api --device <serial>`
|
|
162
|
+
- 手工兜底:`adb -s <serial> shell am broadcast -a "eskit.sdk.core.ACTION_TOOLKIT_SETTING" --es "RESTFUL_API" "true"`
|
|
163
|
+
2. 检查服务是否 ready
|
|
164
|
+
- MCP:`plugin_server_check`
|
|
165
|
+
- CLI:`quicktvui-ai plugin-check --device <serial>`
|
|
166
|
+
3. 读取当前状态
|
|
167
|
+
- MCP:`plugin_server_status`
|
|
168
|
+
- CLI:`quicktvui-ai plugin-status --device <serial>`
|
|
169
|
+
4. 如果任务需要最近一次 runtime 加载状态或错误信息
|
|
170
|
+
- MCP:`quicktvui_runtime_status`
|
|
171
|
+
- CLI:`quicktvui-ai runtime-status --device <serial>`
|
|
172
|
+
5. 解析插件服务地址
|
|
173
|
+
- 如果显式传了 `baseUrl` / `--plugin-base-url`,优先使用该地址
|
|
174
|
+
- 否则,如果 adb 已连接设备,先尝试使用该设备的插件服务地址
|
|
175
|
+
- 如果无法从目标设备推断 host,则改用 adb 端口转发和 `http://127.0.0.1:36366`
|
|
176
|
+
- 如果同时连接了多台 adb 设备,AI 必须要求用户选择 `serial` 或提供服务 IP / `baseUrl`
|
|
177
|
+
- 如果没有任何 adb 已连接设备,AI 必须向用户索要服务 IP / `baseUrl`,不得脑补或写死某个开发者自己的电视 IP
|
|
178
|
+
6. 上传 So
|
|
179
|
+
- 必须根据当前插件服务对应设备的 `ro.product.cpu.abi` 选择匹配的 zip
|
|
180
|
+
- CLI:`quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
|
|
181
|
+
7. 上传插件 APK
|
|
182
|
+
- CLI:`quicktvui-ai plugin-upload-plugin --device <serial> --pkg eskit.plugin.imagequality --file <apk-path>`
|
|
183
|
+
|
|
184
|
+
硬约束:
|
|
185
|
+
|
|
186
|
+
- 运行中接口返回永远优先于 markdown 文档。
|
|
187
|
+
- `/hello`、`/status`、`/uploadSo`、`/uploadPlugin` 必须使用 `POST` 探测,不能用 `GET` 判断服务是否可用。
|
|
188
|
+
- `/status` 中的 `data.loadStatus` 是最近一次 runtime 加载状态与错误信息的权威来源。执行 `run-dev`、`run-esapp`、页面侧安装插件、或启动失败后,AI 应优先查询 `quicktvui_runtime_status` / `runtime-status`,并同时报告相关包名项与 `__debug__`。
|
|
189
|
+
- 如果 AI 正在 `quicktvui-ai` 仓库内工作,且文档与实机接口不一致,必须回写文档。
|
|
190
|
+
- `uploadSo` 目前存在 `pkg` / `tag` 字段漂移,AI 应同时传 `pkg` 和 `tag`,成功后以返回的 `data.tag` 为准。
|
|
191
|
+
- 默认测试标识固定为:
|
|
192
|
+
- So 包名 / tag:`eskit.so.ffmpeg.command`
|
|
193
|
+
- 插件包名:`eskit.plugin.imagequality`
|
|
194
|
+
- ABI 选择必须与当前插件服务对应设备的 `ro.product.cpu.abi` 一致,但只有上传 So 时才需要解析;若未显式传 `abi`,应优先让 CLI / MCP 在上传时按需补齐。
|
|
195
|
+
- 未收到 MCP 或 CLI 的成功响应前,不得宣称上传成功。
|
|
196
|
+
- 即使 `uploadPlugin` 返回 `registered: true`,`status.pluginList` 也可能仍为空;AI 必须如实说明,不得自行脑补安装状态。
|
|
197
|
+
- `uploadPlugin` 成功或 `registered: true` 只代表插件包已经上传到插件服务,不代表 Vue 页面已经可直接使用;如果任务要求在页面里实际调用插件,AI 还必须补齐 Vue 侧安装逻辑。
|
|
198
|
+
- 重新上传新的插件包后,当前宿主 / runtime 进程不会自动热更新到新字节码;在重新验证启动、注册或页面接入之前,AI 必须先重启宿主 / runtime 进程。
|
|
199
|
+
- 生成命令或说明前,应优先查阅以下包内文档:
|
|
200
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
|
|
201
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
|
|
202
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
|
|
203
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
|
|
204
|
+
|
|
205
|
+
## Plugin Scaffold Workflow (CRITICAL)
|
|
206
|
+
|
|
207
|
+
当用户要求 AI 创建、更新、打包 Android 插件工程,或生成原生模块 / 原生组件时,AI 必须遵循以下优先级:
|
|
208
|
+
|
|
209
|
+
1. 优先使用已连接的 `quicktvui-ai-mcp`:
|
|
210
|
+
- `plugin_project_create`
|
|
211
|
+
- `plugin_project_build`
|
|
212
|
+
- `plugin_module_create`
|
|
213
|
+
- `plugin_component_create`
|
|
214
|
+
2. 如果没有 MCP,但具备 shell/CLI 能力,则必须使用 `quicktvui-ai`:
|
|
215
|
+
- `plugin-create-project`
|
|
216
|
+
- `plugin-build`
|
|
217
|
+
- `plugin-create-module`
|
|
218
|
+
- `plugin-create-component`
|
|
219
|
+
3. 只有 MCP 和 CLI 都不可用时,才允许手工创建或修改脚手架。
|
|
220
|
+
|
|
221
|
+
决策规则:
|
|
222
|
+
|
|
223
|
+
1. 工程初始化 / 更新 / 打包:使用 `plugin_project_create` / `plugin_project_build`
|
|
224
|
+
2. 无独立原生 UI 的能力:使用 `plugin_module_create`
|
|
225
|
+
3. 有原生 View、属性、事件或函数派发的能力:使用 `plugin_component_create`
|
|
226
|
+
|
|
227
|
+
硬约束:
|
|
228
|
+
|
|
229
|
+
- 生成前应优先查阅以下包内文档:
|
|
230
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-create-project.md`
|
|
231
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-create-module.md`
|
|
232
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-create-component.md`
|
|
233
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-scaffold-mcp.md`
|
|
234
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/module/plugin.md`
|
|
235
|
+
- `node_modules/@quicktvui/ai/rules/.docs/examples/module/plugin/es-basic.vue`
|
|
236
|
+
- `node_modules/@quicktvui/ai/rules/.source/quicktvui/src/long-image/index.vue`
|
|
237
|
+
- 源码真值来自 `.source/sdk/base/...`,真实接口固定为:
|
|
238
|
+
- `com.quicktvui.sdk.base.module.IEsModule`
|
|
239
|
+
- `com.quicktvui.sdk.base.component.IEsComponent`
|
|
240
|
+
- `com.quicktvui.sdk.base.component.IEsComponentView`
|
|
241
|
+
- `com.quicktvui.sdk.base.component.EsComponentAttribute`
|
|
242
|
+
- 脚手架结构默认仍以 `.source/sdk/base/...` 为准,但目标设备运行时日志永远优先于默认命名空间。
|
|
243
|
+
- 如果设备日志出现 `ClassNotFoundException: com.quicktvui.sdk.base.core.EsProxy`,或启动阶段提示缺失 `com.quicktvui.sdk.base.*` 相关类,AI 必须立刻把这视为运行时兼容性问题,而不是继续重复使用默认脚手架命名空间;应改为适配设备实际存在的运行时命名空间后重新构建、重传。
|
|
244
|
+
- 如果设备日志出现 `java.lang.NoSuchMethodError: No static method get()Leskit/sdk/support/core/EsProxy;`,AI 必须把它视为插件注册入口的字节码签名不兼容,而不是页面逻辑问题;应按设备真实 runtime 的 `EsProxy.get()` 签名 / 调用路径调整注册代码后重新构建、重传。
|
|
245
|
+
- AI 必须区分“本地 stub 可编译”和“设备运行时类真实存在”。如果插件能编译但在设备侧因 `EsProxy` 等类缺失而启动失败,这一版插件仍然判定为失败。
|
|
246
|
+
- 插件工程打包完成或插件服务上传成功,并不代表 Vue 侧已经完成安装。
|
|
247
|
+
- 如果页面需要实际使用插件,AI 必须在 Vue 侧使用 `@extscreen/es3-core` 的 `useESPlugin()` 补齐安装流程。
|
|
248
|
+
- AI 必须在 `onESCreate` 中添加插件监听,在 `onESDestroy` 中移除监听。
|
|
249
|
+
- 对于组件型插件,AI 应优先使用 `useES().isComponentRegistered("<组件完整类名>")` 检查组件是否已注册;若未注册,应先安装插件,再渲染或调用对应组件。
|
|
250
|
+
- 不允许把“插件已上传”误当成“页面里已经可直接使用”,也不允许在未监听安装完成前直接假设同步可用。
|
|
251
|
+
- 如果页面收到安装成功回调后,组件或模块注册仍然短暂不可见,AI 应允许一个简短的轮询复查窗口,再决定是否判定失败。
|
|
252
|
+
- 如果是为修复运行时兼容性而重新上传的新插件版本,AI 在复测前必须先重启宿主 / runtime 进程,否则当前进程仍可能持有旧插件字节码。
|
|
253
|
+
- 创建工程后必须写入 `.kyy-plugin-project.json`
|
|
254
|
+
- 对于长期保留或准备发布的插件工程,默认应放在 `<project-root>/plugin/<plugin-name>` 这种项目根目录下的可见目录
|
|
255
|
+
- 不允许把插件工程默认放到 `.ai-test/*` 等隐藏目录或其他点前缀目录
|
|
256
|
+
- 若插件工程位于子目录且工作区根目录存在 `package.json`,必须注入 `build:android-plugin`
|
|
257
|
+
- 打包优先级固定为:
|
|
258
|
+
1. `npm run build:android-plugin`
|
|
259
|
+
2. `npm run build:plugin`
|
|
260
|
+
3. `npm run build`
|
|
261
|
+
4. `./gradlew assembleGeneralDebug`
|
|
262
|
+
- 如果插件构建报 Android SDK 缺失,AI 必须先按通用顺序探测 SDK:`ANDROID_SDK_ROOT` -> `ANDROID_HOME` -> 当前平台默认 SDK 目录,然后再判断环境是否真的缺失。
|
|
263
|
+
- 如果已经探测到 SDK,且目标插件工程缺少 `local.properties` / `sdk.dir`,AI 可以让 CLI / MCP 只为当前开发机补齐这个本地文件。
|
|
264
|
+
- AI 不得把某个开发者本机的 Android SDK 路径写进共享规则、硬编码项目配置或提交到仓库。
|
|
265
|
+
- 生成 module / component 前,必须先获得明确功能描述
|
|
266
|
+
- Java 包名必须使用合法包段,不能把 `kebab-case` 直接写进包路径
|
|
267
|
+
- component 必须生成或更新 `docs/component/<kebab-name>.md`
|
|
268
|
+
- 组件标签必须使用 `kebab-case`
|
|
269
|
+
- 在 Vue `h()` 中禁止传完整 Java 包名,必须使用组件类名或约定标签名
|
|
270
|
+
- 如果能定位到 `Application`,应优先补 `EsProxy.get().registerModule(...)` / `EsProxy.get().registerComponent(...)`
|
|
271
|
+
- 如果文档与源码或实际实现不一致,AI 必须更新文档
|
|
142
272
|
|
|
143
273
|
## 🔥 核心架构避坑指南 (ARCHITECTURAL GOTCHAS)
|
|
144
274
|
|
package/rules/GEMINI.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: GEMINI.md
|
|
3
|
-
version: 1.1.
|
|
3
|
+
version: 1.1.19
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GEMINI.md - QuickTVUI AI 开发指南
|
|
@@ -130,6 +130,136 @@ Hard requirements:
|
|
|
130
130
|
- AI MUST NOT claim it inspected runtime data unless MCP or `quicktvui-ai debug-*` actually returned that data
|
|
131
131
|
- If `debug-targets` is empty, AI MUST say that `ESDebugServer /ai/targets` is still empty
|
|
132
132
|
- If `debug-native-logs` or `debug-screenshot` fails, AI MUST report the real command/error instead of inventing fallback observations
|
|
133
|
+
- 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`
|
|
134
|
+
|
|
135
|
+
## Plugin Server Workflow (CRITICAL)
|
|
136
|
+
|
|
137
|
+
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`:
|
|
138
|
+
|
|
139
|
+
1. Prefer connected `quicktvui-ai-mcp` plugin tools:
|
|
140
|
+
- `plugin_server_check`
|
|
141
|
+
- `plugin_server_hello`
|
|
142
|
+
- `plugin_server_status`
|
|
143
|
+
- `quicktvui_runtime_status`
|
|
144
|
+
- `plugin_upload_so`
|
|
145
|
+
- `plugin_upload_plugin`
|
|
146
|
+
2. Otherwise use `quicktvui-ai plugin-*`
|
|
147
|
+
3. Only fall back to manual `adb` + `curl` when neither MCP nor CLI execution is available
|
|
148
|
+
|
|
149
|
+
Required order:
|
|
150
|
+
|
|
151
|
+
1. Enable Toolkit RESTful API first
|
|
152
|
+
- CLI: `quicktvui-ai plugin-enable-api --device <serial>`
|
|
153
|
+
- Manual fallback: `adb -s <serial> shell am broadcast -a "eskit.sdk.core.ACTION_TOOLKIT_SETTING" --es "RESTFUL_API" "true"`
|
|
154
|
+
2. Probe readiness
|
|
155
|
+
- MCP: `plugin_server_check`
|
|
156
|
+
- CLI: `quicktvui-ai plugin-check --device <serial>`
|
|
157
|
+
3. Read current state
|
|
158
|
+
- MCP: `plugin_server_status`
|
|
159
|
+
- CLI: `quicktvui-ai plugin-status --device <serial>`
|
|
160
|
+
4. If the user needs recent runtime load state or latest error info after quick-app/plugin load
|
|
161
|
+
- MCP: `quicktvui_runtime_status`
|
|
162
|
+
- CLI: `quicktvui-ai runtime-status --device <serial>`
|
|
163
|
+
5. Resolve plugin server address
|
|
164
|
+
- If `baseUrl` / `--plugin-base-url` is explicitly provided, use it
|
|
165
|
+
- Otherwise, if adb already has a connected target, use that target's plugin service address first
|
|
166
|
+
- If the target host cannot be inferred, use adb port forward and `http://127.0.0.1:36366`
|
|
167
|
+
- If multiple adb devices are connected, AI MUST ask the user to choose `serial` or provide service IP / `baseUrl`
|
|
168
|
+
- If no adb-connected device exists, AI MUST ask the user for service IP / `baseUrl`, and MUST NOT invent a developer-specific TV IP
|
|
169
|
+
6. Upload So zip
|
|
170
|
+
- choose the archive that matches `ro.product.cpu.abi` on the device behind the current plugin service
|
|
171
|
+
- CLI: `quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file <zip-path>`
|
|
172
|
+
7. Upload plugin APK
|
|
173
|
+
- CLI: `quicktvui-ai plugin-upload-plugin --device <serial> --pkg eskit.plugin.imagequality --file <apk-path>`
|
|
174
|
+
|
|
175
|
+
Hard requirements:
|
|
176
|
+
|
|
177
|
+
- Runtime endpoint behavior overrides markdown docs.
|
|
178
|
+
- Probe `/hello`, `/status`, `/uploadSo`, `/uploadPlugin` with `POST`, not `GET`.
|
|
179
|
+
- `/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__`.
|
|
180
|
+
- When AI is editing the `quicktvui-ai` repo itself and finds doc/runtime drift, AI MUST update docs.
|
|
181
|
+
- `uploadSo` currently shows `pkg` / `tag` drift. AI SHOULD send both `pkg` and `tag`, and trust `data.tag` in successful responses.
|
|
182
|
+
- Default demo identifiers:
|
|
183
|
+
- So package/tag: `eskit.so.ffmpeg.command`
|
|
184
|
+
- Plugin package: `eskit.plugin.imagequality`
|
|
185
|
+
- ABI selection MUST match `ro.product.cpu.abi` on the service-corresponding device, but AI SHOULD only resolve ABI when uploading So and SHOULD let CLI / MCP fill it on demand if `abi` is not explicitly provided.
|
|
186
|
+
- AI MUST NOT claim upload success unless MCP or CLI returned a success payload.
|
|
187
|
+
- `status.pluginList` may still be empty even after `uploadPlugin` returns `registered: true`; AI MUST report that exact state.
|
|
188
|
+
- `uploadPlugin` success or `registered: true` only means the package reached plugin service storage. If the task is to use the plugin from a Vue page, AI MUST still add Vue-side installation logic.
|
|
189
|
+
- 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.
|
|
190
|
+
- AI SHOULD consult:
|
|
191
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-server-api.md`
|
|
192
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/runtime-status.md`
|
|
193
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-server.md`
|
|
194
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/runtime-status.md`
|
|
195
|
+
|
|
196
|
+
## Plugin Scaffold Workflow (CRITICAL)
|
|
197
|
+
|
|
198
|
+
当用户要求 AI 创建、更新、打包 Android 插件工程,或生成原生模块 / 原生组件时,AI 必须遵循以下优先级:
|
|
199
|
+
|
|
200
|
+
1. 优先使用已连接的 `quicktvui-ai-mcp`:
|
|
201
|
+
- `plugin_project_create`
|
|
202
|
+
- `plugin_project_build`
|
|
203
|
+
- `plugin_module_create`
|
|
204
|
+
- `plugin_component_create`
|
|
205
|
+
2. 如果没有 MCP,但具备 shell/CLI 能力,则必须使用 `quicktvui-ai`:
|
|
206
|
+
- `plugin-create-project`
|
|
207
|
+
- `plugin-build`
|
|
208
|
+
- `plugin-create-module`
|
|
209
|
+
- `plugin-create-component`
|
|
210
|
+
3. 只有 MCP 和 CLI 都不可用时,才允许手工创建或修改脚手架。
|
|
211
|
+
|
|
212
|
+
决策规则:
|
|
213
|
+
|
|
214
|
+
1. 工程初始化 / 更新 / 打包:使用 `plugin_project_create` / `plugin_project_build`
|
|
215
|
+
2. 无独立原生 UI 的能力:使用 `plugin_module_create`
|
|
216
|
+
3. 有原生 View、属性、事件或函数派发的能力:使用 `plugin_component_create`
|
|
217
|
+
|
|
218
|
+
硬约束:
|
|
219
|
+
|
|
220
|
+
- 生成前应优先查阅以下包内文档:
|
|
221
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-create-project.md`
|
|
222
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-create-module.md`
|
|
223
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/cli/plugin-create-component.md`
|
|
224
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/tool/api/plugin-scaffold-mcp.md`
|
|
225
|
+
- `node_modules/@quicktvui/ai/rules/.docs/zh-CN/module/plugin.md`
|
|
226
|
+
- `node_modules/@quicktvui/ai/rules/.docs/examples/module/plugin/es-basic.vue`
|
|
227
|
+
- `node_modules/@quicktvui/ai/rules/.source/quicktvui/src/long-image/index.vue`
|
|
228
|
+
- 源码真值来自 `.source/sdk/base/...`,真实接口固定为:
|
|
229
|
+
- `com.quicktvui.sdk.base.module.IEsModule`
|
|
230
|
+
- `com.quicktvui.sdk.base.component.IEsComponent`
|
|
231
|
+
- `com.quicktvui.sdk.base.component.IEsComponentView`
|
|
232
|
+
- `com.quicktvui.sdk.base.component.EsComponentAttribute`
|
|
233
|
+
- 脚手架结构默认仍以 `.source/sdk/base/...` 为准,但目标设备运行时日志永远优先于默认命名空间。
|
|
234
|
+
- 如果设备日志出现 `ClassNotFoundException: com.quicktvui.sdk.base.core.EsProxy`,或启动阶段提示缺失 `com.quicktvui.sdk.base.*` 相关类,AI 必须把这视为运行时兼容性问题,改为适配设备实际存在的运行时命名空间后再重新构建、重传。
|
|
235
|
+
- 如果设备日志出现 `java.lang.NoSuchMethodError: No static method get()Leskit/sdk/support/core/EsProxy;`,AI 必须把它视为插件注册入口的字节码签名不兼容,而不是页面逻辑问题;应改为匹配设备真实 runtime 的 `EsProxy.get()` 签名 / 调用路径后重新构建、重传。
|
|
236
|
+
- AI 必须区分“本地 stub 可编译”和“设备运行时类真实存在”。如果插件能编译但在设备侧因 `EsProxy` 等类缺失而启动失败,这一版插件仍然判定为失败。
|
|
237
|
+
- 插件工程打包完成或插件服务上传成功,并不代表 Vue 侧已经完成安装。
|
|
238
|
+
- 如果页面需要实际使用插件,AI 必须在 Vue 侧使用 `@extscreen/es3-core` 的 `useESPlugin()` 补齐安装流程。
|
|
239
|
+
- AI 必须在 `onESCreate` 中添加插件监听,在 `onESDestroy` 中移除监听。
|
|
240
|
+
- 对于组件型插件,AI 应优先使用 `useES().isComponentRegistered("<组件完整类名>")` 检查组件是否已注册;若未注册,应先安装插件,再渲染或调用对应组件。
|
|
241
|
+
- 不允许把“插件已上传”误当成“页面里已经可直接使用”,也不允许在未监听安装完成前直接假设同步可用。
|
|
242
|
+
- 如果页面收到安装成功回调后,组件或模块注册仍然短暂不可见,AI 应允许一个简短的轮询复查窗口,再决定是否判定失败。
|
|
243
|
+
- 如果是为修复运行时兼容性而重新上传的新插件版本,AI 在复测前必须先重启宿主 / runtime 进程,否则当前进程仍可能持有旧插件字节码。
|
|
244
|
+
- 创建工程后必须写入 `.kyy-plugin-project.json`
|
|
245
|
+
- 对于长期保留或准备发布的插件工程,默认应放在 `<project-root>/plugin/<plugin-name>` 这种项目根目录下的可见目录
|
|
246
|
+
- 不允许把插件工程默认放到 `.ai-test/*` 等隐藏目录或其他点前缀目录
|
|
247
|
+
- 若插件工程位于子目录且工作区根目录存在 `package.json`,必须注入 `build:android-plugin`
|
|
248
|
+
- 打包优先级固定为:
|
|
249
|
+
1. `npm run build:android-plugin`
|
|
250
|
+
2. `npm run build:plugin`
|
|
251
|
+
3. `npm run build`
|
|
252
|
+
4. `./gradlew assembleGeneralDebug`
|
|
253
|
+
- 如果插件构建报 Android SDK 缺失,AI 必须先按通用顺序探测 SDK:`ANDROID_SDK_ROOT` -> `ANDROID_HOME` -> 当前平台默认 SDK 目录,然后再判断环境是否真的缺失。
|
|
254
|
+
- 如果已经探测到 SDK,且目标插件工程缺少 `local.properties` / `sdk.dir`,AI 可以让 CLI / MCP 只为当前开发机补齐这个本地文件。
|
|
255
|
+
- AI 不得把某个开发者本机的 Android SDK 路径写进共享规则、硬编码项目配置或提交到仓库。
|
|
256
|
+
- 生成 module / component 前,必须先获得明确功能描述
|
|
257
|
+
- Java 包名必须使用合法包段,不能把 `kebab-case` 直接写进包路径
|
|
258
|
+
- component 必须生成或更新 `docs/component/<kebab-name>.md`
|
|
259
|
+
- 组件标签必须使用 `kebab-case`
|
|
260
|
+
- 在 Vue `h()` 中禁止传完整 Java 包名,必须使用组件类名或约定标签名
|
|
261
|
+
- 如果能定位到 `Application`,应优先补 `EsProxy.get().registerModule(...)` / `EsProxy.get().registerComponent(...)`
|
|
262
|
+
- 如果文档与源码或实际实现不一致,AI 必须更新文档
|
|
133
263
|
|
|
134
264
|
---
|
|
135
265
|
|