@yottameta/yotta-skills 0.23.0 → 0.23.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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## v0.23.2 (2026-10-01)
2
+
3
+ - 修复家族安装管线嵌套载荷丢失:复制原语的顶层跳过名单(`package.json` / `bin` / `node_modules` / `.git`)此前按条目名逐层生效,会把技能包内嵌套的同名载荷(如元造 `template/package.json`、`template/bin/install.js`)一并跳过——家族安装 / 更新元造后,其脚手架自检会失败(缺必需文件)。现改为仅顶层生效,与元造 0.1.3 的安装器修复对齐。
4
+ - 新增 `lib/copy-tree.js`(单一复制原语)与回归测试:顶层同名跳过、嵌套同名保留、缓存类(`__pycache__` / `.pytest_cache` / `.mypy_cache` / `*.pyc` / `*.pyo`)任意层级清理;家族管线集成回归同步补齐。
5
+ - 清单同步:`skills.json` / `references/skill-list.md` 更新元造 0.1.4、元案 0.1.1。
6
+
7
+ ## v0.23.1 (2026-10-01)
8
+
9
+ - 文档:环境变量表补齐 `YOTTA_SKILLS_REGISTRY_FILE` / `YOTTA_SKILLS_USAGE_FILE` / `YOTTA_PROVIDER_HOME` 三项,并新增「隔离环境:三个状态文件成组导出」小节(bash / PowerShell 示例)——测试、CI 与多 agent 场景需三件成组导出,避免读写宿主真实状态。
10
+ - 行为零变更:安装 / 更新 / 路由 / hook / MCP 契约不变。
11
+
1
12
  ## v0.23.0 (2026-10-01)
2
13
 
3
14
  - O1 动态路由 MVP:`--route` / MCP `route_request` 在静态 playbook 之上,可选调用本地 provider(capability `o1.route`)做确定性组合排序;新增 `confidence` / `reasons` / `summary` / `alternatives` 输出。
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: yotta-skills
3
- version: 0.23.0
3
+ version: 0.23.2
4
4
  description: 元阁 -- 元阁全家技能的总编排策划 + 编排路由 + 一键安装器 + 技能盘点 + 运行时 hook 适配。路由层:--route / route_request 按需求摘要给出候选组合、调用顺序、角色、置信度、依据、已装/缺失状态与安装命令,只建议不自动安装;非元阁家族已装技能按 frontmatter description 机械匹配作并列候选(标注来源与未扫描状态,只读不自动调用);M1 记忆裁决层:usage enable/mark 本地结构化记录 + decide-memory / MCP decide_memory 输出 promote / hold / demote 只读建议(需授权 provider;只建议不删除、不自动写元忆);策划层:按场景给出「该组合哪几个元技能、组合强在哪、怎么组合使用(安装与调用均由用户确认后执行)」;安装层:一条命令把 YottaMeta 已发布的全部 yotta-* 技能装进指定智能体或目录(默认 --pin 锁死清单精确版本);盘点层:--inventory / --reindex 扫描本机已装技能生成/更新注册表,新装技能自动被发现(install/update 后自动 re-index,会话开工只建议跑本地 --reindex;更新检查走手动 --check 或后台 --check --scheduled);运行时适配层:hook capabilities / evaluate / bind / unbind 按宿主能力矩阵执行六个统一事件并留证降级,元信 before_install 已接入安装管线;自包含零依赖,不依赖任何元技能;MCP 按需加载且需用户确认后写入配置(可选:list_installed_skills/describe_skill/reindex/route_request/decide_memory,不常驻,未加载降级 CLI)。支持 --list 清单 / --route 路由 / usage 使用记录 / decide-memory 记忆裁决 / install / update / update --check(只读检查)/ update --check --scheduled(后台周检)/ update --auto(家族自动更新)/ hook 适配 / --inventory / --reindex / --dry-run 预览 / --pin(默认)/ --range。触发:需要批量安装或更新元阁全家技能、按场景组合多个元技能、路由或判断该用哪些技能、判断哪些技能值得长期记忆、查看或记录技能使用信号、盘点或查看本机已装技能、重扫技能注册表、给某个智能体或目录一次性铺齐 yotta-* 技能、评估宿主 hook 能力、预览安装清单、锁版本安装、或用户说 元阁/装全家/一次装齐/yotta-skills/install-all/更新全家/检查更新/自动更新/hook 适配/该用哪个技能/路由技能/记忆裁决/技能该不该记住/盘点技能/查看已装技能 等。边界(Do NOT trigger):只做「组合策划 + 静态路由建议 + M1 记忆裁决只读建议 + 清单 + 下载 + 落位 + 汇总 + 盘点 + re-index + hook 适配」,不含技能本体、不做技能内容开发、不 -g 污染全局、不自动安装缺失技能、不静默写宿主配置或全局记忆、不自动删除技能或记忆;家族安装先自举或调用元信装前门禁,DO NOT INSTALL 阻断,非元阁家族包不自动安装。
5
5
  license: MIT
6
6
  metadata:
@@ -417,6 +417,29 @@ npx -y @yottameta/yotta-skills usage reset --yes
417
417
  | `YOTTA_SKILLS_PYTHON` | 指定 python 可执行文件(元信 scan 用,同 `--python`) |
418
418
  | `YOTTA_SKILLS_VERIFY` | 指定 yotta_verify.py 路径(同 `--verify`) |
419
419
  | `YOTTA_SKILLS_MANIFEST` | 指定技能清单 JSON 路径(默认随包 skills.json) |
420
+ | `YOTTA_SKILLS_REGISTRY_FILE` | 技能注册表文件路径(多 agent / 隔离环境用;默认 `~/.yottaskills/registry.json`) |
421
+ | `YOTTA_SKILLS_USAGE_FILE` | 使用记录文件路径(`usage` 记录落点;默认 `~/.yottaskills/usage.json`) |
422
+ | `YOTTA_PROVIDER_HOME` | provider 配置根目录(M1 裁决 / O1 动态路由;默认 `~/.yottameta/`,协议见 `references/provider-protocol.md`) |
423
+
424
+ ### 隔离环境:三个状态文件成组导出
425
+
426
+ 测试、CI 与多 agent 共存场景建议把下面三个状态文件变量**成组**导出,避免读写宿主真实状态;
427
+ 只导出其中一个时,其余状态仍会落到用户目录(例如漏掉 `YOTTA_SKILLS_USAGE_FILE` 时,
428
+ `usage` 记录仍会写入 `~/.yottaskills/usage.json`)。
429
+
430
+ ```bash
431
+ # bash(Linux / macOS / Git Bash)
432
+ export YOTTA_SKILLS_REGISTRY_FILE="${TMPDIR:-/tmp}/registry.json"
433
+ export YOTTA_SKILLS_USAGE_FILE="${TMPDIR:-/tmp}/usage.json"
434
+ export YOTTA_PROVIDER_HOME="${TMPDIR:-/tmp}/provider"
435
+ ```
436
+
437
+ ```powershell
438
+ # PowerShell(Windows)
439
+ $env:YOTTA_SKILLS_REGISTRY_FILE = "$env:TEMP\registry.json"
440
+ $env:YOTTA_SKILLS_USAGE_FILE = "$env:TEMP\usage.json"
441
+ $env:YOTTA_PROVIDER_HOME = "$env:TEMP\provider"
442
+ ```
420
443
 
421
444
  ## 常见问题
422
445
 
@@ -42,9 +42,10 @@ const m1FeaturesLib = require('../lib/m1-features');
42
42
  const routeFeaturesLib = require('../lib/route-features');
43
43
  const routeDynamicLib = require('../lib/route-dynamic');
44
44
  const { createInstaller, isSafeTarEntry } = require('../lib/install-pipeline');
45
+ const { COPY_SKIP, copyDir } = require('../lib/copy-tree');
45
46
 
46
47
  const PKG_ROOT = path.join(__dirname, '..');
47
- let VERSION = '0.23.0';
48
+ let VERSION = '0.23.2';
48
49
  try { VERSION = require(path.join(PKG_ROOT, 'package.json')).version; } catch (_) { /* keep fallback */ }
49
50
 
50
51
  function loadManifest() {
@@ -513,24 +514,7 @@ async function runUpdateAuto(opts, dest) {
513
514
  return { code: failed2 > 0 ? autoExitCode : 0 };
514
515
  }
515
516
 
516
- function shouldSkip(name, isFile) {
517
- if (name === '__pycache__' || name === '.pytest_cache' || name === '.mypy_cache') return true;
518
- if (isFile && (name.endsWith('.pyc') || name.endsWith('.pyo'))) return true;
519
- return false;
520
- }
521
- function copyDir(src, dst, skip) {
522
- for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
523
- if (skip.has(entry.name) || shouldSkip(entry.name, entry.isFile())) continue;
524
- const s = path.join(src, entry.name);
525
- const d = path.join(dst, entry.name);
526
- if (entry.isDirectory()) {
527
- fs.mkdirSync(d, { recursive: true });
528
- copyDir(s, d, skip);
529
- } else if (entry.isFile()) {
530
- fs.copyFileSync(s, d);
531
- }
532
- }
533
- }
517
+ // 复制原语(顶层跳过口径 / 缓存清理)统一在 lib/copy-tree.js,此处不再保留第二份实现。
534
518
 
535
519
  function resolveTargetDir(opts) {
536
520
  if (opts.dir) return path.resolve(opts.dir);
@@ -659,8 +643,6 @@ function extractTarball(tarball, extractDir) {
659
643
  return { pkgDir };
660
644
  }
661
645
 
662
- const COPY_SKIP = new Set(['package.json', 'bin', 'node_modules', '.git', '__pycache__']);
663
-
664
646
  function ensureGate(context) {
665
647
  const { skill, extracted, dest, opts } = context;
666
648
  const current = findVerifyEngine(dest, opts);
@@ -716,7 +698,7 @@ function ensureGate(context) {
716
698
  const installOne = createInstaller({
717
699
  runNpmPack,
718
700
  extractTarball,
719
- copyDir: (src, dst) => copyDir(src, dst, COPY_SKIP),
701
+ copyDir: (src, dst) => copyDir(src, dst, COPY_SKIP, true),
720
702
  readInstalledVersion,
721
703
  ensureGate,
722
704
  scanTarget,
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * 安装落位的复制原语(单一真源)。
5
+ *
6
+ * 口径(2026-10-01,与元造 0.1.3 的安装器修复对齐):
7
+ * - 顶层开发文件 / 目录(package.json / bin / node_modules / .git)只在**安装包顶层**跳过;
8
+ * 技能包内嵌套的同名载荷(如 template/package.json、template/bin/install.js)必须保留。
9
+ * - 缓存 / 编译产物(__pycache__ / .pytest_cache / .mypy_cache / *.pyc / *.pyo)任意层级都跳过。
10
+ */
11
+
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+
15
+ const COPY_SKIP = new Set(['package.json', 'bin', 'node_modules', '.git']);
16
+
17
+ function shouldSkipCache(name, isFile) {
18
+ if (name === '__pycache__' || name === '.pytest_cache' || name === '.mypy_cache') return true;
19
+ if (isFile && (name.endsWith('.pyc') || name.endsWith('.pyo'))) return true;
20
+ return false;
21
+ }
22
+
23
+ function copyDir(src, dst, skip, topLevel) {
24
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
25
+ if (topLevel && skip.has(entry.name)) continue;
26
+ if (shouldSkipCache(entry.name, entry.isFile())) continue;
27
+ const s = path.join(src, entry.name);
28
+ const d = path.join(dst, entry.name);
29
+ if (entry.isDirectory()) {
30
+ fs.mkdirSync(d, { recursive: true });
31
+ copyDir(s, d, skip, false);
32
+ } else if (entry.isFile()) {
33
+ fs.copyFileSync(s, d);
34
+ }
35
+ }
36
+ }
37
+
38
+ module.exports = { COPY_SKIP, shouldSkipCache, copyDir };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yottameta/yotta-skills",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "description": "YuanGe (元阁) - orchestration routing, inventory, and one-command installer for the YottaMeta skill family (zero dependencies, Node.js only).",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -18,7 +18,7 @@
18
18
  | `yotta-logs` | 元史 | `@yottameta/yotta-logs` | 0.3.2 | 跨智能体历史会话 / 记忆日志检索 |
19
19
  | `yotta-security-testing` | 元测 | `@yottameta/yotta-security-testing` | 0.3.1 | 有纪律的 AI 安全测试方法论 + Scope Guard 五道防线 |
20
20
  | `yotta-agent-hardening` | 元安全 | `@yottameta/yotta-agent-hardening` | 0.2.6 | 防御向 AI 智能体自身安全加固(配置面静态扫描三域) |
21
- | `yotta-skill-creator` | 元造 | `@yottameta/yotta-skill-creator` | 0.1.3 | 工坊「造」:端到端造技能脚手架 |
21
+ | `yotta-skill-creator` | 元造 | `@yottameta/yotta-skill-creator` | 0.1.4 | 工坊「造」:端到端造技能脚手架 |
22
22
  | `yotta-publish-guard` | 元守 | `@yottameta/yotta-publish-guard` | 0.4.2 | 工坊「守」:发布前守门(版本四件对齐 + 三通道查重) |
23
23
  | `yotta-logwatch` | 元察 | `@yottameta/yotta-logwatch` | 0.3.0 | 安全日志分析检测引擎(攻击链识别/告警聚合) |
24
24
  | `yotta-intel` | 元情 | `@yottameta/yotta-intel` | 0.2.1 | 威胁情报 IOC 提取与规范化引擎(STIX-lite) |
@@ -29,7 +29,7 @@
29
29
  | `yotta-verify` | 元信 | `@yottameta/yotta-verify` | 0.3.3 | 装前安全扫描器 + audited 徽章(prompt injection + 危险模式) |
30
30
  | `yotta-compliance` | 元规 | `@yottameta/yotta-compliance` | 0.1.0 | 本地确定性合规条款审查(PIPL + 数据出境规则包 / 证据锚点 / 框架覆盖分级) |
31
31
  | `yotta-mirror` | 元镜 | `@yottameta/yotta-mirror` | 0.1.0 | 本地确定性学情分析(知识点掌握率 / 分层与临界生 / 薄弱点诊断,学生数据不出本机) |
32
- | `yotta-lesson` | 元案 | `@yottameta/yotta-lesson` | 0.1.0 | 本地确定性教案骨架与覆盖校验(课标映射 / 环节时间精确分配 / 缺口检查) |
32
+ | `yotta-lesson` | 元案 | `@yottameta/yotta-lesson` | 0.1.1 | 本地确定性教案骨架与覆盖校验(课标映射 / 环节时间精确分配 / 缺口检查) |
33
33
  | `yotta-item` | 元题 | `@yottameta/yotta-item` | 0.1.0 | 本地确定性组卷与试卷校验(双向细目表 / 题库选题 / 缺口检查) |
34
34
  | `yotta-school-doc` | 元公 | `@yottameta/yotta-school-doc` | 0.1.2 | 本地确定性学校公文可信起草与校验(文种规则包 / 可复算骨架 / 12 类缺口) |
35
35
 
@@ -27,7 +27,7 @@ import subprocess
27
27
  import sys
28
28
  from pathlib import Path
29
29
 
30
- VERSION = "0.23.0"
30
+ VERSION = "0.23.2"
31
31
  TOOL_NAME = "yotta-skills"
32
32
  CN_NAME = "元阁"
33
33
  MCP_PROTOCOL_MODERN = "2026-07-28"
@@ -3,7 +3,7 @@
3
3
  "slug": "yotta-skills",
4
4
  "name": "元阁",
5
5
  "package": "@yottameta/yotta-skills",
6
- "version": "0.23.0",
6
+ "version": "0.23.2",
7
7
  "trust": "yottameta",
8
8
  "install": {
9
9
  "idempotent": true
package/skills.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifestVersion": 1,
3
- "updated": "2026-09-30",
3
+ "updated": "2026-10-01",
4
4
  "note": "清单同步要求:每次技能发布新版本后,按 YottaSkills 技能登记表更新本文件(登记表为内部台账,不随包分发)。",
5
5
  "skills": [
6
6
  {
@@ -98,7 +98,7 @@
98
98
  "slug": "yotta-skill-creator",
99
99
  "name": "元造",
100
100
  "pkg": "@yottameta/yotta-skill-creator",
101
- "version": "0.1.3",
101
+ "version": "0.1.4",
102
102
  "desc": "工坊「造」:端到端造技能脚手架"
103
103
  },
104
104
  {
@@ -175,7 +175,7 @@
175
175
  "slug": "yotta-lesson",
176
176
  "name": "元案",
177
177
  "pkg": "@yottameta/yotta-lesson",
178
- "version": "0.1.0",
178
+ "version": "0.1.1",
179
179
  "desc": "本地确定性教案骨架与覆盖校验(课标映射 / 环节时间精确分配 / 缺口检查)"
180
180
  },
181
181
  {