tokensafe 5.0.0 → 5.0.1

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.
@@ -9,7 +9,7 @@
9
9
  "name": "tokensafe",
10
10
  "source": "./",
11
11
  "description": "Enforced context optimization for Claude Code: blocking guards, PostToolUse output compaction, symbol/AST slicing, post-compaction recovery, and measured savings.",
12
- "version": "5.0.0"
12
+ "version": "5.0.1"
13
13
  }
14
14
  ]
15
15
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokensafe",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Local runtime firewall and zero-loss context optimizer for AI coding agents: enforced tool-output compaction, symbol/AST slicing, post-compaction recovery, and measured savings.",
5
5
  "author": {
6
6
  "name": "TokenSafe",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.0.0",
2
+ "version": "5.0.1",
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/kimi.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokensafe",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
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": "Apache-2.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tokensafe",
3
3
  "mcpName": "dev.tokensafe/tokensafe",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
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,7 +1,7 @@
1
1
  {
2
2
  "name": "tokensafe",
3
3
  "displayName": "TokenSafe",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "license": "Apache-2.0",
6
6
  "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.",
7
7
  "logo": "assets/logo.png",
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": "5.0.0",
6
+ "version": "5.0.1",
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": "5.0.0",
26
+ "version": "5.0.1",
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": "5.0.0",
42
+ "version": "5.0.1",
43
43
  "runtimeHint": "uvx",
44
44
  "transport": {
45
45
  "type": "stdio"
@@ -50,7 +50,7 @@ from tokensafe.session_context import current_root, current_session_id
50
50
 
51
51
  SERVER_INFO = {
52
52
  "name": "tokensafe-mcp",
53
- "version": "5.0.0"
53
+ "version": "5.0.1"
54
54
  }
55
55
 
56
56
  # MCP client attribution: the initialize handshake carries clientInfo, which
@@ -2807,9 +2807,13 @@ def _parse_if_modified_since(value: Any) -> Optional[tuple]:
2807
2807
  from datetime import datetime
2808
2808
 
2809
2809
  iso = raw.replace("Z", "+00:00")
2810
+ fraction = re.search(r"([T ]\d{2}:\d{2}:\d{2})[.,](\d+)", iso)
2811
+ digits = min(len(fraction.group(2)), 6) if fraction else 0
2812
+ if fraction:
2813
+ # Python < 3.11 fromisoformat only takes exactly 3 or 6 fraction
2814
+ # digits after a '.': normalize to 6 before parsing.
2815
+ iso = iso[:fraction.start()] + fraction.group(1) + "." + fraction.group(2)[:6].ljust(6, "0") + iso[fraction.end():]
2810
2816
  parsed = datetime.fromisoformat(iso)
2811
- fraction = re.search(r"[T ]\d{2}:\d{2}:\d{2}[.,](\d+)", iso)
2812
- digits = min(len(fraction.group(1)), 6) if fraction else 0
2813
2817
  unit = 10 ** (9 - digits)
2814
2818
  # Integer arithmetic: float timestamp() * 1e9 is off by hundreds of ns.
2815
2819
  whole = int(parsed.replace(microsecond=0).timestamp())
@@ -341,7 +341,7 @@ class TelemetrySync:
341
341
  current_last_id = last_id
342
342
  headers = {
343
343
  "Content-Type": "application/json",
344
- "User-Agent": "TokenSafe-Sync/5.0.0"
344
+ "User-Agent": "TokenSafe-Sync/5.0.1"
345
345
  }
346
346
  if active_key:
347
347
  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 = "5.0.0"
20
+ CURRENT_VERSION = "5.0.1"
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