billion-context-omp 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +26 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3809,41 +3809,44 @@ async function statusReport(runtime, ctx) {
|
|
|
3809
3809
|
const classified = bd ? bd.system + bd.tool + bd.summaries + bd.code + bd.text : 0;
|
|
3810
3810
|
const systemPromptText = getSystemPromptText(ctx);
|
|
3811
3811
|
const systemPromptTokens = systemPromptText ? defaultCountTokens(systemPromptText) : 0;
|
|
3812
|
-
const
|
|
3812
|
+
const sentTotal = classified + systemPromptTokens;
|
|
3813
|
+
const sessionOnly = Math.max(0, tokenCount - sentTotal);
|
|
3813
3814
|
const displayTotal = tokenCount;
|
|
3814
3815
|
const displayPct = limit > 0 ? Math.round(displayTotal / limit * 100) : 0;
|
|
3815
3816
|
const activeBlocksList = state.blocks.filter((b) => b.active);
|
|
3816
3817
|
const totalBlocksList = state.blocks;
|
|
3817
3818
|
const lines = [];
|
|
3818
|
-
const versionStr = "0.1.
|
|
3819
|
+
const versionStr = "0.1.5" ? `billion-context-omp@${"0.1.5"}` : "";
|
|
3819
3820
|
lines.push("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E");
|
|
3820
3821
|
lines.push("\u2502 ACP Context Analysis \u2502");
|
|
3821
3822
|
lines.push("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F");
|
|
3822
3823
|
if (versionStr) lines.push(versionStr);
|
|
3823
3824
|
lines.push("");
|
|
3824
|
-
lines.push(`Context: ${displayPct}% (${fmtTokens(displayTotal)} / ${fmtTokens(limit)})`);
|
|
3825
|
+
lines.push(`Context (session accounting): ${displayPct}% (${fmtTokens(displayTotal)} / ${fmtTokens(limit)})`);
|
|
3825
3826
|
if (nudge && bd) {
|
|
3826
3827
|
const growth = bd.growth;
|
|
3827
3828
|
if (growth > 0 && displayTotal > 0) {
|
|
3828
3829
|
lines.push(`Growth: +${fmtTokens(growth)} since last nudge`);
|
|
3829
3830
|
}
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3831
|
+
lines.push("");
|
|
3832
|
+
lines.push(`Sent to LLM (after compression): ${fmtTokens(sentTotal)}`);
|
|
3833
|
+
if (sessionOnly > 0) {
|
|
3834
|
+
lines.push(`Session-only (compressed originals + host overhead): ${fmtTokens(sessionOnly)} \u2014 pruned from every request; the footer counts it`);
|
|
3835
|
+
}
|
|
3836
|
+
lines.push("");
|
|
3837
|
+
lines.push("Token Breakdown (sent view):");
|
|
3838
|
+
const categories = [
|
|
3839
|
+
{ label: "Tool", value: bd.tool },
|
|
3840
|
+
{ label: "SysPrompt", value: systemPromptTokens },
|
|
3841
|
+
{ label: "Text", value: bd.text },
|
|
3842
|
+
{ label: "Code", value: bd.code },
|
|
3843
|
+
{ label: "Summaries", value: bd.summaries }
|
|
3844
|
+
];
|
|
3845
|
+
for (const cat of categories) {
|
|
3846
|
+
if (cat.value <= 0) continue;
|
|
3847
|
+
const pct2 = sentTotal > 0 ? Math.round(cat.value / sentTotal * 100) : 0;
|
|
3848
|
+
const b = bar(cat.value, sentTotal);
|
|
3849
|
+
lines.push(` ${cat.label.padEnd(10)} ${b} ${String(pct2).padStart(3)}% ${fmtTokens(cat.value)}`);
|
|
3847
3850
|
}
|
|
3848
3851
|
}
|
|
3849
3852
|
lines.push("");
|
|
@@ -3855,7 +3858,7 @@ async function statusReport(runtime, ctx) {
|
|
|
3855
3858
|
lines.push(`Nudge: idle \u2014 ${nudge.reason}`);
|
|
3856
3859
|
}
|
|
3857
3860
|
}
|
|
3858
|
-
const ranges = nudge?.compressibleRanges ?? [];
|
|
3861
|
+
const ranges = viableRanges(nudge?.compressibleRanges ?? []);
|
|
3859
3862
|
const protectedRanges = nudge?.protectedRanges ?? [];
|
|
3860
3863
|
if (ranges.length > 0 || protectedRanges.length > 0) {
|
|
3861
3864
|
lines.push("");
|
|
@@ -4310,7 +4313,7 @@ async function checkForUpdate(autoUpdate, notify) {
|
|
|
4310
4313
|
const data = await res.json();
|
|
4311
4314
|
const latest = data.version;
|
|
4312
4315
|
if (!latest) return;
|
|
4313
|
-
const current = runtimeVersion ?? "0.1.
|
|
4316
|
+
const current = runtimeVersion ?? "0.1.5";
|
|
4314
4317
|
const hasUpdate = isNewer(latest, current);
|
|
4315
4318
|
debug.event("update-check", {
|
|
4316
4319
|
current,
|
|
@@ -4598,7 +4601,7 @@ function wireCompactionDisable(pi, runtime) {
|
|
|
4598
4601
|
function wireSessionLifecycle(pi, runtime) {
|
|
4599
4602
|
pi.on("session_start", async (_event, ctx) => {
|
|
4600
4603
|
const sid = ctx.sessionManager.getSessionId();
|
|
4601
|
-
logInfo("session", { event: "start", sid, cwd: ctx.cwd, debug: runtime.adapter.debug ?? null, version: true ? "0.1.
|
|
4604
|
+
logInfo("session", { event: "start", sid, cwd: ctx.cwd, debug: runtime.adapter.debug ?? null, version: true ? "0.1.5" : null });
|
|
4602
4605
|
try {
|
|
4603
4606
|
const user = await loadUserConfig(ctx.cwd);
|
|
4604
4607
|
runtime.setAdapter(applyUserConfig(runtime.adapter, user));
|