@agents-uni/core 0.1.0 → 0.1.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/README.en.md +160 -8
- package/README.md +160 -8
- package/dist/bridge/agency-import.d.ts +85 -0
- package/dist/bridge/agency-import.d.ts.map +1 -0
- package/dist/bridge/agency-import.js +323 -0
- package/dist/bridge/agency-import.js.map +1 -0
- package/dist/bridge/agency-registry.d.ts +93 -0
- package/dist/bridge/agency-registry.d.ts.map +1 -0
- package/dist/bridge/agency-registry.js +250 -0
- package/dist/bridge/agency-registry.js.map +1 -0
- package/dist/bridge/index.d.ts +2 -0
- package/dist/bridge/index.d.ts.map +1 -1
- package/dist/bridge/index.js +4 -0
- package/dist/bridge/index.js.map +1 -1
- package/dist/cli/index.js +215 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
[](https://github.com/agents-uni/core/actions/workflows/ci.yml)
|
|
2
|
+
[](https://www.npmjs.com/package/@agents-uni/core)
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
|
|
1
5
|
<p align="center">
|
|
2
6
|
<h1 align="center">agents-uni-core</h1>
|
|
3
7
|
<p align="center">
|
|
@@ -17,6 +21,7 @@
|
|
|
17
21
|
<a href="#openclaw-bridge">OpenClaw Bridge</a> •
|
|
18
22
|
<a href="#dashboard">Dashboard</a> •
|
|
19
23
|
<a href="#multi-uni-management">Multi-Uni</a> •
|
|
24
|
+
<a href="#agency-agents-bridge">Agency-Agents</a> •
|
|
20
25
|
<a href="./DESIGN.md">Design Doc</a>
|
|
21
26
|
</p>
|
|
22
27
|
|
|
@@ -48,6 +53,16 @@ npx create-uni my-universe
|
|
|
48
53
|
npx create-uni my-universe --template competitive
|
|
49
54
|
```
|
|
50
55
|
|
|
56
|
+
### Install the CLI globally
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g @agents-uni/core
|
|
60
|
+
|
|
61
|
+
# Then use the `uni` command directly
|
|
62
|
+
uni validate universe.yaml
|
|
63
|
+
uni dashboard
|
|
64
|
+
```
|
|
65
|
+
|
|
51
66
|
### Use as a library
|
|
52
67
|
|
|
53
68
|
```bash
|
|
@@ -214,6 +229,8 @@ npx create-uni my-project --template competitive
|
|
|
214
229
|
|
|
215
230
|
## CLI
|
|
216
231
|
|
|
232
|
+
After global install, use the `uni` command directly, or call via `npx @agents-uni/core`:
|
|
233
|
+
|
|
217
234
|
```bash
|
|
218
235
|
# Validate a universe spec
|
|
219
236
|
uni validate universe.yaml
|
|
@@ -231,20 +248,30 @@ uni deploy universe.yaml --dir ./workspaces --lang zh
|
|
|
231
248
|
# Interactive project initialization
|
|
232
249
|
uni init
|
|
233
250
|
|
|
234
|
-
#
|
|
251
|
+
# Start the Dashboard web UI
|
|
235
252
|
uni dashboard [--port 8089]
|
|
236
253
|
|
|
237
|
-
#
|
|
254
|
+
# List all registered universes
|
|
238
255
|
uni list
|
|
239
256
|
|
|
240
|
-
#
|
|
257
|
+
# Overview of deployed unis and agents
|
|
241
258
|
uni status
|
|
242
259
|
|
|
243
|
-
#
|
|
260
|
+
# Remove a universe and all its files
|
|
244
261
|
uni cleanup <id>
|
|
245
262
|
|
|
246
|
-
#
|
|
263
|
+
# Reset runtime data, keep configuration
|
|
247
264
|
uni reset <id>
|
|
265
|
+
|
|
266
|
+
# 🆕 Agency-agents bridge
|
|
267
|
+
uni agency init # Download agency-agents repo
|
|
268
|
+
uni agency list # List available categories
|
|
269
|
+
uni agency update # Pull latest updates
|
|
270
|
+
uni agency import engineering design # Import by category
|
|
271
|
+
uni agency import all --name full-team # Import all agents
|
|
272
|
+
|
|
273
|
+
# Import from raw directory paths (advanced)
|
|
274
|
+
uni import ./path/to/agents/ --name my-team
|
|
248
275
|
```
|
|
249
276
|
|
|
250
277
|
| Command | Description |
|
|
@@ -259,14 +286,22 @@ uni reset <id>
|
|
|
259
286
|
| `uni status` | Overview of deployed unis and agents |
|
|
260
287
|
| `uni cleanup <id>` | Remove a universe and all its files |
|
|
261
288
|
| `uni reset <id>` | Reset runtime data, keep SOUL.md config |
|
|
289
|
+
| `uni agency init` | Download agency-agents repo locally |
|
|
290
|
+
| `uni agency list` | List available categories and agent counts |
|
|
291
|
+
| `uni agency update` | Pull latest agency-agents updates |
|
|
292
|
+
| `uni agency import` | Import agents by category name to universe.yaml |
|
|
293
|
+
| `uni import` | Import from raw directory paths (advanced) |
|
|
262
294
|
|
|
263
295
|
## OpenClaw Bridge
|
|
264
296
|
|
|
265
297
|
agents-uni-core integrates with [OpenClaw](https://github.com/anthropics/openclaw) via a **file-based protocol**. Three core capabilities:
|
|
266
298
|
|
|
267
299
|
**1. SOUL.md Deployment** — generate agent persona files from universe specs and create agent runtime directories (`agents/{id}/agent/` + `agents/{id}/sessions/`)
|
|
300
|
+
|
|
268
301
|
**2. One-Click Registration** — auto-register agents in `openclaw.json` (with both `workspace` and `agentDir` fields) during deployment
|
|
302
|
+
|
|
269
303
|
**3. Task Dispatch** — communicate with agents via `TASK.md` / `SUBMISSION.md` file protocol
|
|
304
|
+
|
|
270
305
|
**4. Workspace Management** — check and sync OpenClaw workspace state
|
|
271
306
|
|
|
272
307
|
```
|
|
@@ -437,6 +472,115 @@ import {
|
|
|
437
472
|
| Update | `updateUni()` | Re-deploy SOUL.md, handle added/removed agents |
|
|
438
473
|
| Cleanup | `uni cleanup <id>` | Delete workspace + agent dirs + remove from openclaw.json + registry |
|
|
439
474
|
|
|
475
|
+
## Agency-Agents Bridge
|
|
476
|
+
|
|
477
|
+
agents-uni-core has built-in bridge support for [agency-agents](https://github.com/msitarzewski/agency-agents), a high-quality agent persona library with 140+ agents covering 14 domains (engineering, design, marketing, sales, product, testing, etc.).
|
|
478
|
+
|
|
479
|
+
With the bridge, you can **import these agents into agents-uni with one command**, auto-convert them to `universe.yaml`, and deploy to OpenClaw.
|
|
480
|
+
|
|
481
|
+
### Initialize
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# Download agency-agents to ~/.agents-uni/agency-agents/ (one-time)
|
|
485
|
+
uni agency init
|
|
486
|
+
|
|
487
|
+
# List available categories
|
|
488
|
+
uni agency list
|
|
489
|
+
|
|
490
|
+
# Pull latest updates
|
|
491
|
+
uni agency update
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### Import by Category
|
|
495
|
+
|
|
496
|
+
```bash
|
|
497
|
+
# Import the engineering team (23 agents)
|
|
498
|
+
uni agency import engineering
|
|
499
|
+
|
|
500
|
+
# Import multiple categories
|
|
501
|
+
uni agency import engineering design marketing
|
|
502
|
+
|
|
503
|
+
# Import all 140+ agents
|
|
504
|
+
uni agency import all --name full-team --type hybrid
|
|
505
|
+
|
|
506
|
+
# Import and deploy SOUL.md to OpenClaw
|
|
507
|
+
uni agency import engineering --name my-eng --deploy --deploy-dir ~/.openclaw
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### Programmatic Usage
|
|
511
|
+
|
|
512
|
+
```typescript
|
|
513
|
+
import {
|
|
514
|
+
agencyInit,
|
|
515
|
+
agencyUpdate,
|
|
516
|
+
agencyListCategories,
|
|
517
|
+
resolveAgencyCategories,
|
|
518
|
+
importAgencyAgents,
|
|
519
|
+
toSoulMd,
|
|
520
|
+
} from '@agents-uni/core';
|
|
521
|
+
|
|
522
|
+
// 1. Initialize (first time only)
|
|
523
|
+
agencyInit();
|
|
524
|
+
|
|
525
|
+
// 2. List categories
|
|
526
|
+
const categories = agencyListCategories();
|
|
527
|
+
// [{ name: 'engineering', agentCount: 23, path: '...' }, ...]
|
|
528
|
+
|
|
529
|
+
// 3. Import by category
|
|
530
|
+
const dirs = resolveAgencyCategories(['engineering', 'design']);
|
|
531
|
+
const result = importAgencyAgents(dirs, {
|
|
532
|
+
name: 'my-team',
|
|
533
|
+
type: 'competitive',
|
|
534
|
+
relationships: 'peer',
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
// result.config → UniverseConfig (ready to deploy)
|
|
538
|
+
// result.agents → parsed agent data (with original personality)
|
|
539
|
+
console.log(`Imported ${result.agents.length} agents`);
|
|
540
|
+
|
|
541
|
+
// 4. Generate SOUL.md preserving original personality
|
|
542
|
+
for (const agent of result.agents) {
|
|
543
|
+
const soul = toSoulMd(agent, { universe: result.config, language: 'en' });
|
|
544
|
+
// soul contains agency-agents original personality + agents-uni org context
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// 5. Periodic updates
|
|
548
|
+
const updateResult = agencyUpdate();
|
|
549
|
+
if (updateResult.updated) {
|
|
550
|
+
console.log(`Updated: ${updateResult.oldCommit} → ${updateResult.newCommit}`);
|
|
551
|
+
}
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### Data Storage
|
|
555
|
+
|
|
556
|
+
```
|
|
557
|
+
~/.agents-uni/
|
|
558
|
+
├── agency-agents/ ← agency-agents repo (git clone)
|
|
559
|
+
│ ├── engineering/ ← 23 engineering agents
|
|
560
|
+
│ ├── design/ ← 8 design agents
|
|
561
|
+
│ ├── marketing/ ← 27 marketing agents
|
|
562
|
+
│ └── ... ← 14 categories total
|
|
563
|
+
└── agency-meta.json ← install and update metadata
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### Available Categories
|
|
567
|
+
|
|
568
|
+
| Category | Agents | Includes |
|
|
569
|
+
|----------|--------|----------|
|
|
570
|
+
| engineering | 23 | Backend Architect, Frontend Developer, DevOps, SRE, Security Engineer... |
|
|
571
|
+
| marketing | 27 | SEO Specialist, TikTok/Douyin Strategist, Growth Hacker, Content Creator... |
|
|
572
|
+
| specialized | 27 | Blockchain Auditor, Compliance Auditor, MCP Builder, Salesforce Architect... |
|
|
573
|
+
| design | 8 | UI Designer, UX Architect, Brand Guardian, Visual Storyteller... |
|
|
574
|
+
| sales | 8 | Deal Strategist, Outbound Strategist, Pipeline Analyst, Sales Coach... |
|
|
575
|
+
| testing | 8 | API Tester, Performance Benchmarker, Accessibility Auditor... |
|
|
576
|
+
| paid-media | 7 | PPC Strategist, Paid Social, Programmatic Buyer, Ad Creative... |
|
|
577
|
+
| support | 6 | Analytics Reporter, Finance Tracker, Legal Compliance... |
|
|
578
|
+
| spatial-computing | 6 | visionOS Engineer, XR Developer, Terminal Integration... |
|
|
579
|
+
| project-management | 6 | Jira Steward, Project Shepherd, Studio Producer... |
|
|
580
|
+
| academic | 5 | Anthropologist, Historian, Psychologist, Narratologist... |
|
|
581
|
+
| product | 5 | Product Manager, Sprint Prioritizer, Feedback Synthesizer... |
|
|
582
|
+
| game-development | 5 | Game Designer, Level Designer, Narrative Designer, Audio Engineer... |
|
|
583
|
+
|
|
440
584
|
## Architecture
|
|
441
585
|
|
|
442
586
|
```
|
|
@@ -528,6 +672,14 @@ import {
|
|
|
528
672
|
TaskDispatcher, // Dispatch TASK.md → collect SUBMISSION.md
|
|
529
673
|
FileWorkspaceIO, // File-system I/O backend
|
|
530
674
|
MemoryWorkspaceIO, // In-memory I/O backend (for testing)
|
|
675
|
+
|
|
676
|
+
// 🆕 Agency-agents bridge
|
|
677
|
+
agencyInit, // Download agency-agents repo
|
|
678
|
+
agencyUpdate, // Pull latest updates
|
|
679
|
+
agencyListCategories, // List available categories
|
|
680
|
+
resolveAgencyCategories, // Category names → directory paths
|
|
681
|
+
importAgencyAgents, // Batch import and generate UniverseConfig
|
|
682
|
+
toSoulMd, // Generate SOUL.md preserving original personality
|
|
531
683
|
} from '@agents-uni/core';
|
|
532
684
|
```
|
|
533
685
|
|
|
@@ -552,11 +704,11 @@ agents-uni-core/
|
|
|
552
704
|
core/ # Runtime engine (Universe, Registry, Graph, StateMachine, ...)
|
|
553
705
|
evolution/ # Self-optimization (Performance, Promotion, Memory, ...)
|
|
554
706
|
spec/ # YAML parsing, validation, compilation
|
|
555
|
-
bridge/ # OpenClaw bridge (SOUL.md, task dispatch, workspace I/O, uni registry)
|
|
707
|
+
bridge/ # OpenClaw bridge (SOUL.md, task dispatch, workspace I/O, uni registry, agency-agents bridge)
|
|
556
708
|
dashboard/ # 🆕 Dashboard (Hono server, HTML templates, API routes, extension system)
|
|
557
709
|
schema/ # JSON Schema for spec validation
|
|
558
710
|
templates/ # 5 built-in organizational templates
|
|
559
|
-
cli/ # Command-line interface (
|
|
711
|
+
cli/ # Command-line interface (15 commands)
|
|
560
712
|
create-uni/ # npx create-uni scaffolding tool
|
|
561
713
|
tests/ # Unit tests (41 tests, 7 suites)
|
|
562
714
|
```
|
|
@@ -582,7 +734,7 @@ npm run dev
|
|
|
582
734
|
|
|
583
735
|
## Related Projects
|
|
584
736
|
|
|
585
|
-
- [**@agents-uni/zhenhuan**](https://github.com/agents-uni/zhenhuan) — Palace drama themed agent competition system built on agents-uni-core
|
|
737
|
+
- [**@agents-uni/zhenhuan**](https://github.com/agents-uni/zhenhuan) — Palace drama themed agent competition system built on agents-uni-core ([npm](https://www.npmjs.com/package/@agents-uni/zhenhuan))
|
|
586
738
|
|
|
587
739
|
## License
|
|
588
740
|
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
[](https://github.com/agents-uni/core/actions/workflows/ci.yml)
|
|
2
|
+
[](https://www.npmjs.com/package/@agents-uni/core)
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
|
|
1
5
|
<p align="center">
|
|
2
6
|
<h1 align="center">agents-uni-core</h1>
|
|
3
7
|
<p align="center">
|
|
@@ -17,6 +21,7 @@
|
|
|
17
21
|
<a href="#openclaw-桥接">OpenClaw</a> •
|
|
18
22
|
<a href="#dashboard-仪表盘">Dashboard</a> •
|
|
19
23
|
<a href="#多-uni-管理">多 Uni 管理</a> •
|
|
24
|
+
<a href="#agency-agents-桥接">Agency-Agents</a> •
|
|
20
25
|
<a href="./DESIGN.md">设计文档</a>
|
|
21
26
|
</p>
|
|
22
27
|
|
|
@@ -48,6 +53,16 @@ npx create-uni my-universe
|
|
|
48
53
|
npx create-uni my-universe --template competitive
|
|
49
54
|
```
|
|
50
55
|
|
|
56
|
+
### 全局安装 CLI
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g @agents-uni/core
|
|
60
|
+
|
|
61
|
+
# 之后可以直接使用 uni 命令
|
|
62
|
+
uni validate universe.yaml
|
|
63
|
+
uni dashboard
|
|
64
|
+
```
|
|
65
|
+
|
|
51
66
|
### 作为库使用
|
|
52
67
|
|
|
53
68
|
```bash
|
|
@@ -214,6 +229,8 @@ npx create-uni my-project --template competitive
|
|
|
214
229
|
|
|
215
230
|
## 命令行工具
|
|
216
231
|
|
|
232
|
+
全局安装后可直接使用 `uni` 命令,也可通过 `npx @agents-uni/core` 调用:
|
|
233
|
+
|
|
217
234
|
```bash
|
|
218
235
|
# 验证组织规范
|
|
219
236
|
uni validate universe.yaml
|
|
@@ -231,20 +248,30 @@ uni deploy universe.yaml --dir ./workspaces --lang zh
|
|
|
231
248
|
# 交互式初始化项目
|
|
232
249
|
uni init
|
|
233
250
|
|
|
234
|
-
#
|
|
251
|
+
# 启动 Dashboard 仪表盘
|
|
235
252
|
uni dashboard [--port 8089]
|
|
236
253
|
|
|
237
|
-
#
|
|
254
|
+
# 列出所有已注册的 Universe
|
|
238
255
|
uni list
|
|
239
256
|
|
|
240
|
-
#
|
|
257
|
+
# 查看已部署的 Uni / Agent 概览
|
|
241
258
|
uni status
|
|
242
259
|
|
|
243
|
-
#
|
|
260
|
+
# 清理一个 Universe(删除所有相关文件 + 注册信息)
|
|
244
261
|
uni cleanup <id>
|
|
245
262
|
|
|
246
|
-
#
|
|
263
|
+
# 重置一个 Universe(清除运行时数据,保留配置)
|
|
247
264
|
uni reset <id>
|
|
265
|
+
|
|
266
|
+
# 🆕 agency-agents 桥接
|
|
267
|
+
uni agency init # 下载 agency-agents 仓库
|
|
268
|
+
uni agency list # 查看可用分类
|
|
269
|
+
uni agency update # 拉取最新
|
|
270
|
+
uni agency import engineering design # 按分类导入
|
|
271
|
+
uni agency import all --name full-team # 导入全部
|
|
272
|
+
|
|
273
|
+
# 从原始目录导入(高级用法)
|
|
274
|
+
uni import ./path/to/agents/ --name my-team
|
|
248
275
|
```
|
|
249
276
|
|
|
250
277
|
| 命令 | 说明 |
|
|
@@ -259,14 +286,22 @@ uni reset <id>
|
|
|
259
286
|
| `uni status` | 查看已部署的 Uni / Agent 概览 |
|
|
260
287
|
| `uni cleanup <id>` | 清理一个 Universe 及其所有文件 |
|
|
261
288
|
| `uni reset <id>` | 重置运行时数据,保留 SOUL.md 等配置 |
|
|
289
|
+
| `uni agency init` | 下载 agency-agents 仓库到本地 |
|
|
290
|
+
| `uni agency list` | 查看可用分类和 Agent 数量 |
|
|
291
|
+
| `uni agency update` | 拉取 agency-agents 最新更新 |
|
|
292
|
+
| `uni agency import` | 按分类名导入 Agent 到 universe.yaml |
|
|
293
|
+
| `uni import` | 从原始目录路径导入 Agent(高级用法) |
|
|
262
294
|
|
|
263
295
|
## OpenClaw 桥接
|
|
264
296
|
|
|
265
297
|
agents-uni-core 通过**文件协议**与 [OpenClaw](https://github.com/anthropics/openclaw) 无缝集成。包含三个核心能力:
|
|
266
298
|
|
|
267
299
|
**1. SOUL.md 部署** — 从组织规范生成 Agent 人格文件并部署到 OpenClaw 工作区,同时创建 Agent 运行时目录(`agents/{id}/agent/` + `agents/{id}/sessions/`)
|
|
300
|
+
|
|
268
301
|
**2. 一键注册** — 部署时自动将 Agent 注册到 `openclaw.json`(含 `workspace` 和 `agentDir` 字段),无需手动配置
|
|
302
|
+
|
|
269
303
|
**3. 任务调度** — 通过 `TASK.md` / `SUBMISSION.md` 文件协议与 Agent 交互
|
|
304
|
+
|
|
270
305
|
**4. 工作区管理** — 检查和同步 OpenClaw 工作区状态
|
|
271
306
|
|
|
272
307
|
```
|
|
@@ -437,6 +472,115 @@ import {
|
|
|
437
472
|
| 更新 | `updateUni()` | 重新部署 SOUL.md,处理新增/移除的 Agent |
|
|
438
473
|
| 清理 | `uni cleanup <id>` | 删除工作区目录 + Agent 目录 + 从 openclaw.json 移除 + 从注册中心移除 |
|
|
439
474
|
|
|
475
|
+
## Agency-Agents 桥接
|
|
476
|
+
|
|
477
|
+
agents-uni-core 内置了对 [agency-agents](https://github.com/msitarzewski/agency-agents) 项目的桥接支持。agency-agents 是一个高质量的 Agent 人格模板库(140+ 个 Agent),覆盖工程、设计、营销、销售、产品、测试等 14 个领域。
|
|
478
|
+
|
|
479
|
+
通过桥接,你可以**一键将这些 Agent 导入 agents-uni**,自动转换为 `universe.yaml` 并部署到 OpenClaw。
|
|
480
|
+
|
|
481
|
+
### 初始化
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# 下载 agency-agents 到 ~/.agents-uni/agency-agents/(仅需一次)
|
|
485
|
+
uni agency init
|
|
486
|
+
|
|
487
|
+
# 查看可用分类
|
|
488
|
+
uni agency list
|
|
489
|
+
|
|
490
|
+
# 拉取最新更新
|
|
491
|
+
uni agency update
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### 按分类导入
|
|
495
|
+
|
|
496
|
+
```bash
|
|
497
|
+
# 导入工程团队(23 个 Agent)
|
|
498
|
+
uni agency import engineering
|
|
499
|
+
|
|
500
|
+
# 同时导入多个分类
|
|
501
|
+
uni agency import engineering design marketing
|
|
502
|
+
|
|
503
|
+
# 导入全部 140+ 个 Agent
|
|
504
|
+
uni agency import all --name full-team --type hybrid
|
|
505
|
+
|
|
506
|
+
# 导入并直接部署 SOUL.md 到 OpenClaw
|
|
507
|
+
uni agency import engineering --name my-eng --deploy --deploy-dir ~/.openclaw
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### 编程式调用
|
|
511
|
+
|
|
512
|
+
```typescript
|
|
513
|
+
import {
|
|
514
|
+
agencyInit,
|
|
515
|
+
agencyUpdate,
|
|
516
|
+
agencyListCategories,
|
|
517
|
+
resolveAgencyCategories,
|
|
518
|
+
importAgencyAgents,
|
|
519
|
+
toSoulMd,
|
|
520
|
+
} from '@agents-uni/core';
|
|
521
|
+
|
|
522
|
+
// 1. 初始化(首次)
|
|
523
|
+
agencyInit();
|
|
524
|
+
|
|
525
|
+
// 2. 列出分类
|
|
526
|
+
const categories = agencyListCategories();
|
|
527
|
+
// [{ name: 'engineering', agentCount: 23, path: '...' }, ...]
|
|
528
|
+
|
|
529
|
+
// 3. 按分类导入
|
|
530
|
+
const dirs = resolveAgencyCategories(['engineering', 'design']);
|
|
531
|
+
const result = importAgencyAgents(dirs, {
|
|
532
|
+
name: 'my-team',
|
|
533
|
+
type: 'competitive',
|
|
534
|
+
relationships: 'peer',
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
// result.config → UniverseConfig (可直接部署)
|
|
538
|
+
// result.agents → 解析后的 Agent 数据 (含原始人格)
|
|
539
|
+
console.log(`导入了 ${result.agents.length} 个 Agent`);
|
|
540
|
+
|
|
541
|
+
// 4. 生成保留原始人格的 SOUL.md
|
|
542
|
+
for (const agent of result.agents) {
|
|
543
|
+
const soul = toSoulMd(agent, { universe: result.config, language: 'zh' });
|
|
544
|
+
// soul 包含 agency-agents 原始人格 + agents-uni 组织上下文
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// 5. 定期更新
|
|
548
|
+
const updateResult = agencyUpdate();
|
|
549
|
+
if (updateResult.updated) {
|
|
550
|
+
console.log(`更新: ${updateResult.oldCommit} → ${updateResult.newCommit}`);
|
|
551
|
+
}
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### 数据存储
|
|
555
|
+
|
|
556
|
+
```
|
|
557
|
+
~/.agents-uni/
|
|
558
|
+
├── agency-agents/ ← agency-agents 仓库(git clone)
|
|
559
|
+
│ ├── engineering/ ← 23 个工程 Agent
|
|
560
|
+
│ ├── design/ ← 8 个设计 Agent
|
|
561
|
+
│ ├── marketing/ ← 27 个营销 Agent
|
|
562
|
+
│ └── ... ← 共 14 个分类
|
|
563
|
+
└── agency-meta.json ← 安装和更新元数据
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### 可用分类
|
|
567
|
+
|
|
568
|
+
| 分类 | Agent 数 | 包含 |
|
|
569
|
+
|------|---------|------|
|
|
570
|
+
| engineering | 23 | Backend Architect, Frontend Developer, DevOps, SRE, Security Engineer... |
|
|
571
|
+
| marketing | 27 | SEO Specialist, TikTok/Douyin Strategist, Growth Hacker, Content Creator... |
|
|
572
|
+
| specialized | 27 | Blockchain Auditor, Compliance Auditor, MCP Builder, Salesforce Architect... |
|
|
573
|
+
| design | 8 | UI Designer, UX Architect, Brand Guardian, Visual Storyteller... |
|
|
574
|
+
| sales | 8 | Deal Strategist, Outbound Strategist, Pipeline Analyst, Sales Coach... |
|
|
575
|
+
| testing | 8 | API Tester, Performance Benchmarker, Accessibility Auditor... |
|
|
576
|
+
| paid-media | 7 | PPC Strategist, Paid Social, Programmatic Buyer, Ad Creative... |
|
|
577
|
+
| support | 6 | Analytics Reporter, Finance Tracker, Legal Compliance... |
|
|
578
|
+
| spatial-computing | 6 | visionOS Engineer, XR Developer, Terminal Integration... |
|
|
579
|
+
| project-management | 6 | Jira Steward, Project Shepherd, Studio Producer... |
|
|
580
|
+
| academic | 5 | Anthropologist, Historian, Psychologist, Narratologist... |
|
|
581
|
+
| product | 5 | Product Manager, Sprint Prioritizer, Feedback Synthesizer... |
|
|
582
|
+
| game-development | 5 | Game Designer, Level Designer, Narrative Designer, Audio Engineer... |
|
|
583
|
+
|
|
440
584
|
## 架构
|
|
441
585
|
|
|
442
586
|
```
|
|
@@ -528,6 +672,14 @@ import {
|
|
|
528
672
|
TaskDispatcher, // 下发 TASK.md → 收集 SUBMISSION.md
|
|
529
673
|
FileWorkspaceIO, // 文件系统 I/O 后端
|
|
530
674
|
MemoryWorkspaceIO, // 内存 I/O 后端(用于测试)
|
|
675
|
+
|
|
676
|
+
// 🆕 Agency-agents 桥接
|
|
677
|
+
agencyInit, // 下载 agency-agents 仓库
|
|
678
|
+
agencyUpdate, // 拉取最新更新
|
|
679
|
+
agencyListCategories, // 列出可用分类
|
|
680
|
+
resolveAgencyCategories, // 分类名 → 目录路径
|
|
681
|
+
importAgencyAgents, // 批量导入并生成 UniverseConfig
|
|
682
|
+
toSoulMd, // 生成保留原始人格的 SOUL.md
|
|
531
683
|
} from '@agents-uni/core';
|
|
532
684
|
```
|
|
533
685
|
|
|
@@ -552,11 +704,11 @@ agents-uni-core/
|
|
|
552
704
|
core/ # 运行时引擎(Universe, Registry, Graph, StateMachine, ...)
|
|
553
705
|
evolution/ # 自优化(Performance, Promotion, Memory, ...)
|
|
554
706
|
spec/ # YAML 解析、验证、编译
|
|
555
|
-
bridge/ # OpenClaw 桥接(SOUL.md 生成、任务调度、工作区 I/O、Uni
|
|
707
|
+
bridge/ # OpenClaw 桥接(SOUL.md 生成、任务调度、工作区 I/O、Uni 注册中心、agency-agents 桥接)
|
|
556
708
|
dashboard/ # 🆕 Dashboard 仪表盘(Hono 服务器、HTML 模板、API 路由、扩展机制)
|
|
557
709
|
schema/ # JSON Schema 验证
|
|
558
710
|
templates/ # 5 种内置组织模板
|
|
559
|
-
cli/ # 命令行工具(
|
|
711
|
+
cli/ # 命令行工具(15 个命令)
|
|
560
712
|
create-uni/ # npx create-uni 脚手架工具
|
|
561
713
|
tests/ # 单元测试(41 个测试,7 个套件)
|
|
562
714
|
```
|
|
@@ -582,7 +734,7 @@ npm run dev
|
|
|
582
734
|
|
|
583
735
|
## 相关项目
|
|
584
736
|
|
|
585
|
-
- [**@agents-uni/zhenhuan**](https://github.com/agents-uni/zhenhuan) — 基于 agents-uni-core 的甄嬛后宫 Agent 竞技系统
|
|
737
|
+
- [**@agents-uni/zhenhuan**](https://github.com/agents-uni/zhenhuan) — 基于 agents-uni-core 的甄嬛后宫 Agent 竞技系统 ([npm](https://www.npmjs.com/package/@agents-uni/zhenhuan))
|
|
586
738
|
|
|
587
739
|
## License
|
|
588
740
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agency-Agents Bridge
|
|
3
|
+
*
|
|
4
|
+
* 导入 agency-agents 项目的 Agent .md 文件,转换为 agents-uni 的
|
|
5
|
+
* AgentDefinition + SOUL.md 格式,让 193 个高质量 Agent 人格为我所用。
|
|
6
|
+
*
|
|
7
|
+
* 支持两种用法:
|
|
8
|
+
* 1. CLI: `uni import ./path/to/agency-agents/engineering/ --name my-team`
|
|
9
|
+
* 2. API: `importAgencyAgents('./engineering/', { name: 'my-team' })`
|
|
10
|
+
*/
|
|
11
|
+
import type { AgentDefinition, UniverseConfig } from '../types/index.js';
|
|
12
|
+
export interface AgencyAgentFrontmatter {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
emoji?: string;
|
|
16
|
+
color?: string;
|
|
17
|
+
vibe?: string;
|
|
18
|
+
services?: Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
url: string;
|
|
21
|
+
tier: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export interface AgencyAgentFile {
|
|
25
|
+
/** File path */
|
|
26
|
+
filePath: string;
|
|
27
|
+
/** Parsed YAML frontmatter */
|
|
28
|
+
frontmatter: AgencyAgentFrontmatter;
|
|
29
|
+
/** Full markdown body (after frontmatter) */
|
|
30
|
+
body: string;
|
|
31
|
+
/** Extracted sections by header */
|
|
32
|
+
sections: Map<string, string>;
|
|
33
|
+
/** Derived agent ID (from filename) */
|
|
34
|
+
id: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ImportOptions {
|
|
37
|
+
/** Universe name */
|
|
38
|
+
name?: string;
|
|
39
|
+
/** Universe type */
|
|
40
|
+
type?: 'hierarchical' | 'flat' | 'competitive' | 'hybrid';
|
|
41
|
+
/** Default rank for imported agents (0-100) */
|
|
42
|
+
defaultRank?: number;
|
|
43
|
+
/** Category/department to assign (derived from directory name if omitted) */
|
|
44
|
+
department?: string;
|
|
45
|
+
/** Whether to infer traits from agent content */
|
|
46
|
+
inferTraits?: boolean;
|
|
47
|
+
/** Language for generated content */
|
|
48
|
+
language?: 'zh' | 'en';
|
|
49
|
+
/** Relationship strategy between imported agents */
|
|
50
|
+
relationships?: 'none' | 'peer' | 'competitive';
|
|
51
|
+
}
|
|
52
|
+
export interface ImportResult {
|
|
53
|
+
/** Generated UniverseConfig */
|
|
54
|
+
config: UniverseConfig;
|
|
55
|
+
/** Parsed agent files (for SOUL.md generation) */
|
|
56
|
+
agents: AgencyAgentFile[];
|
|
57
|
+
/** Warnings encountered during import */
|
|
58
|
+
warnings: string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parse a single agency-agents .md file
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseAgencyAgentFile(filePath: string): AgencyAgentFile;
|
|
64
|
+
/**
|
|
65
|
+
* Convert an AgencyAgentFile to an agents-uni AgentDefinition
|
|
66
|
+
*/
|
|
67
|
+
export declare function toAgentDefinition(agent: AgencyAgentFile, opts?: {
|
|
68
|
+
rank?: number;
|
|
69
|
+
department?: string;
|
|
70
|
+
inferTraits?: boolean;
|
|
71
|
+
}): AgentDefinition;
|
|
72
|
+
/**
|
|
73
|
+
* Generate a SOUL.md that preserves the original agency-agents personality
|
|
74
|
+
* and wraps it with agents-uni organizational context
|
|
75
|
+
*/
|
|
76
|
+
export declare function toSoulMd(agent: AgencyAgentFile, opts?: {
|
|
77
|
+
universe?: UniverseConfig;
|
|
78
|
+
language?: 'zh' | 'en';
|
|
79
|
+
}): string;
|
|
80
|
+
/**
|
|
81
|
+
* Import all .md agents from a directory (or multiple directories)
|
|
82
|
+
* and generate a UniverseConfig
|
|
83
|
+
*/
|
|
84
|
+
export declare function importAgencyAgents(dirs: string | string[], opts?: ImportOptions): ImportResult;
|
|
85
|
+
//# sourceMappingURL=agency-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agency-import.d.ts","sourceRoot":"","sources":["../../src/bridge/agency-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIzE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,eAAe;IAC9B,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,WAAW,EAAE,sBAAsB,CAAC;IACpC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,aAAa;IAC5B,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,IAAI,CAAC,EAAE,cAAc,GAAG,MAAM,GAAG,aAAa,GAAG,QAAQ,CAAC;IAC1D,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;CACjD;AAED,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,kDAAkD;IAClD,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAID;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CActE;AAwED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,IAAI,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GACnE,eAAe,CAuCjB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,eAAe,EACtB,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,GAC3D,MAAM,CAiDR;AAID;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EACvB,IAAI,CAAC,EAAE,aAAa,GACnB,YAAY,CA8Gd"}
|