MCPcopy Index your code
hub / github.com/FIND-Lab/AgentWard / formatBasic

Function formatBasic

core/warnings.ts:41–53  ·  view source on GitHub ↗
(error: Warning | Warning[], header = "⚠️System Warning:")

Source from the content-addressed store, hash-verified

39}
40
41export function formatBasic(error: Warning | Warning[], header = "⚠️System Warning:"): string {
42 if (Array.isArray(error)) {
43 if (error)
44 return error.map((e) => formatBasic(e, header)).join('\n');
45 return `${header} Same reason as above`;
46 }
47 else {
48 let baseMessage = `${header} ${error.type}\n${error.description}`;
49 if (error.details)
50 baseMessage = `${baseMessage}\n${error.details}`
51 return baseMessage;
52 }
53}
54
55export function formatCoverAssistantWarning(error: Warning | Warning[]): string {
56 return `SYSTEM WARNING RECEIVED❗\n${formatBasic(error)}\nSorry, current task have been halted. Please rephrase and try again.`;

Callers 5

formatToolResultWarningFunction · 0.85
formatToolCallWarningFunction · 0.85
formatUserPrependWarningFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected