fix: harden orchestration status and skill docs

This commit is contained in:
Affaan Mustafa
2026-03-12 15:07:57 -07:00
parent ddab6f1190
commit 52daf17cb5
15 changed files with 206 additions and 16 deletions

View File

@@ -20,9 +20,32 @@ function usage() {
function parseArgs(argv) {
const args = argv.slice(2);
const target = args.find(arg => !arg.startsWith('--'));
const writeIndex = args.indexOf('--write');
const writePath = writeIndex >= 0 ? args[writeIndex + 1] : null;
let target = null;
let writePath = null;
for (let index = 0; index < args.length; index += 1) {
const arg = args[index];
if (arg === '--write') {
const candidate = args[index + 1];
if (!candidate || candidate.startsWith('--')) {
throw new Error('--write requires an output path');
}
writePath = candidate;
index += 1;
continue;
}
if (arg.startsWith('--')) {
throw new Error(`Unknown flag: ${arg}`);
}
if (target) {
throw new Error('Expected a single session name or plan path');
}
target = arg;
}
return { target, writePath };
}
@@ -56,4 +79,4 @@ if (require.main === module) {
}
}
module.exports = { main };
module.exports = { main, parseArgs };