- CliRuntime 新增 app?: "hose-use" | "hose-aipro",由 runCli 与 runAiProCli 各自标注;skill.ts 优先用它判断调用方,修复 hose-aipro skill dump 误输出 hose-use Skill 的既有 bug——根因是 multicall 二进制的 argv0 不会进入 parsed.raw。保留 raw 里的历史 aipro 标记作为兼容。 - 新增 skill.test.ts 覆盖两个入口与历史兼容三条路径。 - 补齐 4 份目录 README(scripts/build、cli/commands/aipro、web、 web/src):web/ 文件在 #177 合入后由 untracked 转为 tracked, 才被 check:readme 纳入扫描,暴露出 4 个目录缺文档。 校验:bun test 1111 pass / 0 fail,bun run check 通过, check:readme 36/36 通过;编译产物实测 hose-aipro skill dump 返回 AI PRO Skill、hose-use 返回平台 Skill。
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import type { CorpConfig } from "../core/config/types.js";
|
|
import type { CorpContext } from "../core/config/manager.js";
|
|
|
|
export interface CliParsedArgs {
|
|
area?: string;
|
|
action?: string;
|
|
args: string[];
|
|
positional?: string[];
|
|
options: Record<string, string | boolean | number>;
|
|
raw: string[];
|
|
}
|
|
|
|
export interface CliRunOptions {
|
|
/** Only terminal entrypoints supply a protocol-safe streaming destination. */
|
|
writeStdout?: (chunk: string) => Promise<void>;
|
|
appRoot?: string;
|
|
entryFile?: string;
|
|
launcher?: {
|
|
command: string;
|
|
args?: string[];
|
|
};
|
|
}
|
|
|
|
export interface CliResult {
|
|
stdout: string;
|
|
stderr: string;
|
|
exitCode: number;
|
|
preserveSensitiveStdout?: boolean;
|
|
}
|
|
|
|
export interface OutputOptions {
|
|
allowFull?: boolean;
|
|
outputFile?: string;
|
|
summary?: boolean;
|
|
}
|
|
|
|
export interface CliRuntime {
|
|
writeStdout?: (chunk: string) => Promise<void>;
|
|
corpContext: CorpContext;
|
|
selectedCorp: CorpConfig | null;
|
|
jsonMode: boolean;
|
|
dryRun?: boolean;
|
|
confirmed?: boolean;
|
|
outputOptions?: OutputOptions;
|
|
appRoot?: string;
|
|
entryFile?: string;
|
|
/** 入口身份,由 runCli / runAiProCli 显式标注,供命令层区分 multicall 调用方。 */
|
|
app?: "hose-use" | "hose-aipro";
|
|
launcher?: {
|
|
command: string;
|
|
args?: string[];
|
|
};
|
|
}
|