tokensafe 4.2.9 → 4.2.10

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.2.9",
2
+ "version": "4.2.10",
3
3
  "name": "tokensafe",
4
4
  "description": "Your AI agent is smart enough to code all day. Now it actually can. Local runtime firewall & zero-loss context optimizer for AI coding agents.",
5
5
  "author": {
package/assets/logo.png CHANGED
Binary file
package/kimi.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokensafe",
3
- "version": "4.2.9",
3
+ "version": "4.2.10",
4
4
  "description": "Your AI agent is smart enough to code all day. Now it actually can. Local runtime firewall & zero-loss context optimizer for AI coding agents.",
5
5
  "homepage": "https://tokensafe.dev",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tokensafe",
3
3
  "mcpName": "dev.tokensafe/tokensafe",
4
- "version": "4.2.9",
4
+ "version": "4.2.10",
5
5
  "description": "Your AI agent is smart enough to code all day. Now it actually can. Local runtime firewall & zero-loss context optimizer for AI coding agents.",
6
6
  "main": "bin/tokensafe.js",
7
7
  "bin": {
package/plugin.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "tokensafe",
3
3
  "displayName": "TokenSafe",
4
- "version": "4.2.9",
4
+ "version": "4.2.10",
5
5
  "description": "Your AI agent is smart enough to code all day. Now it actually can. Local runtime firewall & zero-loss context optimizer for AI coding agents.",
6
- "logo": "https://tokensafe.dev/ts-logo-black-256.png",
6
+ "logo": "assets/logo.png",
7
7
  "developerName": "TokenSafe",
8
8
  "author": {
9
9
  "name": "TokenSafe",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "dev.tokensafe/tokensafe",
4
4
  "title": "TokenSafe",
5
5
  "description": "Your AI agent is smart enough to code all day. Local firewall & zero-loss runtime.",
6
- "version": "4.2.9",
6
+ "version": "4.2.10",
7
7
  "websiteUrl": "https://tokensafe.dev",
8
8
  "repository": {
9
9
  "url": "https://github.com/tokensafe-dev/tokensafe",
@@ -23,7 +23,7 @@
23
23
  "registryType": "npm",
24
24
  "registryBaseUrl": "https://registry.npmjs.org",
25
25
  "identifier": "tokensafe",
26
- "version": "4.2.9",
26
+ "version": "4.2.10",
27
27
  "runtimeHint": "npx",
28
28
  "transport": {
29
29
  "type": "stdio"
@@ -39,7 +39,7 @@
39
39
  "registryType": "pypi",
40
40
  "registryBaseUrl": "https://pypi.org",
41
41
  "identifier": "tokensafe",
42
- "version": "4.2.9",
42
+ "version": "4.2.10",
43
43
  "runtimeHint": "uvx",
44
44
  "transport": {
45
45
  "type": "stdio"
package/src/dashboard.py CHANGED
@@ -41,6 +41,7 @@ def render_bar(percentage: float, width: int = 24) -> str:
41
41
  EVENT_NAMES = {
42
42
  "PROMPT": "Prompt Compactor (TOCP)",
43
43
  "TOOL_READ": "File Line Slicer (AST)",
44
+ "RAW_SLICE": "Raw Line Slice (explicit range)",
44
45
  "AST_SKELETON": "AST Skeletonizer (Signatures)",
45
46
  "GRAPH_SKELETON": "Graph-Guided Slicer (Call-Graph)",
46
47
  "GRAPH_TOPOLOGY": "Architecture Graph (God Nodes)",
package/src/mcp_server.py CHANGED
@@ -42,7 +42,7 @@ from src.paths import get_active_workspace, is_plugin_or_system_dir
42
42
 
43
43
  SERVER_INFO = {
44
44
  "name": "tokensafe-mcp",
45
- "version": "4.2.9"
45
+ "version": "4.2.10"
46
46
  }
47
47
 
48
48
  # MCP client attribution: the initialize handshake carries clientInfo, which
@@ -1005,10 +1005,23 @@ def _dispatch_tool_call(name: str, args: dict) -> dict:
1005
1005
  content, err = _read_line_slice(path, start_line, end_line)
1006
1006
  if err:
1007
1007
  return _fallback_error("smart_read_file", err)
1008
+ slice_lines = (content or "").splitlines()
1009
+ slice_first = start_line if start_line is not None else 1
1010
+ slice_last = slice_first + len(slice_lines) - 1 if slice_lines else max(1, slice_first - 1)
1011
+ range_label = f"{slice_first}-{slice_last}" if slice_lines else str(slice_first)
1008
1012
  prefetch_block = ""
1009
1013
  if not sym_clean or eff_dep_mode == "full":
1010
1014
  prefetch_block, _ = DependencyPrefetcher.prefetch_for_file(path)
1011
- return {"content": [{"type": "text", "text": (prefetch_block or "") + (content or "")}]}
1015
+ slice_header = f"// [TOCP Raw Slice: lines {range_label} of {os.path.basename(path)}]\n"
1016
+ delivered = (prefetch_block or "") + slice_header + (content or "")
1017
+ tracker.record_event(
1018
+ session_id=_mcp_session_id(),
1019
+ event_type="RAW_SLICE",
1020
+ original_tokens=max(200, st.st_size // 4),
1021
+ optimized_tokens=count_tokens(delivered),
1022
+ details={"file": os.path.basename(path), "lines": range_label, "symbol": sym_clean[:120]}
1023
+ )
1024
+ return {"content": [{"type": "text", "text": delivered}]}
1012
1025
 
1013
1026
  if symbol:
1014
1027
  # Team pre-warm hit: a teammate already skeletonized this symbol
@@ -241,7 +241,7 @@ class TelemetrySync:
241
241
  current_last_id = last_id
242
242
  headers = {
243
243
  "Content-Type": "application/json",
244
- "User-Agent": "TokenSafe-Sync/4.2.9"
244
+ "User-Agent": "TokenSafe-Sync/4.2.10"
245
245
  }
246
246
  if active_key:
247
247
  headers["Authorization"] = f"Bearer {active_key}"
@@ -17,7 +17,7 @@ import urllib.request
17
17
  import urllib.error
18
18
  from typing import Dict, Any, Optional, Tuple
19
19
 
20
- CURRENT_VERSION = "4.2.9"
20
+ CURRENT_VERSION = "4.2.10"
21
21
  CACHE_TTL = 86400 # 24 hours
22
22
  # When the cloud is unreachable we must NOT cache the synthesized "up to date"
23
23
  # answer for a full day — otherwise an update released right after an outage