import { estimateTokens } from "@earendil-works/pi-coding-agent"; import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent"; import type { Breakdown } from "../types"; import { systemPromptSection } from "./system-prompt"; import { messagesSection } from "./messages"; import { toolsSection } from "./tools"; export { systemPromptSection } from "./system-prompt"; export { messagesSection } from "./messages"; export { toolsSection } from "./tools"; /** * Collects the full three-section breakdown. This is the only place that * binds pi's runtime `estimateTokens`; the individual collectors are pure and * independently testable. */ export const collectBreakdown = (pi: ExtensionAPI, ctx: ExtensionCommandContext): Breakdown => ({ system: systemPromptSection(ctx), messages: messagesSection(ctx, estimateTokens), tools: toolsSection(pi), });