UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

37 lines • 1.5 kB
import { noticeEntryRenderer } from "../../notice/index.js"; import { parseRuleActivationDetails } from "./types.js"; export const renderRuleActivationEntry = noticeEntryRenderer((entry) => { const details = parseRuleActivationDetails(entry.data); if (details === undefined) return undefined; return { title: titleLine(details), why: summaryLine(details), expandedLine: detailLine(details) }; }); function titleLine(details) { switch (details.kind) { case "project-rules": return `● Project rules · ${details.targetPath}`; case "ttsr": return `⚠ Stream rule · ${details.owner}`; } } function summaryLine(details) { switch (details.kind) { case "project-rules": { const noun = details.rules.length === 1 ? "instruction" : "instructions"; return `${details.rules.length} ${noun} matched and injected for this tool result.`; } case "ttsr": return details.remediation === "nudge" ? "Output interrupted; a corrective nudge was queued." : "Corrupted generation discarded; bounded provider retry started."; } } function detailLine(details) { switch (details.kind) { case "project-rules": return details.rules.map((rule) => `rule ${rule}`).join("\n"); case "ttsr": return `remediation ${details.remediation} · observed ${details.rules.join(", ")}`; } } //# sourceMappingURL=renderer.js.map