@compass-aiden/neo 0.2.2 → 0.2.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.md CHANGED
@@ -17,13 +17,16 @@ npm i -g @compass-aiden/neo # 满意再全局安装
17
17
 
18
18
  ```pwsh
19
19
  neo init # 写 ~/.neo/config.yaml;发现存量技能会问是否导入
20
- neo add anthropics/skills -s pdf # 往全局底座角色 default 装技能
20
+ neo add anthropics/skills --skill pdf # 往全局底座角色 default 装技能(也接受 -s)
21
21
  neo create writer # 建一个新角色
22
- neo add anthropics/skills -s docx --role writer
22
+ neo add anthropics/skills --skill docx --role writer
23
23
  neo use writer # 把 writer 设为默认(不触任何 agent 全局目录)
24
24
  neo run claude-code # 以隔离配置根启动:技能/提示词/MCP/登录态都在根内
25
25
  ```
26
26
 
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
+ - 不想记参数:TTY 下裸跑 `neo model provider` 进供应商菜单(新增/编辑/refresh/删除),`neo model edit|rm|use` 不给目标会先让你从清单里选;删除会列出影响面再确认。
27
30
  - `neo init` 会扫描 `~/.agents/skills` 与各 agent 技能目录:有存量技能时询问导入 `default`(所有角色继承)或一个新角色;拒绝则原样不动。
28
31
  - 想自己控制收编节奏:`neo migrate`(预览)→ `neo migrate --scan-agents --apply`。
29
32
  - 仍需要 0.1 的全局挂载:`neo use writer --global`;卸载:`neo off --global`。
@@ -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 DetectPort, type ExecPort, type LaunchPlan } from '@compass-aiden/neo-core';
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,10 +21,19 @@ export interface CliDeps {
20
21
  stagingRoot?: string;
21
22
  /** remove 确认 / init 引导:当前是否交互终端(缺省 process.stdout.isTTY)。 */
22
23
  isTty?: boolean;
23
- /** remove 确认(缺省 readline y/N;测试注入)。 */
24
- confirm?: (question: string) => Promise<boolean>;
25
- /** init 的文本提问(缺省 readline,空输入回退 fallback;测试注入)。 */
24
+ /** remove/init 确认(缺省 clack confirm;测试注入)。 */
25
+ confirm?: (question: string, initialValue?: boolean) => Promise<boolean>;
26
+ /** init 的文本提问(缺省 clack text,空输入回退 fallback;测试注入)。 */
26
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[]>;
27
37
  /** 工作目录(项目绑定 cwd 上溯发现基准;缺省 process.cwd())。 */
28
38
  cwd?: string;
29
39
  /** agent 探测端口(init 建议 / list agents 探测态;缺省 node 实现 = fs + PATH)。 */