@quicktvui/ai 1.0.1 → 1.0.2

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.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "QuickTVUI AI 开发规范与脚手架注入工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -11,7 +11,10 @@ if (!projectRoot || !fs.existsSync(projectRoot)) {
11
11
  }
12
12
 
13
13
  // 避免在包自身的开发环境中循环复制
14
- if (projectRoot === __dirname || projectRoot === path.join(__dirname, '..', '..')) {
14
+ if (
15
+ projectRoot === __dirname ||
16
+ projectRoot === path.join(__dirname, "..", "..")
17
+ ) {
15
18
  process.exit(0);
16
19
  }
17
20
 
@@ -20,7 +23,7 @@ console.log(`📂 目标目录: ${projectRoot}`);
20
23
 
21
24
  const rulesDir = path.join(__dirname, "rules");
22
25
  const backupBaseDir = path.join(projectRoot, ".quicktvui-ai-backup");
23
- const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
26
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
24
27
  const currentBackupDir = path.join(backupBaseDir, `backup_${timestamp}`);
25
28
 
26
29
  function copyDirectorySync(src, dest) {
@@ -46,7 +49,8 @@ try {
46
49
  const targetPath = path.join(projectRoot, item);
47
50
  if (fs.existsSync(targetPath)) {
48
51
  if (!backupNeeded) {
49
- if (!fs.existsSync(currentBackupDir)) fs.mkdirSync(currentBackupDir, { recursive: true });
52
+ if (!fs.existsSync(currentBackupDir))
53
+ fs.mkdirSync(currentBackupDir, { recursive: true });
50
54
  backupNeeded = true;
51
55
  }
52
56
  const backupPath = path.join(currentBackupDir, item);
@@ -59,7 +63,9 @@ try {
59
63
  });
60
64
 
61
65
  if (backupNeeded) {
62
- console.log(`📦 已检测到现有 AI 配置文件,已备份至: .quicktvui-ai-backup/backup_${timestamp}`);
66
+ console.log(
67
+ `📦 已检测到现有 AI 配置文件,已备份至: .quicktvui-ai-backup/backup_${timestamp}`,
68
+ );
63
69
  }
64
70
 
65
71
  // 2. 注入新规则
@@ -75,7 +81,9 @@ try {
75
81
 
76
82
  const itemsToIgnore = [
77
83
  ".quicktvui-ai-backup",
78
- ...rootItems.map(item => item === ".github" ? ".github/copilot-instructions.md" : item)
84
+ ...rootItems.map((item) =>
85
+ item === ".github" ? ".github/copilot-instructions.md" : item,
86
+ ),
79
87
  ];
80
88
 
81
89
  let updatedGitignore = gitignoreContent;
@@ -83,7 +91,10 @@ try {
83
91
 
84
92
  const sectionHeader = "# QuickTVUI AI Rules";
85
93
  if (!updatedGitignore.includes(sectionHeader)) {
86
- updatedGitignore += (updatedGitignore.length > 0 && !updatedGitignore.endsWith("\n") ? "\n" : "") + `\n${sectionHeader}\n`;
94
+ updatedGitignore +=
95
+ (updatedGitignore.length > 0 && !updatedGitignore.endsWith("\n")
96
+ ? "\n"
97
+ : "") + `\n${sectionHeader}\n`;
87
98
  hasChanges = true;
88
99
  }
89
100
 
@@ -97,11 +108,10 @@ try {
97
108
  });
98
109
 
99
110
  if (hasChanges) {
100
- fs.writeFileSync(gitignorePath, updatedGitignore);
101
- console.log("✅ 已更新 .gitignore,排除 AI 配置文件。");
111
+ fs.writeFileSync(gitignorePath, updatedGitignore);
112
+ console.log("✅ 已更新 .gitignore,排除 AI 配置文件。");
102
113
  }
103
- } catch (err) {
104
-
114
+ } catch (err) {
105
115
  console.error(`❌ 注入失败: ${err.message}`);
106
116
  }
107
117
 
package/rules/.clinerules CHANGED
@@ -143,6 +143,26 @@ Other CSS rules:
143
143
  <qt-list-view :clipChildren="false" :clipPadding="false" />
144
144
  ```
145
145
 
146
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
147
+
148
+ 当用户通过以下方式表达困惑时:
149
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
151
+
152
+ **AI 执行协议:**
153
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
154
+ - 提取报错日志(去除绝对路径和私密 Token)。
155
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
156
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
157
+ 2. **寻求授权 (Request Consent)**:
158
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
159
+ 3. **提交方式 (Submission)**:
160
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
161
+ - macOS: `open "URL"`
162
+ - Linux: `xdg-open "URL"`
163
+ - Windows: `start "URL"`
164
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
165
+
146
166
  ### Import Sources
147
167
  - `defineComponent` from `vue` — NOT from `@vue/runtime-core`
148
168
  - Router: `useESRouter` from `@extscreen/es3-router`
@@ -143,6 +143,26 @@ Other CSS rules:
143
143
  <qt-list-view :clipChildren="false" :clipPadding="false" />
144
144
  ```
145
145
 
146
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
147
+
148
+ 当用户通过以下方式表达困惑时:
149
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
151
+
152
+ **AI 执行协议:**
153
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
154
+ - 提取报错日志(去除绝对路径和私密 Token)。
155
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
156
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
157
+ 2. **寻求授权 (Request Consent)**:
158
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
159
+ 3. **提交方式 (Submission)**:
160
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
161
+ - macOS: `open "URL"`
162
+ - Linux: `xdg-open "URL"`
163
+ - Windows: `start "URL"`
164
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
165
+
146
166
  ### Import Sources
147
167
  - `defineComponent` from `vue` — NOT from `@vue/runtime-core`
148
168
  - Router: `useESRouter` from `@extscreen/es3-router`
@@ -143,6 +143,26 @@ Other CSS rules:
143
143
  <qt-list-view :clipChildren="false" :clipPadding="false" />
144
144
  ```
145
145
 
146
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
147
+
148
+ 当用户通过以下方式表达困惑时:
149
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
151
+
152
+ **AI 执行协议:**
153
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
154
+ - 提取报错日志(去除绝对路径和私密 Token)。
155
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
156
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
157
+ 2. **寻求授权 (Request Consent)**:
158
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
159
+ 3. **提交方式 (Submission)**:
160
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
161
+ - macOS: `open "URL"`
162
+ - Linux: `xdg-open "URL"`
163
+ - Windows: `start "URL"`
164
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
165
+
146
166
  ### Import Sources
147
167
  - `defineComponent` from `vue` — NOT from `@vue/runtime-core`
148
168
  - Router: `useESRouter` from `@extscreen/es3-router`
package/rules/AGENTS.md CHANGED
@@ -154,6 +154,26 @@ Android clips child views outside parent bounds by default. When using `focusSca
154
154
  <qt-list-view :clipChildren="false" :clipPadding="false" />
155
155
  ```
156
156
 
157
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
158
+
159
+ 当用户通过以下方式表达困惑时:
160
+ - **关键词触发**:当用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
161
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
162
+
163
+ **AI 执行协议 (Execution Protocol):**
164
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
165
+ - 提取报错日志(必须去除绝对路径和私密 Token/API Keys)。
166
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
167
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
168
+ 2. **寻求授权 (Request Consent)**:
169
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
170
+ 3. **提交方式 (Submission)**:
171
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
172
+ - macOS: `open "URL"`
173
+ - Linux: `xdg-open "URL"`
174
+ - Windows: `start "URL"`
175
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
176
+
157
177
  ### Import Sources
158
178
 
159
179
  - `defineComponent` from `vue` — NOT from `@vue/runtime-core`
package/rules/CLAUDE.md CHANGED
@@ -178,6 +178,26 @@ Android 默认裁切超出父容器边界的子元素。TV 端使用 `focusScale
178
178
  <qt-waterfall :clipChildren="false" :clipPadding="false" />
179
179
  ```
180
180
 
181
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
182
+
183
+ 当用户通过以下方式表达困惑时:
184
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
185
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
186
+
187
+ **AI 执行协议:**
188
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
189
+ - 提取报错日志(去除绝对路径和私密 Token)。
190
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
191
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
192
+ 2. **寻求授权 (Request Consent)**:
193
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
194
+ 3. **提交方式 (Submission)**:
195
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
196
+ - macOS: `open "URL"`
197
+ - Linux: `xdg-open "URL"`
198
+ - Windows: `start "URL"`
199
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
200
+
181
201
  ### import 来源
182
202
 
183
203
  - `defineComponent` 从 `vue` 导入(对),不要从 `@vue/runtime-core` 导入
package/rules/GEMINI.md CHANGED
@@ -159,6 +159,26 @@ Android clips child views outside parent bounds by default. When using `focusSca
159
159
  <qt-list-view :clipChildren="false" :clipPadding="false" />
160
160
  ```
161
161
 
162
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
163
+
164
+ 当用户通过以下方式表达困惑时:
165
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
166
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
167
+
168
+ **AI 执行协议:**
169
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
170
+ - 提取报错日志(去除绝对路径和私密 Token)。
171
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
172
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
173
+ 2. **寻求授权 (Request Consent)**:
174
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
175
+ 3. **提交方式 (Submission)**:
176
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
177
+ - macOS: `open "URL"`
178
+ - Linux: `xdg-open "URL"`
179
+ - Windows: `start "URL"`
180
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
181
+
162
182
  ### Import Sources
163
183
 
164
184
  - `defineComponent` from `vue` (correct) — NOT from `@vue/runtime-core`