context-mode 1.0.152 → 1.0.154
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/.codex-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/session/analytics.d.ts +10 -0
- package/build/session/analytics.js +0 -35
- package/cli.bundle.mjs +135 -135
- package/hooks/core/formatters.mjs +44 -8
- package/hooks/formatters/claude-code.mjs +38 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server.bundle.mjs +88 -88
|
@@ -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.154"
|
|
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.154",
|
|
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.154",
|
|
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",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.154",
|
|
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.154",
|
|
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.154",
|
|
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",
|
|
@@ -685,6 +685,16 @@ export declare function pricePerToken(): number;
|
|
|
685
685
|
export declare const OPUS_INPUT_PRICE_PER_TOKEN: number;
|
|
686
686
|
/** Convert a token count to a USD string at the current per-token rate. */
|
|
687
687
|
export declare function tokensToUsd(tokens: number): string;
|
|
688
|
+
/**
|
|
689
|
+
* Render a FullReport as a visual savings dashboard designed for screenshotting.
|
|
690
|
+
*
|
|
691
|
+
* Design principles:
|
|
692
|
+
* - Before/After comparison bar is the HERO — one glance = "wow"
|
|
693
|
+
* - "tokens saved" is the number people share
|
|
694
|
+
* - Per-tool breakdown shows what each tool SAVED, sorted by impact
|
|
695
|
+
* - Project memory: category bars showing persistent data across sessions
|
|
696
|
+
* - No: Pct column, category tables, tips, jargon
|
|
697
|
+
*/
|
|
688
698
|
export declare function formatReport(report: FullReport, version?: string, latestVersion?: string | null, opts?: {
|
|
689
699
|
lifetime?: LifetimeStats;
|
|
690
700
|
mcpUsage?: McpToolUsageRow[];
|
|
@@ -2152,34 +2152,6 @@ function renderMultiAdapter(multiAdapter) {
|
|
|
2152
2152
|
* - Project memory: category bars showing persistent data across sessions
|
|
2153
2153
|
* - No: Pct column, category tables, tips, jargon
|
|
2154
2154
|
*/
|
|
2155
|
-
/**
|
|
2156
|
-
* Render the machine-readable Observability block (cache + index state).
|
|
2157
|
-
*
|
|
2158
|
-
* Returns an empty array when no observability data is available, so callers
|
|
2159
|
-
* can `lines.push(...renderObservabilityBlock(...))` unconditionally and the
|
|
2160
|
-
* section is omitted when the kit has nothing to report.
|
|
2161
|
-
*
|
|
2162
|
-
* Shared between the narrative path (early-returns when conversation.events > 0)
|
|
2163
|
-
* and the legacy path so the block surfaces in both, matching the contract
|
|
2164
|
-
* that the handler always passes `indexState` regardless of code path.
|
|
2165
|
-
*/
|
|
2166
|
-
function renderObservabilityBlock(report, indexState) {
|
|
2167
|
-
const obs = [];
|
|
2168
|
-
if (report.cache) {
|
|
2169
|
-
const hitRatePct = (report.cache.hit_rate * 100).toFixed(1);
|
|
2170
|
-
obs.push(`cache.hit_rate: ${hitRatePct}% (${report.cache.hits} hits / ${report.cache.misses} misses)`);
|
|
2171
|
-
}
|
|
2172
|
-
if (indexState) {
|
|
2173
|
-
obs.push(`index.total_chunks: ${indexState.totalChunks}`);
|
|
2174
|
-
obs.push(`index.total_sources: ${indexState.totalSources}`);
|
|
2175
|
-
if (indexState.lastIndexedAt) {
|
|
2176
|
-
obs.push(`index.last_indexed_at: ${indexState.lastIndexedAt}`);
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
if (obs.length === 0)
|
|
2180
|
-
return [];
|
|
2181
|
-
return ["", "## Observability", ...obs];
|
|
2182
|
-
}
|
|
2183
2155
|
export function formatReport(report, version, latestVersion, opts) {
|
|
2184
2156
|
const lines = [];
|
|
2185
2157
|
const duration = formatDuration(report.session.uptime_min);
|
|
@@ -2247,9 +2219,6 @@ export function formatReport(report, version, latestVersion, opts) {
|
|
|
2247
2219
|
conversation, lifetime, multiAdapter, realBytes,
|
|
2248
2220
|
cwd, locale, tz, now, version, latestVersion,
|
|
2249
2221
|
}));
|
|
2250
|
-
// Append Observability so cache.hit_rate / index.* surface in the
|
|
2251
|
-
// narrative path too (handler passes indexState regardless of path).
|
|
2252
|
-
lines.push(...renderObservabilityBlock(report, opts?.indexState));
|
|
2253
2222
|
return lines.join("\n");
|
|
2254
2223
|
}
|
|
2255
2224
|
// ── Compute real savings ──
|
|
@@ -2354,10 +2323,6 @@ export function formatReport(report, version, latestVersion, opts) {
|
|
|
2354
2323
|
lines.push(...renderAutoMemory(lifetime));
|
|
2355
2324
|
// ── Bottom line — business value framing (Bug #8) ──
|
|
2356
2325
|
lines.push(...renderBottomLine(tokensSaved, lifetime));
|
|
2357
|
-
// ── Observability — machine-readable cache + index state ──
|
|
2358
|
-
// Rendered via shared helper so the narrative path (above, early-return
|
|
2359
|
-
// when conversation.events > 0) emits the same block.
|
|
2360
|
-
lines.push(...renderObservabilityBlock(report, opts?.indexState));
|
|
2361
2326
|
// ── Footer ──
|
|
2362
2327
|
lines.push("");
|
|
2363
2328
|
const versionStr = version ? `v${version}` : "context-mode";
|