MCPcopy
hub / github.com/KeygraphHQ/shannon / renderExploitDeliverable

Function renderExploitDeliverable

apps/worker/src/services/exploit-renderer.ts:178–196  ·  view source on GitHub ↗
(
  vulnClass: VulnClass,
  state: readonly AddExploitInput[],
  idToType: ReadonlyMap<string, string>,
)

Source from the content-addressed store, hash-verified

176// ============================================================================
177
178export function renderExploitDeliverable(
179 vulnClass: VulnClass,
180 state: readonly AddExploitInput[],
181 idToType: ReadonlyMap<string, string>,
182): string {
183 const title = `# ${TITLES[vulnClass]}`;
184
185 if (state.length === 0 && idToType.size === 0) {
186 const body = '*No vulnerabilities were available in the queue for exploitation.*';
187 return `${title}\n\n${body}\n`;
188 }
189
190 const exploited = state.filter((e): e is ExploitedEntry => e.status === 'exploited');
191 const blocked = state.filter((e): e is BlockedEntry => e.status === 'blocked');
192
193 const sections: string[] = [title, '', renderExploitedSection(exploited), '', renderBlockedSection(blocked)];
194
195 return `${sections.join('\n').trimEnd()}\n`;
196}

Callers 1

writeDeliverableFunction · 0.85

Calls 2

renderExploitedSectionFunction · 0.85
renderBlockedSectionFunction · 0.85

Tested by

no test coverage detected