@agents-uni/zhenhuan 0.1.3 → 0.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.
package/README.en.md CHANGED
@@ -2,6 +2,9 @@
2
2
  [![npm version](https://img.shields.io/npm/v/@agents-uni/zhenhuan.svg)](https://www.npmjs.com/package/@agents-uni/zhenhuan)
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
 
5
+ <p align="center">
6
+ <img src="assets/logo.png" alt="Agents Uni" width="120" />
7
+ </p>
5
8
  <p align="center">
6
9
  <h1 align="center">zhenhuan-uni</h1>
7
10
  <p align="center">
package/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
  [![npm version](https://img.shields.io/npm/v/@agents-uni/zhenhuan.svg)](https://www.npmjs.com/package/@agents-uni/zhenhuan)
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
 
5
+ <p align="center">
6
+ <img src="assets/logo.png" alt="Agents Uni" width="120" />
7
+ </p>
5
8
  <p align="center">
6
9
  <h1 align="center">zhenhuan-uni</h1>
7
10
  <p align="center">
package/dist/cli/index.js CHANGED
@@ -7,6 +7,7 @@ import chalk from 'chalk';
7
7
  import { resolve, dirname, join } from 'node:path';
8
8
  import { existsSync } from 'node:fs';
9
9
  import { fileURLToPath } from 'node:url';
10
+ import { createRequire } from 'node:module';
10
11
  import { PalaceOrchestrator } from '../orchestrator/index.js';
11
12
  import { startServer } from '../server/index.js';
12
13
  /**
@@ -14,6 +15,7 @@ import { startServer } from '../server/index.js';
14
15
  * 1. 用户显式指定 --spec → 直接用
15
16
  * 2. CWD 下存在 universe.yaml → 用它
16
17
  * 3. fallback 到包自带的 universe.yaml(全局安装场景)
18
+ * 4. fallback 到 @agents-uni/unis/zhenhuan/universe.yaml(如果安装了)
17
19
  */
18
20
  function resolveSpec(specOpt) {
19
21
  // 用户显式传了绝对路径或非默认值
@@ -32,6 +34,19 @@ function resolveSpec(specOpt) {
32
34
  console.log(chalk.gray(` ℹ 使用内置 universe.yaml (${bundledSpec})`));
33
35
  return bundledSpec;
34
36
  }
37
+ // fallback: @agents-uni/unis 中的 zhenhuan 模板
38
+ try {
39
+ const require = createRequire(import.meta.url);
40
+ const unisPkgPath = require.resolve('@agents-uni/unis/package.json');
41
+ const unisSpec = join(dirname(unisPkgPath), 'zhenhuan', 'universe.yaml');
42
+ if (existsSync(unisSpec)) {
43
+ console.log(chalk.gray(` ℹ 使用 @agents-uni/unis 模板 (${unisSpec})`));
44
+ return unisSpec;
45
+ }
46
+ }
47
+ catch {
48
+ // @agents-uni/unis not installed — skip
49
+ }
35
50
  // 都找不到,返回原始路径(让后续报一个清晰的错误)
36
51
  return cwdSpec;
37
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-uni/zhenhuan",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Zhen Huan palace drama themed agent competition system built on @agents-uni/core",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,12 +52,15 @@
52
52
  "url": "https://github.com/agents-uni/zhenhuan/issues"
53
53
  },
54
54
  "dependencies": {
55
- "@agents-uni/core": "^0.2.0",
55
+ "@agents-uni/core": "^0.3.0",
56
56
  "@hono/node-server": "^1.13.0",
57
57
  "chalk": "^5.3.0",
58
58
  "commander": "^12.1.0",
59
59
  "hono": "^4.6.0"
60
60
  },
61
+ "optionalDependencies": {
62
+ "@agents-uni/unis": "^0.1.0"
63
+ },
61
64
  "devDependencies": {
62
65
  "@types/node": "^22.10.0",
63
66
  "tsx": "^4.19.2",