feat(install): validate agent CLI runtime registries

This commit is contained in:
2026-09-18 16:42:09 +08:00
parent 867a23497f
commit 5a259a95af
11 changed files with 350 additions and 23 deletions
+23
View File
@@ -0,0 +1,23 @@
import { readdirSync } from 'node:fs';
import { ScriptError, onPath, packageVersion, promptsDir } from './lib.js';
/**
* 回報這一份 tea-sdlc 的版本、實際 executable 與可用流程;不連網、不改檔。
* @param {string[]} argv
* @returns {object}
*/
export function runVersion(argv) {
if (argv.length > 0) {
throw new ScriptError('UNKNOWN_FLAG', 'sdlc-version 不接受參數');
}
return {
name: 'tea-sdlc',
version: packageVersion(),
executable: onPath('tea-sdlc'),
commands: readdirSync(promptsDir())
.filter((entry) => entry.endsWith('.md'))
.map((entry) => entry.slice(0, -3))
.sort(),
};
}