context-mode 1.0.130 → 1.0.131
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/session/analytics.js +36 -10
- package/cli.bundle.mjs +136 -136
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server.bundle.mjs +112 -112
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Claude Code plugins by Mert Koseoğlu",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.131"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "context-mode",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
16
|
-
"version": "1.0.
|
|
16
|
+
"version": "1.0.131",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Mert Koseoğlu"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.131",
|
|
4
4
|
"description": "MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "Context Mode",
|
|
4
4
|
"kind": "tool",
|
|
5
5
|
"description": "OpenClaw plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.131",
|
|
7
7
|
"sandbox": {
|
|
8
8
|
"mode": "permissive",
|
|
9
9
|
"filesystem_access": "full",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.131",
|
|
4
4
|
"description": "OpenClaw plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
|
@@ -1256,7 +1256,16 @@ function renderNarrative5Section(args) {
|
|
|
1256
1256
|
const lifetimeLegacyTokens = lifetimeEventsTokens + lifetimeRescueTokens;
|
|
1257
1257
|
const lifetimeRealTokens = realBytes?.lifetime?.totalSavedTokens ?? 0;
|
|
1258
1258
|
const lifetimeTokensWithout = Math.max(lifetimeLegacyTokens, lifetimeRealTokens);
|
|
1259
|
-
|
|
1259
|
+
// Lifetime "with" — measured when available, else legacy 0.02 fallback.
|
|
1260
|
+
// Honest definition (matches conversation bar below):
|
|
1261
|
+
// "with" = bytes_returned (what the model actually re-saw)
|
|
1262
|
+
// "without" = bytes_returned + bytes_avoided
|
|
1263
|
+
// When the schema has measurement, derive `with` from `bytes_returned/4`.
|
|
1264
|
+
const lifeRet = realBytes?.lifetime?.bytesReturned ?? 0;
|
|
1265
|
+
const lifeAv = realBytes?.lifetime?.bytesAvoided ?? 0;
|
|
1266
|
+
const lifetimeTokensWith = (lifeRet + lifeAv) > 0
|
|
1267
|
+
? Math.max(1, Math.floor(lifeRet / 4))
|
|
1268
|
+
: Math.max(1, Math.round(lifetimeTokensWithout * 0.02));
|
|
1260
1269
|
// Bytes from realBytes when present, else derive from tokens (×4 — same
|
|
1261
1270
|
// ratio Phase 8 uses everywhere). All-work bytes drives the opener tally
|
|
1262
1271
|
// + the section-3 receipt + section-4 cost example.
|
|
@@ -1328,15 +1337,32 @@ function renderNarrative5Section(args) {
|
|
|
1328
1337
|
out.push(` Without that, you'd be re-explaining everything to a blank model right now.`);
|
|
1329
1338
|
}
|
|
1330
1339
|
out.push("");
|
|
1331
|
-
// Without/With bars —
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
+
// Without/With bars — measured from real per-event bytes_returned / bytes_avoided.
|
|
1341
|
+
//
|
|
1342
|
+
// Honest definitions:
|
|
1343
|
+
// Without = bytes the model WOULD have re-seen with no filtering = bytes_returned + bytes_avoided
|
|
1344
|
+
// With = bytes the model ACTUALLY re-saw after context-mode = bytes_returned
|
|
1345
|
+
//
|
|
1346
|
+
// No fallback to heuristic. If the schema has zero signal for this
|
|
1347
|
+
// conversation (no hook ever populated bytes_avoided / bytes_returned),
|
|
1348
|
+
// the section is skipped entirely. Honesty over decoration.
|
|
1349
|
+
const realConv = realBytes?.conversation;
|
|
1350
|
+
const measuredAvoided = realConv?.bytesAvoided ?? 0;
|
|
1351
|
+
const measuredReturned = realConv?.bytesReturned ?? 0;
|
|
1352
|
+
if (measuredAvoided + measuredReturned > 0) {
|
|
1353
|
+
const convBytesWithout = measuredReturned + measuredAvoided;
|
|
1354
|
+
const convBytesWith = Math.max(1, measuredReturned);
|
|
1355
|
+
const convTokensWithout = Math.max(1, Math.floor(convBytesWithout / 4));
|
|
1356
|
+
const convTokensWith = Math.max(1, Math.floor(convBytesWith / 4));
|
|
1357
|
+
const withoutBar = dataBar(convTokensWithout, convTokensWithout, 32);
|
|
1358
|
+
const withBar = dataBar(convTokensWith, convTokensWithout, 32);
|
|
1359
|
+
const convPct = (1 - convTokensWith / convTokensWithout) * 100;
|
|
1360
|
+
const convMult = Math.max(1, Math.round(convTokensWithout / convTokensWith));
|
|
1361
|
+
out.push(` Without context-mode ${kb(convBytesWithout).padStart(8)} ${withoutBar} ${fmtNum(convTokensWithout).padStart(7)} tokens`);
|
|
1362
|
+
out.push(` With context-mode ${kb(convBytesWith).padStart(8)} ${withBar} ${fmtNum(convTokensWith).padStart(7)} tokens`);
|
|
1363
|
+
out.push(` ${convPct.toFixed(0)}% kept out of context · your AI ran ${convMult}× longer before /compact fired`);
|
|
1364
|
+
out.push("");
|
|
1365
|
+
}
|
|
1340
1366
|
// Timeline — drop-in if conversation has byDay.
|
|
1341
1367
|
if (conversation.byDay && conversation.byDay.length > 0) {
|
|
1342
1368
|
const totalConvDays = conversation.lastEventMs && conversation.firstEventMs
|