@microi.net/cli 5.6.0 → 5.6.1
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/.codebuddy-plugin/marketplace.json +2 -2
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/.workbuddy-plugin/marketplace.json +2 -2
- package/.workbuddy-plugin/plugin.json +1 -1
- package/README.md +71 -71
- package/assets/build-meta.json +7 -7
- package/assets/feature-matrix.json +129 -129
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
- package/scripts/codex-marketplace.json +20 -20
- package/scripts/mcp-codex-stdio-adapter.js +189 -189
- package/scripts/mcp-server.js +99 -99
- package/scripts/mcp-trae-windows-launcher.cmd +21 -21
- package/scripts/microi-cli-mcp.js +7 -7
- package/scripts/microi-cli.js +39 -36
- package/scripts/microi-codex-broker.js +447 -447
- package/scripts/microi-codex-router.js +582 -582
- package/scripts/microi-skills.meta.json +225 -222
- package/skills/.microi-skills-version.json +2 -2
- package/skills/.progressive-disclosure-manifest.json +37 -37
- package/skills/README.md +1 -1
- package/skills/app-store/SKILL.md +199 -182
- package/skills/dos-orm/SKILL.md +96 -81
- package/skills/message-notification/SKILL.md +152 -126
- package/skills/microi-client-frontend/SKILL.md +11 -5
- package/skills/microi-client-frontend/references/progressive-01-3-/345/212/250/346/200/201/346/214/211/351/222/256/347/263/273/347/273/237.md +2 -2
- package/skills/microi-client-frontend/references/progressive-02-8-/350/277/220/350/241/214/346/227/266/351/253/230/351/242/221/345/235/221/345/244/215/347/233/230.md +2 -2
- package/skills/microi-client-frontend/references/progressive-03-vue3-/345/211/215/347/253/257/345/276/256/346/234/215/345/212/241/345/256/277/344/270/273/350/247/204/345/210/231.md +2 -2
- package/skills/microi-codex/SKILL.md +48 -46
- package/skills/microi-docs-coverage/SKILL.md +133 -123
- package/skills/microi-docs-coverage/references/capability-map.md +2 -2
- package/skills/microi-form-engine/SKILL.md +77 -53
- package/skills/microi-microservice/SKILL.md +17 -16
- package/skills/microi-sso/SKILL.md +91 -85
- package/skills/microi-system-delivery/SKILL.md +5 -4
- package/skills/microi-system-delivery/references/progressive-02-/350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/345/277/205/351/241/273/350/246/206/347/233/226/347/232/204/345/235/221.md +27 -22
- package/skills/module-engine/SKILL.md +17 -1
- package/skills/print-engine/SKILL.md +47 -39
- package/skills/scripts/sync-embedded-skills.mjs +46 -0
- package/skills/scripts/validate-progressive-disclosure.mjs +57 -52
- package/skills/system-observability/SKILL.md +16 -4
- package/skills/v8-api-config/SKILL.md +382 -378
- package/skills/v8-file-upload/SKILL.md +157 -154
- package/skills/v8-file-upload/references/progressive-01-/345/205/254/346/234/211/346/241/266-vs-/347/247/201/346/234/211/346/241/266.md +133 -133
- package/skills/v8-formengine-http/SKILL.md +19 -1
- package/skills/v8-security/SKILL.md +25 -25
- package/skills/v8-sql-query/SKILL.md +130 -128
- package/skills/v8-table-event/SKILL.md +29 -22
- package/skills/v8-table-event/references/progressive-01-informv8-js-/350/241/250/345/215/225/346/211/223/345/274/200/344/272/213/344/273/266.md +19 -19
- package/skills/v8-workflow/SKILL.md +54 -45
- package/skills/workspace-conventions/SKILL.md +259 -236
- package/skills/workspace-conventions/references/progressive-01-/347/211/210/346/234/254/346/233/264/346/226/260/346/227/245/345/277/227/344/277/235/346/212/244/350/247/204/345/210/231-/345/274/272/345/210/266.md +208 -208
|
@@ -1,52 +1,57 @@
|
|
|
1
|
-
import crypto from 'node:crypto'
|
|
2
|
-
import fs from 'node:fs'
|
|
3
|
-
import path from 'node:path'
|
|
4
|
-
import { fileURLToPath } from 'node:url'
|
|
5
|
-
|
|
6
|
-
const skillsRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
7
|
-
const manifest = JSON.parse(fs.readFileSync(path.join(skillsRoot, '.progressive-disclosure-manifest.json'), 'utf8'))
|
|
8
|
-
const hash = (value) => crypto.createHash('sha256').update(value).digest('hex')
|
|
9
|
-
const lineCount = (value) => value.length === 0 ? 0 : value.split(/\r?\n/).length
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
throw new Error(`${skillName}:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
import crypto from 'node:crypto'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
|
|
6
|
+
const skillsRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
7
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(skillsRoot, '.progressive-disclosure-manifest.json'), 'utf8'))
|
|
8
|
+
const hash = (value) => crypto.createHash('sha256').update(value).digest('hex')
|
|
9
|
+
const lineCount = (value) => value.length === 0 ? 0 : value.split(/\r?\n/).length
|
|
10
|
+
|
|
11
|
+
// 可只验证显式修改的 Skill;默认仍检查全库,不能为并行工作区的历史漂移改写共同基线。
|
|
12
|
+
const requested = process.argv.slice(2)
|
|
13
|
+
for (const name of requested) {
|
|
14
|
+
if (!Object.hasOwn(manifest.skills, name)) throw new Error(`Unknown progressive-disclosure skill: ${name}`)
|
|
15
|
+
}
|
|
16
|
+
const selected = Object.entries(manifest.skills).filter(([name]) => requested.length === 0 || requested.includes(name))
|
|
17
|
+
let checkedChunks = 0
|
|
18
|
+
for (const [skillName, skill] of selected) {
|
|
19
|
+
const entryPath = path.join(skillsRoot, skillName, 'SKILL.md')
|
|
20
|
+
const entry = fs.readFileSync(entryPath, 'utf8')
|
|
21
|
+
const begin = entry.indexOf('<!-- microi-progressive:begin -->')
|
|
22
|
+
if (begin < 0) throw new Error(`${skillName}: missing progressive begin marker`)
|
|
23
|
+
const prefix = entry.slice(0, begin)
|
|
24
|
+
if (hash(prefix) !== skill.prefixSha256) throw new Error(`${skillName}: entry prefix changed`)
|
|
25
|
+
if (lineCount(entry) > manifest.policy.maxEntryLines) throw new Error(`${skillName}: entry exceeds line budget`)
|
|
26
|
+
|
|
27
|
+
const sources = new Map([[`${skillName}/SKILL.md`, entry]])
|
|
28
|
+
for (const reference of skill.references) {
|
|
29
|
+
const relative = `${skillName}/${reference.path}`
|
|
30
|
+
const content = fs.readFileSync(path.join(skillsRoot, relative), 'utf8')
|
|
31
|
+
if (lineCount(content) > 300) throw new Error(`${relative}: reference exceeds 300 lines`)
|
|
32
|
+
sources.set(relative, content)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const ordered = []
|
|
36
|
+
for (const chunk of skill.chunks) {
|
|
37
|
+
const source = sources.get(chunk.destination)
|
|
38
|
+
if (source == null) throw new Error(`${skillName}: missing ${chunk.destination}`)
|
|
39
|
+
const open = `<!-- microi-progressive:chunk id=${chunk.id} sha256=${chunk.sha256} -->`
|
|
40
|
+
const startMarker = source.indexOf(open)
|
|
41
|
+
if (startMarker < 0) throw new Error(`${skillName}: missing chunk ${chunk.id}`)
|
|
42
|
+
const contentStart = startMarker + open.length + (source.startsWith('\r\n', startMarker + open.length) ? 2 : 1)
|
|
43
|
+
const close = '<!-- /microi-progressive:chunk -->'
|
|
44
|
+
const contentEnd = source.indexOf(close, contentStart)
|
|
45
|
+
if (contentEnd < 0) throw new Error(`${skillName}: unterminated chunk ${chunk.id}`)
|
|
46
|
+
const raw = source.slice(contentStart, contentEnd)
|
|
47
|
+
if (hash(raw) !== chunk.sha256) throw new Error(`${skillName}: chunk ${chunk.id} changed`)
|
|
48
|
+
ordered[chunk.ordinal] = raw
|
|
49
|
+
checkedChunks += 1
|
|
50
|
+
}
|
|
51
|
+
const reconstructed = prefix + ordered.join('')
|
|
52
|
+
if (hash(reconstructed) !== skill.originalSha256) {
|
|
53
|
+
throw new Error(`${skillName}: reconstructed knowledge differs from original`)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
console.log(`Validated ${selected.length} skills and ${checkedChunks} lossless chunks${requested.length ? ' (explicit scope)' : ''}.`)
|
|
@@ -15,16 +15,28 @@ description: Microi 系统日志/监控查询、诊断与治理规范。用于
|
|
|
15
15
|
|---|---|
|
|
16
16
|
| 人工排查、看趋势、打开日志详情 | 平台菜单【系统日志/监控】 |
|
|
17
17
|
| AI 查询、自动诊断、验收 | MCP `microi_query_system_observability` |
|
|
18
|
-
| AI 封禁或解封 IP | MCP `microi_manage_system_observability` |
|
|
18
|
+
| AI 封禁或解封 IP | MCP `microi_manage_system_observability` |
|
|
19
|
+
| 连接池耗尽时在线诊断/恢复 | 查询 `DatabasePools / DatabasePoolRecovery`,治理 `ResetDatabasePools` |
|
|
19
20
|
| 应用页面读取 | Managed 接口引擎 `mci-system-observability-query` |
|
|
20
21
|
| 应用页面治理 | Managed 接口引擎 `mci-system-observability-action` |
|
|
21
22
|
| 扩展宿主、进程、Mongo 或安全底层原子能力 | `V8.Method.GetSystemObservability` / `V8.Method.ManageSystemObservability` |
|
|
22
23
|
|
|
23
24
|
AI 第一次使用时先查询 `action=Capabilities`,再按返回的动作、权限和边界选择查询。优先使用专用工具,它已经限制动作、参数、分页、确认和审计。旧进程缺少新 Memory 动作时,仅允许通过标准 `microi_run_engine` 临时只读执行固定查询引擎;完整版本排查与降级边界见 [内存事故排查手册](references/memory-incident-triage.md)。不得创建临时维护引擎或绕过后端权限。
|
|
24
25
|
|
|
25
|
-
## 查询动作
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
## 查询动作
|
|
27
|
+
|
|
28
|
+
### 连接池故障应急入口
|
|
29
|
+
|
|
30
|
+
- 收到 `obtaining a connection from the pool` 时,直接用 `microi_query_system_observability(action=DatabasePools,poolTarget=Both)`;故障池可能阻塞普通 `Capabilities` 或 Managed 引擎,此动作走固定 `/api/Diagnostics/database-pools` 应急协议。要求后端支持 `database-pools/v1`,只更新 MCP 不能安装后端。
|
|
31
|
+
- `microi_manage_system_observability(action=ResetDatabasePools,poolTarget=Both)` 无确认值时只预览。执行必须带同一预览的 `operationId`、`poolIds`、`poolTarget` 和 `confirmExecution=ResetDatabasePools:<operationId>`。预览票据 2 分钟有效;执行前仍复核配置摘要。
|
|
32
|
+
- 请求超时或响应未知,使用查询动作 `DatabasePoolRecovery` 与原 `operationId` 回读,禁止换编号重试。每租户 60 秒冷却;命令期限 90 秒;回执保留 10 分钟,过期编号不能重新执行。
|
|
33
|
+
- 回执逐节点区分 `Pending / Incomplete / PartialFailure / CompletedForRegisteredNodes`。只有最后一项证明已注册节点完成;未升级节点不在覆盖范围,最后还需验证原故障只读接口。不得把当前节点探测成功说成全站恢复。
|
|
34
|
+
- 支持当前租户 MySQL/SQL Server 主、读池;`Both / Write / Read`,相同池去重。已加载的其它租户共享池时拒绝;扩展库和其它驱动明确不支持。池上限、驱动版本、退避和失败码可读,`Opening` 不等于驱动借出数。
|
|
35
|
+
- 服务继续验证 DiyToken、Redis 有效会话和主库管理员;访问密钥需要 `mcp:admin`。仅鉴权使用有界无池连接,每节点应急请求最多 2 个、连接和命令超时各 5 秒;修复后的探测使用原业务池。不得创建匿名维护引擎或另设万能密码。
|
|
36
|
+
- 不杀事务、不全局清池、不重放 SQL、不自动放大池上限,不以重启数据库/API 作为默认恢复。无有效会话、Redis/主库不可用或内存保护触发时不能绕过防护。持续泄漏、慢 SQL、容量与网络故障仍需定位根因。
|
|
37
|
+
- 此功能属框架运行时应急协议,不新增表/菜单/引擎,不需要发布商城资源;责任同步为 Core/Dos.ORM、MCP、本文档与内嵌知识。验收必须覆盖真实池耗尽、HTTP 撤权/失效会话、两个独立进程、幂等重试、配置漂移与事务存活。
|
|
38
|
+
|
|
39
|
+
`microi_query_system_observability` 支持:
|
|
28
40
|
|
|
29
41
|
| action | 用途 | 关键参数 |
|
|
30
42
|
|---|---|---|
|