@compass-aiden/neo 0.0.0-stage → 0.2.0
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 +24 -2
- package/bin/neo.js +19 -0
- package/dist/cli.d.ts +35 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6026 -0
- package/dist/index.js.map +7 -0
- package/package.json +46 -3
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @compass-aiden/neo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
跨 Agent 技能角色管理 CLI(bin: `neo`)——用「角色(role)」为不同的 AI agent 挂载不同的技能集与系统提示词,继承全局底座(`roles/default`),底层安装复用 [`npx skills`](https://github.com/vercel-labs/skills)。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
需要 Node ≥ 22。
|
|
8
|
+
|
|
9
|
+
```pwsh
|
|
10
|
+
npx @compass-aiden/neo@latest --version # 免安装直接试用
|
|
11
|
+
npm i -g @compass-aiden/neo # 满意再全局安装
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 快速上手
|
|
15
|
+
|
|
16
|
+
```pwsh
|
|
17
|
+
neo target add claude-code # 把你在用的 agent 配成挂载目标(交互式:neo init)
|
|
18
|
+
neo add anthropics/skills -s pdf # 往全局底座角色 default 装技能
|
|
19
|
+
neo create writer # 建一个新角色
|
|
20
|
+
neo add anthropics/skills -s docx --role writer
|
|
21
|
+
neo use writer # 激活:default ∪ writer 的技能挂载到目标 agent
|
|
22
|
+
neo status # 本地体检(挂载对账)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
全部命令与约定见 `neo --help`;完整文档与桌面端(Windows/macOS 安装包)见 [主仓库](https://github.com/Aiden-FE/neo)。
|
package/bin/neo.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// bin 恒指本文件(随仓库提交,install 期即存在,pnpm 才能可靠建 shim);
|
|
3
|
+
// 真正入口是构建产物 ../dist/index.js,动态 import 以便给出清晰缺构建报错。
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
const distEntry = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'dist', 'index.js');
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
await import(pathToFileURL(distEntry).href);
|
|
12
|
+
} catch (error) {
|
|
13
|
+
if (error && typeof error === 'object' && 'code' in error && error.code === 'ERR_MODULE_NOT_FOUND') {
|
|
14
|
+
process.stderr.write(`neo: 未找到构建产物 ${distEntry}\n请先运行 pnpm build。\n`);
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
} else {
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type DetectPort, type ExecPort, type LaunchPlan } from '@compass-aiden/neo-core';
|
|
2
|
+
/**
|
|
3
|
+
* CLI 薄层(票 09 终稿):参数解析 + 输出;领域逻辑全在 core(注入 io 与 deps,测试零网络零真实家目录)。
|
|
4
|
+
* 退出码(决策票 10):0 成功;1 业务失败(含部分失败/环境态);2 用法错误(含 init 非 TTY)。
|
|
5
|
+
* 输出分层:报告(含冲突/预览/dry-run 四态)→ stdout;诊断/进度/错误/用法错误 → stderr;
|
|
6
|
+
* `--help` 是用户请求的输出 → stdout + exit 0(票 01 遗留的「usage 打 stdout」已在此收口)。
|
|
7
|
+
* 注:命令依赖 fs 与子进程,runCli 为 async(bin 入口 await 后置 exitCode)。
|
|
8
|
+
*/
|
|
9
|
+
export interface CliIo {
|
|
10
|
+
stdout(text: string): void;
|
|
11
|
+
/** 票 09 收口:错误/诊断/用法错误恒走 stderr(必填)。 */
|
|
12
|
+
stderr(text: string): void;
|
|
13
|
+
}
|
|
14
|
+
export interface CliDeps {
|
|
15
|
+
env: Record<string, string | undefined>;
|
|
16
|
+
homedir: string;
|
|
17
|
+
exec: ExecPort;
|
|
18
|
+
now: () => Date;
|
|
19
|
+
/** 暂存区父目录(缺省系统 temp;测试注入)。 */
|
|
20
|
+
stagingRoot?: string;
|
|
21
|
+
/** remove 确认 / init 引导:当前是否交互终端(缺省 process.stdout.isTTY)。 */
|
|
22
|
+
isTty?: boolean;
|
|
23
|
+
/** remove 确认 / init 引导提问(缺省 readline y/N;测试注入)。 */
|
|
24
|
+
confirm?: (question: string) => Promise<boolean>;
|
|
25
|
+
/** 工作目录(项目绑定 cwd 上溯发现基准;缺省 process.cwd())。 */
|
|
26
|
+
cwd?: string;
|
|
27
|
+
/** agent 探测端口(init 建议 / list agents 探测态;缺省 node 实现 = fs + PATH)。 */
|
|
28
|
+
detect?: DetectPort;
|
|
29
|
+
/** run:真正启动 agent(缺省 stdio 继承 spawn;测试注入返回退出码)。 */
|
|
30
|
+
spawnAgent?: (plan: LaunchPlan) => Promise<number>;
|
|
31
|
+
}
|
|
32
|
+
export declare function defaultCliDeps(): CliDeps;
|
|
33
|
+
/** 主入口:返回进程退出码。全局 flag `--version` / `--help` 任意位置可识别(先于命令解析)。
|
|
34
|
+
* P1-3:所有命令(含只读)在家目录级互斥锁下执行,杜绝跨进程 read-modify-write 竞态。 */
|
|
35
|
+
export declare function runCli(argv: readonly string[], io: CliIo, deps?: CliDeps): Promise<number>;
|
package/dist/index.d.ts
ADDED