@yottameta/yotta-skills-plugin 0.19.16 → 0.19.18

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.
@@ -0,0 +1,93 @@
1
+ 'use strict';
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const trusted = require('./trusted-verifier');
5
+
6
+ const SAFE = 'SAFE TO INSTALL';
7
+ const CAUTION = 'INSTALL WITH CAUTION';
8
+ const REVIEW = 'REVIEW REQUIRED';
9
+ const BLOCK = 'DO NOT INSTALL';
10
+
11
+ /** 用户显式指定的引擎(人工可信,不做身份判定)。 */
12
+ function explicitCandidates(opts) {
13
+ const candidates = [];
14
+ if (opts && opts.verify) candidates.push(path.resolve(opts.verify));
15
+ if (process.env.YOTTA_SKILLS_VERIFY) candidates.push(path.resolve(process.env.YOTTA_SKILLS_VERIFY));
16
+ return candidates;
17
+ }
18
+
19
+ /**
20
+ * 定位元信扫描引擎(v0.19.13 收紧)。
21
+ *
22
+ * 旧实现会读本地注册表里 slug=yotta-verify 的 source_dirs,而注册表身份来自被扫描技能
23
+ * 自己 SKILL.md frontmatter 的 name —— 伪造目录即可劫持校验器(执行任意代码 + 伪造
24
+ * SAFE 结论)。现只认两类来源:
25
+ * ① 用户显式指定:--verify / YOTTA_SKILLS_VERIFY;
26
+ * ② 安装管线写入的受信记录:包身份(slug / package / trust / 版本)+ 路径 realpath
27
+ * + 引擎 SHA-256 与记录一致。
28
+ * 其余一律返回 null(fail-closed),由上层走自举安装。
29
+ */
30
+ function findVerifier(context) {
31
+ const ctx = context || {};
32
+ for (const candidate of explicitCandidates(ctx.opts || {})) {
33
+ try {
34
+ if (fs.statSync(candidate).isFile()) return candidate;
35
+ } catch (_) {
36
+ // Try the next candidate.
37
+ }
38
+ }
39
+ const record = ctx.trustedVerifier;
40
+ if (record && record.path) {
41
+ const check = trusted.verifyEngine(record.path, { record });
42
+ if (check.ok) return check.path;
43
+ }
44
+ return null;
45
+ }
46
+
47
+ function parseScanOutput(stdout) {
48
+ try {
49
+ const value = JSON.parse(String(stdout || ''));
50
+ if (!value || typeof value.verdict !== 'string') {
51
+ return { ok: false, verdict: null, counts: null, error: '扫描输出缺少 verdict' };
52
+ }
53
+ return { ok: true, verdict: value.verdict, counts: value.counts || {}, error: null };
54
+ } catch (error) {
55
+ return { ok: false, verdict: null, counts: null, error: error.message };
56
+ }
57
+ }
58
+
59
+ function evaluateVerdict(verdict) {
60
+ if (verdict === SAFE) return { decision: 'allow', block: false, warn: false };
61
+ if (verdict === CAUTION || verdict === REVIEW) return { decision: 'warn', block: false, warn: true };
62
+ return { decision: 'block', block: true, warn: true };
63
+ }
64
+
65
+ function runVerifier(engine, target, options) {
66
+ const result = options.spawnSync(options.python, ['-B', engine, 'scan', target, '--json'], {
67
+ encoding: 'utf8',
68
+ timeout: 60000,
69
+ });
70
+ if (result && result.error) {
71
+ return { ok: false, verdict: null, counts: null, error: result.error.message, exitCode: null };
72
+ }
73
+ if (!result || result.status === null) {
74
+ return { ok: false, verdict: null, counts: null, error: '元信 scan 执行失败', exitCode: null };
75
+ }
76
+ const parsed = parseScanOutput(result.stdout);
77
+ if (!parsed.ok) {
78
+ return { ok: false, verdict: null, counts: null, error: parsed.error, exitCode: result.status };
79
+ }
80
+ return { ok: true, verdict: parsed.verdict, counts: parsed.counts, error: null, exitCode: result.status };
81
+ }
82
+
83
+ module.exports = {
84
+ SAFE,
85
+ CAUTION,
86
+ REVIEW,
87
+ BLOCK,
88
+ explicitCandidates,
89
+ findVerifier,
90
+ parseScanOutput,
91
+ evaluateVerdict,
92
+ runVerifier,
93
+ };
@@ -1,14 +1,14 @@
1
1
  # 全家技能清单(22 个)
2
2
 
3
3
  > 机器权威源:`skills.json`(随包分发);本文件为人工可读副本,新技能发布后须同步更新
4
- > `skills.json`(登记表为内部台账,不随包分发)。清单更新日期:2026-09-22。
4
+ > `skills.json`(登记表为内部台账,不随包分发)。清单更新日期:2026-09-23。
5
5
 
6
6
  | slug | 中文名 | npm 包 | 清单版本 | 说明 |
7
7
  |---|---|---|---|---|
8
8
  | `yotta-anti-shallow` | 元谨 | `@yottameta/yotta-anti-shallow` | 1.4.0 | 防 AI 敷衍规则引擎(深入分析/根因追溯时激活) |
9
9
  | `yotta-code-quality` | 元质 | `@yottameta/yotta-code-quality` | 0.4.1 | 结对式代码质量评审(十二类腐化风险 + 0-100 健康分) |
10
10
  | `yotta-workflow` | 元序 | `@yottameta/yotta-workflow` | 0.4.1 | 跨会话/跨项目通用工作流协议(状态就近存) |
11
- | `yotta-memory` | 元忆 | `@yottameta/yotta-memory` | 0.16.4 | 有权限边界的文件式智能体记忆(FACT/PREF/BOUND/COMMIT) |
11
+ | `yotta-memory` | 元忆 | `@yottameta/yotta-memory` | 0.16.6 | 有权限边界的文件式智能体记忆(FACT/PREF/BOUND/COMMIT) |
12
12
  | `yotta-learn` | 元习 | `@yottameta/yotta-learn` | 0.2.1 | 学习沉淀 CLI:错误/纠正/洞见沉淀为 .learnings/ 条目 |
13
13
  | `yotta-security-audit` | 元安 | `@yottameta/yotta-security-audit` | 0.2.4 | 安全扫描引擎:13 类检测器 + 系统安全基线 |
14
14
  | `yotta-vetter` | 元审 | `@yottameta/yotta-vetter` | 0.2.5 | 安全审查协议:四阶段 review + SAFE TO INSTALL 判定 |
@@ -26,7 +26,7 @@ import subprocess
26
26
  import sys
27
27
  from pathlib import Path
28
28
 
29
- VERSION = "0.19.16"
29
+ VERSION = "0.19.18"
30
30
  TOOL_NAME = "yotta-skills"
31
31
  CN_NAME = "元阁"
32
32
  MCP_PROTOCOL_MODERN = "2026-07-28"
@@ -0,0 +1,161 @@
1
+ {
2
+ "manifestVersion": 1,
3
+ "updated": "2026-09-23",
4
+ "note": "清单同步要求:每次技能发布新版本后,按 YottaSkills 技能登记表更新本文件(登记表为内部台账,不随包分发)。",
5
+ "skills": [
6
+ {
7
+ "slug": "yotta-anti-shallow",
8
+ "name": "元谨",
9
+ "pkg": "@yottameta/yotta-anti-shallow",
10
+ "version": "1.4.0",
11
+ "desc": "防 AI 敷衍规则引擎(深入分析/根因追溯时激活)"
12
+ },
13
+ {
14
+ "slug": "yotta-code-quality",
15
+ "name": "元质",
16
+ "pkg": "@yottameta/yotta-code-quality",
17
+ "version": "0.4.1",
18
+ "desc": "结对式代码质量评审(十二类腐化风险 + 0-100 健康分)"
19
+ },
20
+ {
21
+ "slug": "yotta-workflow",
22
+ "name": "元序",
23
+ "pkg": "@yottameta/yotta-workflow",
24
+ "version": "0.4.1",
25
+ "desc": "跨会话/跨项目通用工作流协议(状态就近存)"
26
+ },
27
+ {
28
+ "slug": "yotta-memory",
29
+ "name": "元忆",
30
+ "pkg": "@yottameta/yotta-memory",
31
+ "version": "0.16.6",
32
+ "desc": "有权限边界的文件式智能体记忆(FACT/PREF/BOUND/COMMIT)"
33
+ },
34
+ {
35
+ "slug": "yotta-learn",
36
+ "name": "元习",
37
+ "pkg": "@yottameta/yotta-learn",
38
+ "version": "0.2.1",
39
+ "desc": "学习沉淀 CLI:错误/纠正/洞见沉淀为 .learnings/ 条目"
40
+ },
41
+ {
42
+ "slug": "yotta-security-audit",
43
+ "name": "元安",
44
+ "pkg": "@yottameta/yotta-security-audit",
45
+ "version": "0.2.4",
46
+ "desc": "安全扫描引擎:13 类检测器 + 系统安全基线"
47
+ },
48
+ {
49
+ "slug": "yotta-vetter",
50
+ "name": "元审",
51
+ "pkg": "@yottameta/yotta-vetter",
52
+ "version": "0.2.5",
53
+ "desc": "安全审查协议:四阶段 review + SAFE TO INSTALL 判定"
54
+ },
55
+ {
56
+ "slug": "yotta-recon",
57
+ "name": "元析",
58
+ "pkg": "@yottameta/yotta-recon",
59
+ "version": "0.1.7",
60
+ "desc": "跨智能体网络侦察:零依赖端口/服务/版本指纹探测"
61
+ },
62
+ {
63
+ "slug": "yotta-guardian",
64
+ "name": "元盾",
65
+ "pkg": "@yottameta/yotta-guardian",
66
+ "version": "0.1.5",
67
+ "desc": "跨智能体危险调用拦截护栏:确定性规则 + 可插拔意图验证"
68
+ },
69
+ {
70
+ "slug": "yotta-humanize",
71
+ "name": "元真",
72
+ "pkg": "@yottameta/yotta-humanize",
73
+ "version": "0.2.1",
74
+ "desc": "去 AI 味中文写作编辑:检测器引擎"
75
+ },
76
+ {
77
+ "slug": "yotta-logs",
78
+ "name": "元史",
79
+ "pkg": "@yottameta/yotta-logs",
80
+ "version": "0.3.1",
81
+ "desc": "跨智能体历史会话 / 记忆日志检索"
82
+ },
83
+ {
84
+ "slug": "yotta-security-testing",
85
+ "name": "元测",
86
+ "pkg": "@yottameta/yotta-security-testing",
87
+ "version": "0.3.1",
88
+ "desc": "有纪律的 AI 安全测试方法论 + Scope Guard 五道防线"
89
+ },
90
+ {
91
+ "slug": "yotta-agent-hardening",
92
+ "name": "元安全",
93
+ "pkg": "@yottameta/yotta-agent-hardening",
94
+ "version": "0.2.6",
95
+ "desc": "防御向 AI 智能体自身安全加固(配置面静态扫描三域)"
96
+ },
97
+ {
98
+ "slug": "yotta-skill-creator",
99
+ "name": "元造",
100
+ "pkg": "@yottameta/yotta-skill-creator",
101
+ "version": "0.1.2",
102
+ "desc": "工坊「造」:端到端造技能脚手架"
103
+ },
104
+ {
105
+ "slug": "yotta-publish-guard",
106
+ "name": "元守",
107
+ "pkg": "@yottameta/yotta-publish-guard",
108
+ "version": "0.4.2",
109
+ "desc": "工坊「守」:发布前守门(版本四件对齐 + 三通道查重)"
110
+ },
111
+ {
112
+ "slug": "yotta-logwatch",
113
+ "name": "元察",
114
+ "pkg": "@yottameta/yotta-logwatch",
115
+ "version": "0.2.9",
116
+ "desc": "安全日志分析检测引擎(攻击链识别/告警聚合)"
117
+ },
118
+ {
119
+ "slug": "yotta-intel",
120
+ "name": "元情",
121
+ "pkg": "@yottameta/yotta-intel",
122
+ "version": "0.2.0",
123
+ "desc": "威胁情报 IOC 提取与规范化引擎(STIX-lite)"
124
+ },
125
+ {
126
+ "slug": "yotta-secret",
127
+ "name": "元钥",
128
+ "pkg": "@yottameta/yotta-secret",
129
+ "version": "0.2.0",
130
+ "desc": "密钥 / 凭据泄露源头扫描引擎"
131
+ },
132
+ {
133
+ "slug": "yotta-chain",
134
+ "name": "元链",
135
+ "pkg": "@yottameta/yotta-chain",
136
+ "version": "0.1.4",
137
+ "desc": "供应链依赖校验引擎"
138
+ },
139
+ {
140
+ "slug": "yotta-triage",
141
+ "name": "元鉴",
142
+ "pkg": "@yottameta/yotta-triage",
143
+ "version": "0.1.3",
144
+ "desc": "恶意样本静态初筛引擎(哈希/熵/字符串/PE-ELF)"
145
+ },
146
+ {
147
+ "slug": "yotta-prompt",
148
+ "name": "元引",
149
+ "pkg": "@yottameta/yotta-prompt",
150
+ "version": "0.2.2",
151
+ "desc": "意图澄清 + 生态入口(常驻注入,map 串联元阁全家)"
152
+ },
153
+ {
154
+ "slug": "yotta-verify",
155
+ "name": "元信",
156
+ "pkg": "@yottameta/yotta-verify",
157
+ "version": "0.3.2",
158
+ "desc": "装前安全扫描器 + audited 徽章(prompt injection + 危险模式)"
159
+ }
160
+ ]
161
+ }