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

Function renderList

scripts/loops.js:63–78  ·  view source on GitHub ↗
(loops)

Source from the content-addressed store, hash-verified

61}
62
63function renderList(loops) {
64 if (!loops.length) return 'No Citadel loops found.\n';
65 const active = loops.filter((loop) => !isTerminalStatus(loop.status));
66 const stopped = loops.filter((loop) => isTerminalStatus(loop.status));
67 const lines = [];
68 lines.push(`Citadel loops (${loops.length})`);
69 lines.push('');
70 lines.push(`Active (${active.length})`);
71 if (active.length) active.forEach((loop) => lines.push(formatLoop(loop)));
72 else lines.push(' none');
73 lines.push('');
74 lines.push(`Stopped (${stopped.length})`);
75 if (stopped.length) stopped.forEach((loop) => lines.push(formatLoop(loop)));
76 else lines.push(' none');
77 return `${lines.join('\n')}\n`;
78}
79
80function renderTemplates() {
81 const lines = ['Loop templates', ''];

Callers 1

mainFunction · 0.70

Calls 2

isTerminalStatusFunction · 0.85
formatLoopFunction · 0.85

Tested by

no test coverage detected