MCPcopy Create free account
hub / github.com/MatteoGabriele/agentscan / parseIssueBody

Function parseIssueBody

scripts/parse-automation-issue.ts:23–49  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

21 createdAt: string
22 reportedBy: string
23 /** Omitted entirely when the entry was added without a recorded vote. */
24 approvedBy?: string[]
25}
26
27export type { AutomationEntry }
28
29/**
30 * The reason is shown as plain prose on the public list, so it has to stay one
31 * sentence-shaped string. Links belong in Supporting Evidence / Additional Context,
32 * where reviewers read them; reporters still paste them here, so they are stripped
33 * rather than trusted.
34 */
35export const MAX_REASON_LENGTH = 280
36
37/**
38 * Strips everything that is not sentence text: markdown images and links, bare and
39 * autolinked URLs, HTML tags, code ticks and list bullets. Link text is kept, since
40 * "self-describes as [an AI agent](url)" still reads as a reason without the URL.
41 */
42export function sanitizeReason(raw: string | undefined): string | undefined {
43 if (!raw) {
44 return raw
45 }
46
47 let reason = raw.split(/\n\s*\n/)[0]
48
49 reason = reason
50 // ![alt](url) - an image says nothing once the URL is gone
51 .replace(/!\[[^\]]*\]\([^)]*\)/g, ' ')
52 // [text](url) -> text

Callers 2

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected