MCPcopy Create free account
hub / github.com/SethGammon/Citadel / render

Function render

scripts/continue-action.js:103–122  ·  view source on GitHub ↗
(action, runResult = null)

Source from the content-addressed store, hash-verified

101}
102
103function render(action, runResult = null) {
104 const lines = [
105 'Continue Action',
106 '='.repeat(40),
107 `Kind: ${action.kind}`,
108 `Label: ${action.label}`,
109 `Command: ${action.command || '(none)'}`,
110 `Why: ${action.why}`,
111 `Runbook: ${action.runbook}`,
112 ];
113 if (runResult && runResult.executed) {
114 lines.push(`Executed: yes`);
115 lines.push(`Exit Code: ${runResult.status}`);
116 if (runResult.stdout.trim()) lines.push(runResult.stdout.trim());
117 if (runResult.stderr.trim()) lines.push(runResult.stderr.trim());
118 } else if (runResult) {
119 lines.push('Executed: no');
120 }
121 return `${lines.join('\n')}\n`;
122}
123
124function main() {
125 const args = parseArgs(process.argv.slice(2));

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected