Files
oh-my-opencode/packages/agents-md-core/src/formatter.ts
T
2026-05-21 12:50:10 +09:00

16 lines
474 B
TypeScript

import {
TRUNCATION_NOTICE_PREFIX,
TRUNCATION_NOTICE_SUFFIX,
} from "./constants";
export function formatAgentsMdContextBlock(input: {
readonly agentsPath: string;
readonly content: string;
readonly truncated: boolean;
}): string {
const truncationNotice = input.truncated
? `${TRUNCATION_NOTICE_PREFIX}${input.agentsPath}${TRUNCATION_NOTICE_SUFFIX}`
: "";
return `\n\n[Directory Context: ${input.agentsPath}]\n${input.content}${truncationNotice}`;
}