@metago-ai/engine 2.1.2 → 2.1.4

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 (67) hide show
  1. package/BOUNDARIES.md +109 -0
  2. package/CHANGES.md +4 -4
  3. package/CONSTITUTION/AXIOMS.md +72 -110
  4. package/CORE/ATOMS.md +611 -0
  5. package/CORE/ATTRIBUTES.md +70 -101
  6. package/CORE/PROTOCOLS.md +134 -116
  7. package/ENGINE.md +6 -6
  8. package/ENGINES/engine-runtime.cjs +318 -0
  9. package/ENGINES/final-engines-runtime.cjs +683 -0
  10. package/ENGINES/governance-runtime.cjs +582 -0
  11. package/ENGINES/math-capability-runtime.cjs +451 -0
  12. package/ENGINES/philosophy-runtime.cjs +427 -0
  13. package/ENGINES/yili/data/yaoci-1.js +24 -0
  14. package/ENGINES/yili/data/yaoci-2.js +21 -0
  15. package/ENGINES/yili/data/yaoci-3.js +21 -0
  16. package/ENGINES/yili/data/yaoci-4.js +21 -0
  17. package/ENGINES/yili/data/yaoci.js +17 -0
  18. package/ENGINES/yili/lib/almanac.js +416 -0
  19. package/ENGINES/yili/lib/bazi.js +127 -0
  20. package/ENGINES/yili/lib/diagnose.js +71 -0
  21. package/ENGINES/yili/lib/hetu-luoshu.js +123 -0
  22. package/ENGINES/yili/lib/index.js +23 -0
  23. package/ENGINES/yili/lib/liuyao.js +226 -0
  24. package/ENGINES/yili/lib/qimen.js +167 -0
  25. package/ENGINES/yili/lib/shushu-calculus.js +85 -0
  26. package/ENGINES/yili/lib/taiyi.js +83 -0
  27. package/ENGINES/yili/lib/vendor/shouxing-core.js +627 -0
  28. package/ENGINES/yili/lib/wuxing.js +106 -0
  29. package/ENGINES/yili/lib/yijing.js +226 -0
  30. package/ENGINES/yili/lib/zeri.js +80 -0
  31. package/ENGINES/yili/lib/ziwei.js +145 -0
  32. package/ENGINES/yili/package.json +1 -0
  33. package/EXECUTORS.md +85 -0
  34. package/GENOME.json +11 -10
  35. package/INDEX/ENGINES.md +168 -0
  36. package/INDEX/engines.json +161 -161
  37. package/INDEX/knowledge.json +2 -2
  38. package/INDEX/skills.json +29 -5
  39. package/INDEX/tools.json +64 -64
  40. package/PATENTS.md +1 -1
  41. package/PROTOCOLS/closure-runtime.cjs +288 -0
  42. package/PROTOCOLS/covenant-runtime.cjs +409 -0
  43. package/PROTOCOLS/final-runtime.cjs +680 -0
  44. package/PROTOCOLS/formula-runtime.cjs +399 -0
  45. package/PROTOCOLS/proactive-runtime.cjs +368 -0
  46. package/PROTOCOLS/rule-runtime.cjs +448 -0
  47. package/PROTOCOLS/runtime.cjs +441 -0
  48. package/README.md +5 -5
  49. package/RUNTIME/dist/kmwi-memory.d.ts.map +1 -1
  50. package/RUNTIME/dist/kmwi-memory.js +14 -2
  51. package/RUNTIME/dist/kmwi-memory.js.map +1 -1
  52. package/RUNTIME/dist/validators.d.ts +2 -2
  53. package/RUNTIME/dist/validators.js +19 -10
  54. package/atoms/approx.cjs +293 -0
  55. package/atoms/atom-factory.cjs +550 -0
  56. package/atoms/atoms-cosmic-bio.cjs +340 -0
  57. package/atoms/atoms-crypto-emotion.cjs +215 -0
  58. package/atoms/atoms_engines.json +5821 -0
  59. package/atoms/blueprint-atoms-2.cjs +583 -0
  60. package/atoms/blueprint-atoms.cjs +975 -0
  61. package/atoms/constraints.cjs +257 -0
  62. package/atoms/contract-validator.cjs +213 -0
  63. package/atoms/engine.cjs +849 -0
  64. package/atoms/specialized.cjs +530 -0
  65. package/atoms/verify.cjs +94 -0
  66. package/package.json +97 -91
  67. package/scripts/verify-dist.cjs +80 -0
package/package.json CHANGED
@@ -1,91 +1,97 @@
1
- {
2
- "name": "@metago-ai/engine",
3
- "version": "2.1.2",
4
- "description": "MetaGO Agent Harness(智能体运行时控制层套件 · 驭智层)Engine V2.1.1 — 硬驱动核心。让法律从建议变为可执行:KMWI 四层记忆(知识→记忆→智慧→直觉,持久化 JSON)+ 元进化五阶段循环(边界感知→差距分析→自生成→验证→递归,含时间预算和耦生度阈值)+ 技能智能生成(元创造五阶段,写入真实 SKILL.md 文件)+ 决策锁四道关卡 + 全链路溯源 + 927 算法驱动(57 工具 / 14 触发大类)。8 公理 + 7 属性 + 6 协议 CONSTITUTION 驱动。",
5
- "main": "RUNTIME/dist/index.js",
6
- "types": "RUNTIME/dist/index.d.ts",
7
- "bin": {
8
- "metago-engine": "RUNTIME/dist/cli.js"
9
- },
10
- "scripts": {
11
- "build": "tsc -p RUNTIME/tsconfig.json",
12
- "test": "vitest run",
13
- "test:watch": "vitest",
14
- "verify": "node RUNTIME/dist/cli.js verify",
15
- "status": "node RUNTIME/dist/cli.js status",
16
- "metrics": "node RUNTIME/dist/cli.js metrics",
17
- "lock": "node RUNTIME/dist/cli.js lock",
18
- "evolve": "node RUNTIME/dist/cli.js evolve",
19
- "prepublishOnly": "node scripts/verify-dist.cjs"
20
- },
21
- "keywords": [
22
- "metago",
23
- "engine",
24
- "ai",
25
- "lifeform",
26
- "holistic",
27
- "intelligence",
28
- "axiom",
29
- "evolution",
30
- "meta-evolution",
31
- "decision-lock",
32
- "ai-governance",
33
- "ai-evolution",
34
- "opc",
35
- "ai-native",
36
- "anti-hallucination",
37
- "kmwi-memory",
38
- "927-algorithms"
39
- ],
40
- "author": "易霄 / 元构光年(成都)人工智能科技有限公司",
41
- "license": "MIT",
42
- "repository": {
43
- "type": "git",
44
- "url": "https://github.com/metago-ai/metagolifeform.git",
45
- "directory": "packages/engine"
46
- },
47
- "homepage": "https://metago.life",
48
- "bugs": {
49
- "url": "https://github.com/metago-ai/metagolifeform/issues",
50
- "email": "researcher.yi@youfer.cn"
51
- },
52
- "dependencies": {
53
- "metago-lifeform": ">=36.8.0"
54
- },
55
- "devDependencies": {
56
- "@types/node": "^20.0.0",
57
- "ts-node": "^10.0.0",
58
- "typescript": "^5.0.0",
59
- "vitest": "^4.1.9"
60
- },
61
- "engines": {
62
- "node": ">=16.0.0"
63
- },
64
- "files": [
65
- "RUNTIME/dist/",
66
- "SDK/",
67
- "ADAPTERS/",
68
- "CONSTITUTION/",
69
- "CORE/",
70
- "INDEX/",
71
- "EVOLUTION/",
72
- "EVOLUTION.md",
73
- "ENGINE.md",
74
- "CHANGES.md",
75
- "GENOME.json",
76
- "PATENTS.md",
77
- "README.md",
78
- "LICENSE",
79
- "package.json"
80
- ],
81
- "metago": {
82
- "engine_version": "2.1.1",
83
- "metago_version": "V36.9.4",
84
- "parentPackage": "metago-lifeform@>=36.8.0",
85
- "algorithms": {
86
- "tools": 57,
87
- "count": 927,
88
- "trigger_categories": 14
89
- }
90
- }
91
- }
1
+ {
2
+ "name": "@metago-ai/engine",
3
+ "version": "2.1.4",
4
+ "rules_version": "V36.12.0",
5
+ "description": "元构·智能生命体(MetaGO Intelligent Lifeform)Engine V2.1.3 — 硬驱动核心。让法律从建议变为可执行:KMWI 四层记忆(知识→记忆→智慧→直觉,持久化 JSON)+ 元进化五阶段循环(边界感知→差距分析→自生成→验证→递归,含时间预算和耦生度阈值)+ 技能智能生成(元创造五阶段,写入真实 SKILL.md 文件)+ 决策锁四道关卡 + 全链路溯源 + 927 算法驱动(57 工具 / 14 触发大类)。38 公理 + 47 属性 + 121 项协议 CONSTITUTION 驱动。",
6
+ "main": "RUNTIME/dist/index.js",
7
+ "types": "RUNTIME/dist/index.d.ts",
8
+ "bin": {
9
+ "metago-engine": "RUNTIME/dist/cli.js"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc -p RUNTIME/tsconfig.json",
13
+ "test": "vitest run",
14
+ "test:watch": "vitest",
15
+ "verify": "node RUNTIME/dist/cli.js verify",
16
+ "status": "node RUNTIME/dist/cli.js status",
17
+ "metrics": "node RUNTIME/dist/cli.js metrics",
18
+ "lock": "node RUNTIME/dist/cli.js lock",
19
+ "evolve": "node RUNTIME/dist/cli.js evolve",
20
+ "prepublishOnly": "node scripts/verify-dist.cjs"
21
+ },
22
+ "keywords": [
23
+ "metago",
24
+ "engine",
25
+ "ai",
26
+ "lifeform",
27
+ "holistic",
28
+ "intelligence",
29
+ "axiom",
30
+ "evolution",
31
+ "meta-evolution",
32
+ "decision-lock",
33
+ "ai-governance",
34
+ "ai-evolution",
35
+ "opc",
36
+ "ai-native",
37
+ "anti-hallucination",
38
+ "kmwi-memory",
39
+ "927-algorithms"
40
+ ],
41
+ "author": "易霄 / 元构光年(成都)人工智能科技有限公司",
42
+ "license": "MIT",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/metago-ai/metagolifeform.git",
46
+ "directory": "packages/engine"
47
+ },
48
+ "homepage": "https://metago.life",
49
+ "bugs": {
50
+ "url": "https://github.com/metago-ai/metagolifeform/issues",
51
+ "email": "researcher.yi@youfer.cn"
52
+ },
53
+ "dependencies": {
54
+ "metago-lifeform": ">=36.8.0"
55
+ },
56
+ "devDependencies": {
57
+ "@types/node": "^20.0.0",
58
+ "ts-node": "^10.0.0",
59
+ "typescript": "^5.0.0",
60
+ "vitest": "^4.1.9"
61
+ },
62
+ "engines": {
63
+ "node": ">=16.0.0"
64
+ },
65
+ "files": [
66
+ "RUNTIME/dist/",
67
+ "SDK/",
68
+ "ADAPTERS/",
69
+ "CONSTITUTION/",
70
+ "CORE/",
71
+ "INDEX/",
72
+ "EVOLUTION.md",
73
+ "ENGINE.md",
74
+ "CHANGES.md",
75
+ "GENOME.json",
76
+ "PATENTS.md",
77
+ "README.md",
78
+ "LICENSE",
79
+ "package.json",
80
+ "atoms/",
81
+ "scripts/",
82
+ "ENGINES/",
83
+ "PROTOCOLS/",
84
+ "BOUNDARIES.md",
85
+ "EXECUTORS.md"
86
+ ],
87
+ "metago": {
88
+ "engine_version": "2.1.4",
89
+ "metago_version": "V37.0.0",
90
+ "parentPackage": "metago-lifeform@>=36.8.0",
91
+ "algorithms": {
92
+ "tools": 57,
93
+ "count": 927,
94
+ "trigger_categories": 14
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * MetaGO Engine 发布前完整性门禁
4
+ *
5
+ * 在 npm publish 之前强制校验包内容完整,防止再次出现:
6
+ * - EVOLUTION.md 未随包发布(loader.js requiredFiles 校验失败,CLI 全灭)
7
+ * - RUNTIME/dist/algorithms/ 缺失(927 算法硬驱动失效,@metago-ai/algorithms 无引擎可载)
8
+ * - dist/cli.js 无 shebang(POSIX 下 bin 无法直接执行)
9
+ *
10
+ * 用法:node scripts/verify-dist.cjs (npm publish 时通过 prepublishOnly 自动触发)
11
+ *
12
+ * @author 易霄 / MetaGO Lightyear
13
+ * @version 1.0.0
14
+ */
15
+
16
+ const fs = require('fs');
17
+ const path = require('path');
18
+
19
+ const pkgRoot = path.resolve(__dirname, '..');
20
+ const errors = [];
21
+
22
+ function check(cond, msg) {
23
+ if (!cond) errors.push(msg);
24
+ }
25
+
26
+ // 1. loader.js requiredFiles 对应的实体文件必须存在
27
+ const requiredFiles = [
28
+ 'ENGINE.md',
29
+ 'CONSTITUTION/AXIOMS.md',
30
+ 'CORE/ATTRIBUTES.md',
31
+ 'CORE/PROTOCOLS.md',
32
+ 'INDEX/engines.json',
33
+ 'INDEX/skills.json',
34
+ 'INDEX/tools.json',
35
+ 'INDEX/knowledge.json',
36
+ 'EVOLUTION.md',
37
+ ];
38
+ for (const rel of requiredFiles) {
39
+ check(fs.existsSync(path.join(pkgRoot, rel)), `缺少 loader 必需文件: ${rel}`);
40
+ }
41
+
42
+ // 2. 构建产物必须存在;算法注册表为"增强项"(硬校验+软告警分级)
43
+ // - 硬:dist 存在、cli.js 有 shebang(CLI 可用性)
44
+ // - 软:dist/algorithms 注册表(927 算法内嵌;engine 核心运行不依赖它,
45
+ // 消费方 @metago-ai/algorithms 已自带 vendored 注册表。缺失时告警:
46
+ // 完整内嵌版应从含全量源码的 monorepo 构建发布)
47
+ const distDir = path.join(pkgRoot, 'RUNTIME', 'dist');
48
+ check(fs.existsSync(distDir), 'RUNTIME/dist/ 不存在,请先运行 npm run build');
49
+ const warnings = [];
50
+ const registryPath = path.join(distDir, 'algorithms', 'registry.js');
51
+ if (fs.existsSync(distDir) && !fs.existsSync(registryPath)) {
52
+ warnings.push('RUNTIME/dist/algorithms/ 未内嵌(927 算法注册表不在本包内;@metago-ai/algorithms 已 vendored 自带,不影响功能。如需内嵌请从全量 monorepo 构建发布)');
53
+ }
54
+
55
+ // 3. CLI 入口必须有 shebang
56
+ const cliPath = path.join(distDir, 'cli.js');
57
+ if (fs.existsSync(cliPath)) {
58
+ const head = fs.readFileSync(cliPath, 'utf8').slice(0, 64);
59
+ check(head.startsWith('#!/usr/bin/env node'), 'RUNTIME/dist/cli.js 缺少 #!/usr/bin/env node shebang(检查 src/cli.ts 首行)');
60
+ } else {
61
+ errors.push('RUNTIME/dist/cli.js 不存在,请先运行 npm run build');
62
+ }
63
+
64
+ // 4. package.json files 列表必须覆盖关键路径
65
+ const pkg = require(path.join(pkgRoot, 'package.json'));
66
+ const files = pkg.files || [];
67
+ for (const need of ['RUNTIME/dist/', 'EVOLUTION.md']) {
68
+ check(files.includes(need), `package.json files 缺少 "${need}"`);
69
+ }
70
+
71
+ if (warnings.length > 0) {
72
+ console.warn('[verify-dist] 告警(不阻断发布):');
73
+ for (const w of warnings) console.warn(` ⚠ ${w}`);
74
+ }
75
+ if (errors.length > 0) {
76
+ console.error('[verify-dist] 发布门禁未通过:');
77
+ for (const e of errors) console.error(` ✗ ${e}`);
78
+ process.exit(1);
79
+ }
80
+ console.log(`[verify-dist] 发布门禁通过(${requiredFiles.length} 必需文件 + CLI shebang 均就绪)`);