akm-cli
Version:
akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cur
28 lines (27 loc) • 1.29 kB
JavaScript
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
/**
* #944 — `akm improve report --format text`. Renders the SAME fixed-width
* table `formatUsageReportTable` produces for the end-of-run stderr summary
* (`improve-cli.ts`), prefixed with which run(s) it covers.
*/
import { formatUsageReportTable } from "../../commands/improve/improve-usage-report.js";
function formatImproveReportPlain(result) {
const usageReport = result.usageReport;
if (!usageReport)
return null;
const lines = [];
if (result.mode === "since") {
const runIds = Array.isArray(result.runIds) ? result.runIds : [];
lines.push(`[improve] report since ${String(result.since ?? "?")} (${runIds.length} run${runIds.length === 1 ? "" : "s"})`);
}
else {
lines.push(`[improve] report for run ${String(result.runId ?? "?")}${result.strategy ? ` (strategy: ${result.strategy})` : ""}`);
}
lines.push(formatUsageReportTable(usageReport, result.notes));
return lines.join("\n");
}
export const improveReportFormatters = [
{ command: "improve-report", handler: (r) => formatImproveReportPlain(r) },
];