@compass-aiden/neo 0.2.1 → 0.2.3
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 +15 -7
- package/dist/cli-util.d.ts +21 -0
- package/dist/cli.d.ts +15 -3
- package/dist/index.js +3992 -885
- package/dist/index.js.map +4 -4
- package/dist/model-command.d.ts +7 -0
- package/dist/prompts.d.ts +63 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @compass-aiden/neo
|
|
2
2
|
|
|
3
|
-
跨 Agent 技能角色管理 CLI(bin: `neo`)——用「角色(role)」为不同的 AI agent
|
|
3
|
+
跨 Agent 技能角色管理 CLI(bin: `neo`)——用「角色(role)」为不同的 AI agent 提供不同的技能集与系统提示词,继承全局底座(`roles/default`),底层安装复用 [`npx skills`](https://github.com/vercel-labs/skills)。
|
|
4
|
+
|
|
5
|
+
0.2 起默认是**启动隔离**:`neo run <agent>` 为 `角色 × agent` 物化独立的配置根,不写用户全局目录;`neo use <role> --global` 才回到 0.1.x 的全局挂载。
|
|
4
6
|
|
|
5
7
|
## 安装
|
|
6
8
|
|
|
@@ -14,12 +16,18 @@ npm i -g @compass-aiden/neo # 满意再全局安装
|
|
|
14
16
|
## 快速上手
|
|
15
17
|
|
|
16
18
|
```pwsh
|
|
17
|
-
neo
|
|
18
|
-
neo add anthropics/skills
|
|
19
|
+
neo init # 写 ~/.neo/config.yaml;发现存量技能会问是否导入
|
|
20
|
+
neo add anthropics/skills --skill pdf # 往全局底座角色 default 装技能(也接受 -s)
|
|
19
21
|
neo create writer # 建一个新角色
|
|
20
|
-
neo add anthropics/skills
|
|
21
|
-
neo use writer #
|
|
22
|
-
neo
|
|
22
|
+
neo add anthropics/skills --skill docx --role writer
|
|
23
|
+
neo use writer # 把 writer 设为默认(不触任何 agent 全局目录)
|
|
24
|
+
neo run claude-code # 以隔离配置根启动:技能/提示词/MCP/登录态都在根内
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
- `neo add <source>` 不给 `--skill/-s` 时:TTY 下列出来源技能多选(单技能直接装);非 TTY 必须显式给 flag 或 `-l`。
|
|
28
|
+
- 模型/网关:`neo model provider add litellm --base-url https://gw.example/v1 --api-key env:LITELLM_API_KEY` 读一次 `/v1/models` 建清单;`neo model edit/use/refresh` 调整;`neo run` 时按 Pi/DSH/Codex/Claude 各自格式渲染。
|
|
29
|
+
- `neo init` 会扫描 `~/.agents/skills` 与各 agent 技能目录:有存量技能时询问导入 `default`(所有角色继承)或一个新角色;拒绝则原样不动。
|
|
30
|
+
- 想自己控制收编节奏:`neo migrate`(预览)→ `neo migrate --scan-agents --apply`。
|
|
31
|
+
- 仍需要 0.1 的全局挂载:`neo use writer --global`;卸载:`neo off --global`。
|
|
32
|
+
|
|
33
|
+
全部命令与约定见 `neo --help`;完整文档见 [主仓库](https://github.com/Aiden-FE/neo)。
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CliDeps } from './cli.js';
|
|
2
|
+
/**
|
|
3
|
+
* CLI 参数与家目录小工具(从 cli.ts 抽出,供 `model` 命令复用)。
|
|
4
|
+
* 保持零领域逻辑:只做 argv 解析与家目录解析。
|
|
5
|
+
*/
|
|
6
|
+
/** 参数解析结果:位置参数 + 可重复带值 flag + 布尔 flag。 */
|
|
7
|
+
export interface ParsedArgs {
|
|
8
|
+
positionals: string[];
|
|
9
|
+
flags: Map<string, string[]>;
|
|
10
|
+
bools: Set<string>;
|
|
11
|
+
}
|
|
12
|
+
export interface ArgSpec {
|
|
13
|
+
valued: ReadonlySet<string>;
|
|
14
|
+
boolean: ReadonlySet<string>;
|
|
15
|
+
}
|
|
16
|
+
export declare function parseArgs(argv: readonly string[], spec: ArgSpec): ParsedArgs;
|
|
17
|
+
/** Boolean flag set plus the global no-op `--yes` (accepted everywhere; consumed by destructive commands). */
|
|
18
|
+
export declare function boolFlags(...names: readonly string[]): Set<string>;
|
|
19
|
+
export declare function resolveHome(deps: CliDeps): string;
|
|
20
|
+
export declare function expectSinglePositional(parsed: ParsedArgs, usage: string): string;
|
|
21
|
+
export declare function lastFlag(parsed: ParsedArgs, name: string): string | undefined;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PromptPort } from './prompts.js';
|
|
2
|
+
import { type DetectPort, type ExecPort, type LaunchPlan, type SourceSkillOption, type FetchPort } from '@compass-aiden/neo-core';
|
|
2
3
|
/**
|
|
3
4
|
* CLI 薄层(票 09 终稿):参数解析 + 输出;领域逻辑全在 core(注入 io 与 deps,测试零网络零真实家目录)。
|
|
4
5
|
* 退出码(决策票 10):0 成功;1 业务失败(含部分失败/环境态);2 用法错误(含 init 非 TTY)。
|
|
@@ -20,8 +21,19 @@ export interface CliDeps {
|
|
|
20
21
|
stagingRoot?: string;
|
|
21
22
|
/** remove 确认 / init 引导:当前是否交互终端(缺省 process.stdout.isTTY)。 */
|
|
22
23
|
isTty?: boolean;
|
|
23
|
-
/** remove
|
|
24
|
-
confirm?: (question: string) => Promise<boolean>;
|
|
24
|
+
/** remove/init 确认(缺省 clack confirm;测试注入)。 */
|
|
25
|
+
confirm?: (question: string, initialValue?: boolean) => Promise<boolean>;
|
|
26
|
+
/** init 的文本提问(缺省 clack text,空输入回退 fallback;测试注入)。 */
|
|
27
|
+
ask?: (question: string, fallback: string) => Promise<string>;
|
|
28
|
+
/** neo model:读取 /v1/models 的端口(缺省全局 fetch;测试注入,零网络)。 */
|
|
29
|
+
fetchModels?: FetchPort;
|
|
30
|
+
/** neo model:交互端口(缺省 clack;测试注入,零真实终端)。 */
|
|
31
|
+
prompts?: PromptPort;
|
|
32
|
+
/** add 无 -s 时的多选(缺省 clack multiselect;测试注入)。返回空数组 = 未勾选(不是取消)。 */
|
|
33
|
+
selectSkills?: (options: readonly SourceSkillOption[], context: {
|
|
34
|
+
role: string;
|
|
35
|
+
installed: readonly string[];
|
|
36
|
+
}) => Promise<string[]>;
|
|
25
37
|
/** 工作目录(项目绑定 cwd 上溯发现基准;缺省 process.cwd())。 */
|
|
26
38
|
cwd?: string;
|
|
27
39
|
/** agent 探测端口(init 建议 / list agents 探测态;缺省 node 实现 = fs + PATH)。 */
|