import { analyzeBootstrapBudget } from "../../agents/bootstrap-budget.js"; import {
resolveBootstrapMaxChars,
resolveBootstrapTotalMaxChars,
} from "../../agents/pi-embedded-helpers/bootstrap.js"; import { buildSystemPromptReport } from "../../agents/system-prompt-report.js"; import {
resolveFreshSessionTotalTokens,
type SessionSystemPromptReport,
} from "../../config/sessions/types.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import { estimateTokensFromChars } from "../../utils/cjk-chars.js"; import type { ReplyPayload } from "../types.js"; import type { HandleCommandsParams } from "./commands-types.js";
function formatInt(n: number): string { returnnew Intl.NumberFormat("en-US").format(n);
}
if (!sub || sub === "help") { return {
text: [ " /context", "", "What counts as context (high-level), plus a breakdown mode.", "", "Try:", "- /context list (short breakdown)", "- /context detail (per-file + per-tool + per-skill + system prompt size)", "- /context json (same, machine-readable)", "", "Inline shortcut = a command token inside a normal message (e.g. “hey /status”). It runs immediately (allowlisted senders only) and is stripped before the model sees the remaining text.",
].join("\n"),
};
}
return {
text: [ " Context breakdown (detailed)",
...sharedContextLines,
...(perSkill.lines.length ? ["Top skills (prompt entry size):", ...perSkill.lines] : []),
...(perSkill.omitted ? [`… (+${perSkill.omitted} more skills)`] : []), "",
toolListLine,
toolSchemaLine,
toolsNamesLine, "Top tools (schema size):",
...perToolSchema.lines,
...(perToolSchema.omitted ? [`… (+${perToolSchema.omitted} more tools)`] : []), "", "Top tools (summary text size):",
...perToolSummary.lines,
...(perToolSummary.omitted ? [`… (+${perToolSummary.omitted} more tools)`] : []),
...(toolPropsLines.length ? ["", "Tools (param count):", ...toolPropsLines] : []), "",
trackedPromptLine,
actualContextLine,
...(overheadLine ? [overheadLine] : []), "",
totalsLine, "", "Inline shortcut: a command token inside normal text (e.g. “hey /status”) that runs immediately (allowlisted senders only) and is stripped before the model sees the remaining message.",
]
.filter(Boolean)
.join("\n"),
};
}
return {
text: [ " Context breakdown",
...sharedContextLines,
toolListLine,
toolSchemaLine,
toolsNamesLine, "",
totalsLine, "", "Inline shortcut: a command token inside normal text (e.g. “hey /status”) that runs immediately (allowlisted senders only) and is stripped before the model sees the remaining message.",
].join("\n"),
};
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-06)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.