@microi.net/cli 4.9.4 → 4.9.6

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.
Files changed (84) hide show
  1. package/.codebuddy-plugin/marketplace.json +2 -2
  2. package/.codebuddy-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.workbuddy-plugin/marketplace.json +2 -2
  5. package/.workbuddy-plugin/plugin.json +1 -1
  6. package/README.md +7 -12
  7. package/assets/build-meta.json +5 -5
  8. package/package.json +1 -1
  9. package/scripts/mcp-server.js +92 -92
  10. package/scripts/microi-cli.js +78 -60
  11. package/scripts/microi-codex-router.js +30 -0
  12. package/scripts/microi-skills.meta.json +196 -190
  13. package/skills/.microi-skills-version.json +2 -2
  14. package/skills/README.md +1 -1
  15. package/skills/ai-engine/SKILL.md +1 -1
  16. package/skills/ai-platform-governance/SKILL.md +1 -1
  17. package/skills/app-store/SKILL.md +1 -1
  18. package/skills/business-blueprint/SKILL.md +1 -1
  19. package/skills/datasource-engine/SKILL.md +1 -1
  20. package/skills/dos-orm/SKILL.md +1 -1
  21. package/skills/job-engine/SKILL.md +1 -1
  22. package/skills/message-notification/SKILL.md +1 -1
  23. package/skills/microi-ai-application/SKILL.md +1 -1
  24. package/skills/microi-client-frontend/SKILL.md +1 -1
  25. package/skills/microi-codex/SKILL.md +4 -4
  26. package/skills/microi-codex-installer/SKILL.md +25 -36
  27. package/skills/microi-datasource-mapping/SKILL.md +1 -1
  28. package/skills/microi-db-schema/SKILL.md +1 -1
  29. package/skills/microi-deployment/SKILL.md +1 -1
  30. package/skills/microi-docs-coverage/SKILL.md +1 -1
  31. package/skills/microi-docs-coverage/references/capability-map.md +3 -2
  32. package/skills/microi-form-engine/SKILL.md +7 -4
  33. package/skills/microi-form-layout/SKILL.md +19 -6
  34. package/skills/microi-frontend-sdk/SKILL.md +1 -1
  35. package/skills/microi-left-right-layout/SKILL.md +1 -1
  36. package/skills/microi-microservice/SKILL.md +8 -1
  37. package/skills/microi-microservice/references/runtime-delivery.md +4 -0
  38. package/skills/microi-mobile-app-quality/SKILL.md +1 -1
  39. package/skills/microi-solution-quotation/SKILL.md +1 -1
  40. package/skills/microi-system-delivery/SKILL.md +6 -3
  41. package/skills/microi-ui/SKILL.md +1 -1
  42. package/skills/microi-uniapp-frontend/SKILL.md +1 -1
  43. package/skills/module-engine/SKILL.md +1 -1
  44. package/skills/ocr-engine/SKILL.md +1 -1
  45. package/skills/page-engine/SKILL.md +1 -1
  46. package/skills/performance-testing/SKILL.md +1 -1
  47. package/skills/playwright-e2e/SKILL.md +1 -1
  48. package/skills/print-engine/SKILL.md +6 -5
  49. package/skills/production-readonly-audit/SKILL.md +1 -1
  50. package/skills/report-engine/SKILL.md +1 -1
  51. package/skills/search-engine/SKILL.md +1 -1
  52. package/skills/spider-engine/SKILL.md +1 -1
  53. package/skills/translate-engine/SKILL.md +1 -1
  54. package/skills/ui-design/SKILL.md +1 -1
  55. package/skills/uniapp-mall-assets/SKILL.md +1 -1
  56. package/skills/unity-integration/SKILL.md +9 -1
  57. package/skills/unity-integration/references/ai-app-delivery.md +26 -6
  58. package/skills/v8-api-config/SKILL.md +1 -1
  59. package/skills/v8-cache-pattern/SKILL.md +1 -1
  60. package/skills/v8-crud-api/SKILL.md +1 -1
  61. package/skills/v8-debugging/SKILL.md +1 -1
  62. package/skills/v8-explorer-tree/SKILL.md +1 -1
  63. package/skills/v8-export-import/SKILL.md +1 -1
  64. package/skills/v8-file-upload/SKILL.md +1 -1
  65. package/skills/v8-formengine-http/SKILL.md +1 -1
  66. package/skills/v8-frontend-events/SKILL.md +12 -8
  67. package/skills/v8-frontend-events/references/bluetooth-print-api.md +31 -3
  68. package/skills/v8-frontend-events/references/bluetooth-print.md +54 -12
  69. package/skills/v8-http-integration/SKILL.md +1 -1
  70. package/skills/v8-image-processing/SKILL.md +1 -1
  71. package/skills/v8-menu-buttons/SKILL.md +1 -1
  72. package/skills/v8-mongodb/SKILL.md +1 -1
  73. package/skills/v8-mq-mqtt/SKILL.md +141 -53
  74. package/skills/v8-mq-mqtt/references/mqtt-production.md +341 -0
  75. package/skills/v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs +205 -0
  76. package/skills/v8-saas-multi-tenant/SKILL.md +1 -1
  77. package/skills/v8-security/SKILL.md +1 -1
  78. package/skills/v8-sql-query/SKILL.md +1 -1
  79. package/skills/v8-table-event/SKILL.md +1 -1
  80. package/skills/v8-template-engine/SKILL.md +1 -1
  81. package/skills/v8-utilities/SKILL.md +1 -1
  82. package/skills/v8-utilities/references/client-api-index.md +4 -2
  83. package/skills/v8-workflow/SKILL.md +1 -1
  84. package/skills/workspace-conventions/SKILL.md +8 -9
@@ -0,0 +1,205 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ const scriptDir = path.dirname(fileURLToPath(import.meta.url));
6
+ const workspaceRoot = path.resolve(scriptDir, '..', '..', '..');
7
+
8
+ const files = {
9
+ skill: 'microi.skills/v8-mq-mqtt/SKILL.md',
10
+ reference: 'microi.skills/v8-mq-mqtt/references/mqtt-production.md',
11
+ mqttDoc: 'microi.doc/docs/doc/system-engine/mqtt-engine.md',
12
+ v8Doc: 'microi.doc/docs/doc/v8-engine/v8-server.md',
13
+ runtime: 'Microi.Server/Microi.MQTT/MicroiMQTT.cs',
14
+ model: 'Microi.Server/Microi.Core/Model/MqttParam.cs',
15
+ mqttInterface: 'Microi.Server/Microi.Core/Interface/IMicroiMQTT.cs',
16
+ tenantSecurity: 'Microi.Server/Microi.Core/SaaSEngine/TenantConfigurationSecurity.cs',
17
+ controller: 'Microi.Server/Microi.net.Api/Controllers/MqttController.cs'
18
+ };
19
+
20
+ const content = {};
21
+ const failures = [];
22
+
23
+ for (const [name, relativePath] of Object.entries(files)) {
24
+ const absolutePath = path.join(workspaceRoot, relativePath);
25
+ if (!fs.existsSync(absolutePath)) {
26
+ failures.push(`${name}: 文件不存在 ${relativePath}`);
27
+ content[name] = '';
28
+ continue;
29
+ }
30
+ content[name] = fs.readFileSync(absolutePath, 'utf8');
31
+ }
32
+
33
+ function collectMatches(text, regex) {
34
+ const values = [];
35
+ for (const match of text.matchAll(regex)) values.push(match[1]);
36
+ return values;
37
+ }
38
+
39
+ function requireTokens(targetName, tokens) {
40
+ const text = content[targetName] || '';
41
+ for (const token of tokens) {
42
+ if (!text.includes(token)) failures.push(`${targetName}: 缺少 ${token}`);
43
+ }
44
+ }
45
+
46
+ function requireAny(targetName, alternatives, label) {
47
+ const text = content[targetName] || '';
48
+ if (!alternatives.some((token) => text.includes(token))) {
49
+ failures.push(`${targetName}: 缺少 ${label}`);
50
+ }
51
+ }
52
+
53
+ const runtimeEvents = new Set([
54
+ ...collectMatches(
55
+ content.runtime,
56
+ /RunMqttV8EngineAsync\([^,\r\n]+,\s*"([A-Za-z]+)"/g
57
+ ),
58
+ ...collectMatches(
59
+ content.runtime,
60
+ /FireV8EventForAllTenantsAsync\(\s*"([A-Za-z]+)"/g
61
+ )
62
+ ]);
63
+
64
+ const expectedEvents = [
65
+ 'StartServer',
66
+ 'Connected',
67
+ 'Disconnected',
68
+ 'Subscribing',
69
+ 'MessageReceived',
70
+ 'MessageChanged',
71
+ 'StopServer'
72
+ ];
73
+
74
+ for (const eventName of expectedEvents) {
75
+ if (!runtimeEvents.has(eventName)) failures.push(`runtime: 未提取到事件 ${eventName}`);
76
+ }
77
+
78
+ const mqttProperties = new Set(collectMatches(
79
+ content.model,
80
+ /public\s+[A-Za-z0-9_<>,.\s]+\s+([A-Za-z0-9_]+)\s*\{\s*get;\s*set;\s*\}/g
81
+ ));
82
+
83
+ const expectedProperties = [
84
+ 'ClientId',
85
+ 'Payload',
86
+ 'PayloadRaw',
87
+ 'Topic',
88
+ 'OsClient',
89
+ 'UserName',
90
+ 'Qos',
91
+ 'Retain',
92
+ 'UserProperties'
93
+ ];
94
+
95
+ for (const propertyName of expectedProperties) {
96
+ if (!mqttProperties.has(propertyName)) failures.push(`model: 未提取到属性 ${propertyName}`);
97
+ }
98
+
99
+ const sourceEvents = [...runtimeEvents].sort();
100
+ const sourceProperties = [...mqttProperties].sort();
101
+ for (const targetName of ['skill', 'reference', 'mqttDoc', 'v8Doc']) {
102
+ requireTokens(targetName, sourceEvents);
103
+ requireTokens(targetName, sourceProperties);
104
+ }
105
+
106
+ const configurationTokens = [
107
+ 'MqttEnable',
108
+ 'MqttPort',
109
+ 'MqttUseTls',
110
+ 'MqttTlsPort',
111
+ 'MqttCertPath',
112
+ 'MqttCertPassword',
113
+ 'MqttFallbackPort',
114
+ 'MqttWsPort',
115
+ 'MqttAccount',
116
+ 'MqttPwd',
117
+ 'MqttApiEngine',
118
+ 'MqttAllowAnonymous',
119
+ 'MqttTopicIsolation'
120
+ ];
121
+
122
+ const securityTokens = [
123
+ 'tenant/{lowerOsClient}',
124
+ '$SYS',
125
+ '$share',
126
+ 'ResponseTopic',
127
+ 'Code != 1',
128
+ 'StaleDisconnectIgnored'
129
+ ];
130
+
131
+ const operationsTokens = [
132
+ 'mci_mqtt_client',
133
+ 'mci_mqtt_log',
134
+ 'ApiEngineId',
135
+ 'IMicroiMQTT.PublishAsync',
136
+ 'ConnectedClients',
137
+ 'GetConnectedClients',
138
+ '外部 Broker',
139
+ '独立 MQTT 节点'
140
+ ];
141
+
142
+ requireTokens('skill', [
143
+ 'MqttEnable',
144
+ 'MqttPort',
145
+ 'MqttWsPort',
146
+ 'MqttAccount',
147
+ 'MqttPwd',
148
+ 'MqttApiEngine',
149
+ 'MqttAllowAnonymous',
150
+ 'MqttTopicIsolation'
151
+ ]);
152
+ requireTokens('reference', configurationTokens);
153
+
154
+ for (const targetName of ['skill', 'reference']) {
155
+ requireTokens(targetName, securityTokens);
156
+ requireTokens(targetName, operationsTokens);
157
+ }
158
+
159
+ requireTokens(
160
+ 'mqttDoc',
161
+ configurationTokens.filter((token) => token !== 'MqttAllowAnonymous')
162
+ );
163
+ requireAny(
164
+ 'mqttDoc',
165
+ ['MqttAllowAnonymous', '匿名连接只可能由主租户显式开启'],
166
+ '主租户匿名连接边界'
167
+ );
168
+ requireTokens(
169
+ 'mqttDoc',
170
+ securityTokens.filter(
171
+ (token) => token !== 'StaleDisconnectIgnored' && token !== 'tenant/{lowerOsClient}'
172
+ )
173
+ );
174
+ requireAny(
175
+ 'mqttDoc',
176
+ ['tenant/{lowerOsClient}', 'tenant/<lowerOsClient>'],
177
+ '标准租户 Topic 模板'
178
+ );
179
+ requireTokens('v8Doc', ['## V8.MQTT', 'IMicroiMQTT.PublishAsync', 'Code != 1']);
180
+
181
+ requireTokens('runtime', [
182
+ 'NormalizeTopic',
183
+ 'ResponseTopic',
184
+ 'StaleDisconnectIgnored',
185
+ '$share/',
186
+ '$SYS/',
187
+ 'mci_mqtt_client',
188
+ 'mci_mqtt_log',
189
+ 'PublishRejectedByV8'
190
+ ]);
191
+ requireTokens('mqttInterface', ['PublishAsync(string osClient', 'GetConnectedClients(string osClient)']);
192
+ requireTokens('tenantSecurity', ['NormalizeMqttTopic', 'HasTenantServiceCredentialCollision']);
193
+ requireTokens('controller', ['[PlatformAdminOnly]', 'StatusScope = "CurrentNode"']);
194
+
195
+ if (failures.length > 0) {
196
+ console.error('MQTT Skill 覆盖检查失败:');
197
+ for (const failure of failures) console.error(`- ${failure}`);
198
+ process.exitCode = 1;
199
+ } else {
200
+ console.log(
201
+ `MQTT Skill 覆盖检查通过:${sourceEvents.length} 个事件、` +
202
+ `${sourceProperties.length} 个 V8.MQTT 字段、` +
203
+ `${configurationTokens.length} 个配置项及生产安全/部署契约均已覆盖。`
204
+ );
205
+ }
@@ -3,7 +3,7 @@ name: v8-saas-multi-tenant
3
3
  description: Microi V8 SaaS 多租户指南。用于处理 OsClient、OsClientType、OsClientNetwork、租户配置、V8.OsClientModel、隔离和租户感知代码。
4
4
  ---
5
5
 
6
- > **Codex 强制前置:** 当前宿主为 Codex 时,在使用本 Skill 前必须先完整读取 `../microi-codex-installer/SKILL.md`,完成“Codex 每任务最新版硬门禁”;门禁未通过不得继续本 Skill。非 Codex 宿主跳过此项。
6
+ > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
7
 
8
8
  # Microi V8 SaaS 多租户引擎
9
9
 
@@ -3,7 +3,7 @@ name: v8-security
3
3
  description: Microi V8 安全指南。用于审查 DiyToken 与权限、可逆业务秘密、Passkey/TOTP/人脸步进验证、接口引擎安全、密钥管理、SQL 注入、匿名端点、文件上传和租户隔离。
4
4
  ---
5
5
 
6
- > **Codex 强制前置:** 当前宿主为 Codex 时,在使用本 Skill 前必须先完整读取 `../microi-codex-installer/SKILL.md`,完成“Codex 每任务最新版硬门禁”;门禁未通过不得继续本 Skill。非 Codex 宿主跳过此项。
6
+ > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
7
 
8
8
  # Microi V8 安全最佳实践
9
9
 
@@ -3,7 +3,7 @@ name: v8-sql-query
3
3
  description: Microi V8 安全 SQL 查询指南。用于选择 V8.FormEngine _Where 或 V8.Db.FromSql,处理参数化查询、联表、聚合并避免 SQL 注入。
4
4
  ---
5
5
 
6
- > **Codex 强制前置:** 当前宿主为 Codex 时,在使用本 Skill 前必须先完整读取 `../microi-codex-installer/SKILL.md`,完成“Codex 每任务最新版硬门禁”;门禁未通过不得继续本 Skill。非 Codex 宿主跳过此项。
6
+ > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
7
 
8
8
  # Microi V8 安全 SQL 查询
9
9
 
@@ -3,7 +3,7 @@ name: v8-table-event
3
3
  description: Microi V8 表单事件开发。用于编写 InFormV8、SubmitFormV8、SubmitBeforeServerV8、SubmitAfterServerV8、OutFormV8、DataFilterV8 和事务感知事件。
4
4
  ---
5
5
 
6
- > **Codex 强制前置:** 当前宿主为 Codex 时,在使用本 Skill 前必须先完整读取 `../microi-codex-installer/SKILL.md`,完成“Codex 每任务最新版硬门禁”;门禁未通过不得继续本 Skill。非 Codex 宿主跳过此项。
6
+ > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
7
 
8
8
  # Microi V8 表单事件开发
9
9
 
@@ -3,7 +3,7 @@ name: v8-template-engine
3
3
  description: Microi V8 模板引擎指南。用于编写表格/表单模板渲染、V8.Result HTML/text 输出、行格式化、徽章、图片和自定义显示逻辑。
4
4
  ---
5
5
 
6
- > **Codex 强制前置:** 当前宿主为 Codex 时,在使用本 Skill 前必须先完整读取 `../microi-codex-installer/SKILL.md`,完成“Codex 每任务最新版硬门禁”;门禁未通过不得继续本 Skill。非 Codex 宿主跳过此项。
6
+ > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
7
 
8
8
  # Microi V8 模板引擎(表格/表单 V8 模板)
9
9
 
@@ -3,7 +3,7 @@ name: v8-utilities
3
3
  description: Microi V8 全局对象、上下文变量和通用函数索引。用于查询某个 V8 函数是否存在、区分前端与后端 API,或使用 V8.Method、Base64、EncryptHelper、Action、CurrentUser、SysConfig、OsClient、扫码和客户端导航工具。
4
4
  ---
5
5
 
6
- > **Codex 强制前置:** 当前宿主为 Codex 时,在使用本 Skill 前必须先完整读取 `../microi-codex-installer/SKILL.md`,完成“Codex 每任务最新版硬门禁”;门禁未通过不得继续本 Skill。非 Codex 宿主跳过此项。
6
+ > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
7
 
8
8
  # Microi V8 通用能力与函数索引
9
9
 
@@ -114,7 +114,7 @@
114
114
  | `V8.AddSysLog(...)` | 前端发起系统日志记录;不得含秘密 |
115
115
  | `V8.SendSystemMessage(...)` | 发送站内系统消息 |
116
116
  | `await V8.Method.ScanCode()` | 扫码;成功值同时写入 `V8.ScanCodeRes` |
117
- | `V8.Print.*` | BLE 标签/小票打印,见蓝牙打印参考 |
117
+ | `V8.Print.*` | TSPL/CPCL/ESC-POS 蓝牙标签与小票打印,兼容 GP-M322、CC4,见蓝牙打印参考 |
118
118
  | `V8.Identity.GetCapabilities()` | 读取当前租户强身份能力和本人登记状态 |
119
119
  | `V8.Identity.CreateActionHash(value)` | 为稳定业务命令生成 SHA-256 摘要 |
120
120
  | `V8.Identity.RegisterPasskey(options?)` | 登记当前用户 Passkey |
@@ -124,11 +124,13 @@
124
124
  `V8.Identity` 是强身份验证模块。`V8.Identity.Verify` 的成功结果不能直接授权业务;后端必须重读权威数据、重算摘要并调用 `V8.Method.ConsumeIdentityVerificationTicket`。
125
125
  蓝牙打印完整 API 包含 `V8.Print.createNew`、`V8.Print.createNewESC`、
126
126
  `V8.Print.OpenBluetoothPage`、`V8.Print.isConnected`、
127
+ `V8.Print.reconnect`、`V8.Print.getConnectionState`、`V8.Print.subscribeConnection`、
128
+ `V8.Print.getPrinterProfile`、`V8.Print.setPrinterProfile`、
127
129
  `V8.Print.prepareSend`、`V8.Print.Send`、`V8.Print.setOneTimeData`、
128
130
  `V8.Print.setPrinterNum`、`V8.Print.disconnect` 和
129
131
  `V8.Print.BLEInformation`。其中 `Send` 依赖 `prepareSend` 设置的共享分包游标,
130
132
  只作内部状态机入口;业务代码必须调用并 `await prepareSend`。当前挂载范围、连接
131
- 真实性和串行约束见
133
+ 真实性、佳博原 TSPL 回归、CC4 CPCL 适配、Android SPP 与串行约束见
132
134
  [`bluetooth-print.md`](../../v8-frontend-events/references/bluetooth-print.md),TSC/ESC
133
135
  完整方法见
134
136
  [`bluetooth-print-api.md`](../../v8-frontend-events/references/bluetooth-print-api.md)。
@@ -3,7 +3,7 @@ name: v8-workflow
3
3
  description: Microi V8 工作流事件指南。用于编写审批流条件、节点 V8 代码、wf_flowdesign/wf_node/wf_line 逻辑、V8.WF 变量和工作流路由。
4
4
  ---
5
5
 
6
- > **Codex 强制前置:** 当前宿主为 Codex 时,在使用本 Skill 前必须先完整读取 `../microi-codex-installer/SKILL.md`,完成“Codex 每任务最新版硬门禁”;门禁未通过不得继续本 Skill。非 Codex 宿主跳过此项。
6
+ > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
7
 
8
8
  # Microi V8 工作流事件开发
9
9
 
@@ -14,15 +14,14 @@ AI 处理任何 Microi 低代码、V8、MCP、OpenClaw、采集引擎、前端
14
14
  - 涉及 V8 CRUD、SQL、上传下载、导入导出、菜单按钮、表单事件、前端页面或自动化测试时,继续读取对应专项 Skill。
15
15
  - 最终交付说明必须能逐条对应用户编号需求;不得遗漏、合并或把仍可执行的需求写成“下一步继续”。
16
16
 
17
- ### Codex 最新版与重新初始化门禁(强制)
18
-
19
- - Codex 在每个新建或已有对话中首次处理任一 Microi吾码任务时,只要当前会话能够读取任何吾码 Skill,就必须先完整读取 `microi-codex-installer`,并在业务分析、MCP 调用、源码修改、构建或发布前完成一次最新版门禁。不得因为上一个对话检查过、`microi codex status` 返回 `ok: true`,或 VS Code 已安装吾码插件而跳过。
20
- - 最新版只能以 npm 官方 registry 的在线结果为准:`npm view '@microi.net/cli' version --json --prefer-online --registry=https://registry.npmjs.org/`。`microi codex status` 只比较当前 CLI 内置快照与本机 Codex 插件,不能证明 npm 没有更新版本。
21
- - 门禁必须同时核对:官方最新版、当前 `microi` CLI 版本、`microi@microi-net` 的安装/启用/版本、当前工作区 AI bundle 版本,以及 MCP provider 的来源与版本。全局 CLI 已安装时不得保留旧版;Codex 插件、工作区 AI 配置或 MCP 低于官方最新版时也不得继续业务任务。
22
- - 只读查询不需要授权。需要安装或升级时,先向用户一次性说明将更新全局 `@microi.net/cli`、修改 Codex 全局 marketplace/插件、重新生成当前工作区 AI 配置并刷新 MCP;用户明确要求“安装、升级、更新、初始化吾码”时视为已经授权这些对应操作,否则必须取得一次明确同意。
23
- - 获得授权后必须使用最新版 CLI 完整执行:`npm install --global @microi.net/cli@latest`、`microi codex install --yes`、`microi ai init --workspace "<工作区绝对路径>" --json`、`microi doctor --workspace "<工作区绝对路径>" --json`、`microi codex status --json`。`ai init` 默认包含 MCP 更新,禁止在此流程使用 `--no-mcp`;若诊断仍显示旧版或 `legacy` provider,继续修复到版本一致后再验收。
24
- - Codex 插件发生安装或升级后,当前任务通常不能热加载新 Skills/MCP。必须提示并要求新建 Codex 任务或重载 Codex,重载后的新任务再次通过最新版门禁后才继续;不得在旧任务中声称新版能力已经生效。
25
- - npm 官方 registry 无法访问、版本无法解析、用户拒绝必要授权、安装失败或重载尚未完成时,必须明确报告门禁未通过;在能够证明最新版前,不得继续 Microi 远端写入、源码实现、构建或发布,也不得改用第三方 registry、缓存结果或旧 CLI 冒充最新版。
17
+ ### Microi吾码非阻塞自动更新(强制)
18
+
19
+ - VS Code 扩展、`@microi.net/cli` 与 Codex 插件默认自动检查和安装更新。任一 Microi 任务开始时可后台投递 `microi update --background --workspace "<工作区绝对路径>" --json`,但不得等待它完成才开始业务分析、MCP 调用、源码修改、构建或发布。
20
+ - CLI 最新版只从 npm 官方 registry 查询:`npm view '@microi.net/cli' version --json --prefer-online --registry=https://registry.npmjs.org/`;VS Code 扩展只使用官方扩展宿主的自动更新/安装命令。不得使用第三方 registry 或不明镜像冒充官方更新。
21
+ - 后台更新完整闭环包含全局 CLI、`microi@microi-net`、`microi ai init`、`microi doctor` `microi codex status`。`codex install --yes` `--yes` 只兼容旧脚本,不是用户继续工作的授权开关。
22
+ - 当前运行中的 VS Code Extension Host、CLI、Codex Router、MCP 和对话继续使用已加载版本。禁止为了更新终止进程、强制重载、要求立即新建任务或拒绝新工作;新版只在后续新进程或宿主自然重启时接管。
23
+ - npm 官方 registry 无法访问、权限不足、文件被运行中进程占用、安装失败或宿主不能热更新时,必须写入可诊断状态并延后重试。可以非模态提示“立即重试/查看日志”,但用户忽略、关闭或暂不处理时,当前、正在进行和新建的 Microi 工作仍必须继续。
24
+ - 只有任务明确依赖旧版本不存在的具体能力时,才准确说明该能力边界与可用降级方案;不得用“最新版未通过”“尚未授权升级”作为整项任务的失败理由。
26
25
 
27
26
  ## Microi吾码工作进度播报规范(强制)
28
27