Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions bin/multiagent-safety.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ const CLI_COMMAND_DESCRIPTIONS = [
['help', 'Show this help output'],
['version', 'Print GuardeX version'],
];
const AGENT_BOT_DESCRIPTIONS = [
['review', 'Monitor open PRs targeting current branch and dispatch codex-agent review flow'],
['start', 'bash scripts/review-bot-watch.sh --interval 30'],
];

const AI_SETUP_PROMPT = `Use this exact checklist to setup GuardeX (Guardian T-Rex for your repo) in this repository for Codex or Claude.

Expand Down Expand Up @@ -261,9 +265,20 @@ function commandCatalogLines(indent = ' ') {
);
}

function agentBotCatalogLines(indent = ' ') {
const maxCommandLength = AGENT_BOT_DESCRIPTIONS.reduce(
(max, [command]) => Math.max(max, command.length),
0,
);
return AGENT_BOT_DESCRIPTIONS.map(
([command, description]) => `${indent}${command.padEnd(maxCommandLength + 2)}${description}`,
);
}

function printToolLogsSummary() {
const usageLine = ` $ ${SHORT_TOOL_NAME} <command> [options]`;
const commandDetails = commandCatalogLines(' ');
const agentBotDetails = agentBotCatalogLines(' ');

if (!supportsAnsiColors()) {
console.log(`${TOOL_NAME}-tools logs:`);
Expand All @@ -273,12 +288,17 @@ function printToolLogsSummary() {
for (const line of commandDetails) {
console.log(line);
}
console.log(' AGENT BOT');
for (const line of agentBotDetails) {
console.log(line);
}
return;
}

const title = colorize(`${TOOL_NAME}-tools logs`, '1;36');
const usageHeader = colorize('USAGE', '1');
const commandsHeader = colorize('COMMANDS', '1');
const agentBotHeader = colorize('AGENT BOT', '1');
const pipe = colorize('│', '90');
const tee = colorize('├', '90');
const corner = colorize('└', '90');
Expand All @@ -294,6 +314,14 @@ function printToolLogsSummary() {
}
console.log(` ${pipe}${line.slice(2)}`);
}
console.log(` ${tee}─ ${agentBotHeader}`);
for (const line of agentBotDetails) {
if (!line) {
console.log(` ${pipe}`);
continue;
}
console.log(` ${pipe}${line.slice(2)}`);
}
console.log(` ${corner}─ ${colorize(`Try '${TOOL_NAME} doctor' for one-step repair + verification.`, '2')}`);
}

Expand All @@ -311,6 +339,9 @@ USAGE
COMMANDS
${commandCatalogLines().join('\n')}

AGENT BOT
${agentBotCatalogLines().join('\n')}

NOTES
- Running ${TOOL_NAME} with no command defaults to: ${SHORT_TOOL_NAME} status
- Short alias: ${SHORT_TOOL_NAME}
Expand Down
5 changes: 5 additions & 0 deletions test/install.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,11 @@ test('default invocation runs non-mutating status output', () => {
assert.match(result.stdout, /guardex-tools logs:/);
assert.match(result.stdout, /USAGE\n\s+\$ gx <command> \[options\]/);
assert.match(result.stdout, /COMMANDS\n\s+status\s+Show GuardeX CLI \+ service health without modifying files/);
assert.match(
result.stdout,
/AGENT BOT\n\s+review\s+Monitor open PRs targeting current branch and dispatch codex-agent review flow/,
);
assert.match(result.stdout, /AGENT BOT[\s\S]*\n\s+start\s+bash scripts\/review-bot-watch\.sh --interval 30/);
assert.equal(fs.existsSync(path.join(repoDir, '.githooks', 'pre-commit')), false);
});

Expand Down
Loading