@twinsearth/au4a 1.0.10
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.md +35 -0
- package/bin/au4a.js +53 -0
- package/docs/DESIGN.md +1196 -0
- package/docs/DEV.md +256 -0
- package/docs/KNOWLEDGE-BASE.md +122 -0
- package/docs/OBSERVER.md +59 -0
- package/docs/PRINCIPLES.md +49 -0
- package/docs/VERIFICATION.md +38 -0
- package/meta.json +78 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @twinsearth/au4a — AU4A (Agents-UniverseForAgent)
|
|
2
|
+
|
|
3
|
+
> **一切为智能体服务。人类用户兼任观察者,只展示进度、结果与收益。**
|
|
4
|
+
|
|
5
|
+
本包是 AU4A 的 **中版本 v1.0.10** 分发:
|
|
6
|
+
版本区间 `v1.0.1 → v1.9.9` | 10 个中版本 × 99 个小版本 | 仓库 <https://github.com/TwinsEarth/AU4A>
|
|
7
|
+
|
|
8
|
+
## 用法
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx @twinsearth/au4a@1.0.10 version # 版本与元数据
|
|
12
|
+
npx @twinsearth/au4a@1.0.10 meta # 机器可读元数据(轨道 / 证据分级 / 实测断言数)
|
|
13
|
+
npx @twinsearth/au4a@1.0.10 docs # 设计文档与开发文档路径
|
|
14
|
+
npx @twinsearth/au4a@1.0.10 verify # 聚合 10 条轨道自检(需本机有源码树或已装 au4a-node)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
launcher 不假装实现了内核:真正的实现在 Rust crate 里。它会依次尝试
|
|
18
|
+
① 已安装的 `au4a-node`,② 当前目录若为 AU4A 源码树则用 `cargo run --release -p au4a-node`,
|
|
19
|
+
③ 都没有时打印安装指引(退出码 127)。
|
|
20
|
+
|
|
21
|
+
## 包含的文档
|
|
22
|
+
|
|
23
|
+
| 文件 | 内容 |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `docs/DESIGN.md` | 设计文档:10 个中版本 + 99 个小版本逐项 |
|
|
26
|
+
| `docs/DEV.md` | 开发文档:10 条轨道并行、轨道内串行、部署验证矩阵 |
|
|
27
|
+
| `docs/VERIFICATION.md` | 实测记录:10 个中版本分步部署(构建 / 自检 / 端到端 / 只读面板 405 探针) |
|
|
28
|
+
| `docs/PRINCIPLES.md` | 十条设计原则 |
|
|
29
|
+
| `docs/OBSERVER.md` | 人类观察层:只读性如何被结构强制 |
|
|
30
|
+
|
|
31
|
+
## 人类只做三件事
|
|
32
|
+
|
|
33
|
+
进度 / 结果 / 收益 —— 三个只读面板,非 GET 一律 405(`crates/au4a-node/src/observer.rs` 有结构性测试证明)。
|
|
34
|
+
|
|
35
|
+
MIT © TwinsEarth
|
package/bin/au4a.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// AU4A launcher:把「跑 Agent 网络 / 看只读面板 / 校验 10 条轨道」带到一个命令上。
|
|
3
|
+
// 它不假装自己实现了内核:真正的实现在 Rust crate 里,这里只负责找到它并交棒。
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
6
|
+
import { dirname, join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const meta = JSON.parse(readFileSync(join(here, '..', 'meta.json'), 'utf8'));
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
|
|
13
|
+
if (args[0] === '--version' || args[0] === '-v' || args[0] === 'version') {
|
|
14
|
+
console.log(`au4a ${meta.package_version} (${meta.full_name})`);
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
if (args[0] === 'meta' || args[0] === 'info') {
|
|
18
|
+
console.log(JSON.stringify(meta, null, 2));
|
|
19
|
+
process.exit(0);
|
|
20
|
+
}
|
|
21
|
+
if (args[0] === 'docs') {
|
|
22
|
+
console.log('设计文档: ' + join(here, '..', 'docs', 'DESIGN.md'));
|
|
23
|
+
console.log('开发文档: ' + join(here, '..', 'docs', 'DEV.md'));
|
|
24
|
+
console.log('仓库: ' + meta.repository);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const passthrough = ['run', 'observe', 'verify', 'tracks'];
|
|
29
|
+
const rest = args.length ? args : ['verify'];
|
|
30
|
+
|
|
31
|
+
// 1) 已安装的 au4a-node
|
|
32
|
+
const direct = spawnSync('au4a-node', rest, { stdio: 'inherit' });
|
|
33
|
+
if (!direct.error) process.exit(direct.status ?? 0);
|
|
34
|
+
|
|
35
|
+
// 2) 当前目录是一个 AU4A 源码树 -> 用 cargo 跑
|
|
36
|
+
if (existsSync(join(process.cwd(), 'Cargo.toml'))) {
|
|
37
|
+
const cargo = spawnSync('cargo', ['run', '--release', '-p', 'au4a-node', '--', ...rest], { stdio: 'inherit' });
|
|
38
|
+
if (!cargo.error) process.exit(cargo.status ?? 0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
console.error(
|
|
42
|
+
[
|
|
43
|
+
'au4a: 没有找到 au4a-node(也没有在源码树里找到 Cargo.toml)。',
|
|
44
|
+
'',
|
|
45
|
+
'二选一:',
|
|
46
|
+
' 1) 在 AU4A 源码树里运行: cargo run --release -p au4a-node -- ' + rest.join(' '),
|
|
47
|
+
' 2) 安装平台二进制: cargo install --path crates/au4a-node',
|
|
48
|
+
'',
|
|
49
|
+
'只读观察面板: au4a-node run --agents 8 --observe 127.0.0.1:8787',
|
|
50
|
+
'仓库:' + meta.repository,
|
|
51
|
+
].join('\n'),
|
|
52
|
+
);
|
|
53
|
+
process.exit(127);
|