tokensafe 4.4.5 → 4.4.6

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.4.5",
2
+ "version": "4.4.6",
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": "4.4.5",
3
+ "version": "4.4.6",
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.4.5",
4
+ "version": "4.4.6",
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": "4.4.5",
4
+ "version": "4.4.6",
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
  "logo": "assets/logo.png",
7
7
  "developerName": "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.4.5",
6
+ "version": "4.4.6",
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.4.5",
26
+ "version": "4.4.6",
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.4.5",
42
+ "version": "4.4.6",
43
43
  "runtimeHint": "uvx",
44
44
  "transport": {
45
45
  "type": "stdio"
package/src/installer.py CHANGED
@@ -2557,6 +2557,63 @@ WantedBy=default.target
2557
2557
  except Exception as e:
2558
2558
  print(f" {YELLOW}⚠{RESET} pip update skipped: {e}")
2559
2559
 
2560
+ # 3b. Check and upgrade TokenSafe ecosystem packages (Frontend & Backend)
2561
+ print(f"\n {CYAN}→{RESET} Checking TokenSafe Ecosystem packages (UI & Backend)...")
2562
+ target_npm_bins = upgraded_npm_bins or ([primary_npm] if primary_npm else [])
2563
+ for npm_bin in target_npm_bins:
2564
+ npm_env = cls._npm_subprocess_env(npm_bin)
2565
+ for pkg in ("tokensafe-ui", "create-tokensafe-ui"):
2566
+ try:
2567
+ res = subprocess.run([npm_bin, "list", "-g", "--depth=0", pkg], env=npm_env, capture_output=True, text=True, timeout=10)
2568
+ if f"{pkg}@" in (res.stdout or ""):
2569
+ print(f" {CYAN}→{RESET} Updating global {pkg} ({npm_bin} install -g {pkg}@latest)...")
2570
+ up_res = subprocess.run([npm_bin, "install", "-g", f"{pkg}@latest"], env=npm_env, capture_output=True, text=True, timeout=120)
2571
+ if up_res.returncode == 0:
2572
+ print(f" {GREEN}✔{RESET} {pkg} upgraded successfully.")
2573
+ except Exception:
2574
+ pass
2575
+
2576
+ if pip_cmd:
2577
+ try:
2578
+ res = subprocess.run([pip_cmd, "list"], capture_output=True, text=True, timeout=10)
2579
+ if "tokensafe-python" in (res.stdout or ""):
2580
+ print(f" {CYAN}→{RESET} Updating backend package ({pip_cmd} install --upgrade tokensafe-python)...")
2581
+ up_res = subprocess.run([pip_cmd, "install", "--upgrade", "tokensafe-python"], capture_output=True, text=True, timeout=120)
2582
+ if up_res.returncode == 0:
2583
+ print(f" {GREEN}✔{RESET} tokensafe-python upgraded successfully.")
2584
+ except Exception:
2585
+ pass
2586
+
2587
+ # Project-level dependencies update (if inside a TokenSafe project)
2588
+ cwd = os.getcwd()
2589
+ for cand_pkg in [os.path.join(cwd, "package.json"), os.path.join(cwd, "frontend", "package.json")]:
2590
+ if os.path.isfile(cand_pkg):
2591
+ try:
2592
+ with open(cand_pkg, "r", encoding="utf-8") as f:
2593
+ txt = f.read()
2594
+ if "tokensafe-ui" in txt:
2595
+ pdir = os.path.dirname(cand_pkg)
2596
+ pm = "pnpm" if shutil.which("pnpm") else ("npm" if shutil.which("npm") else None)
2597
+ if pm:
2598
+ print(f" {CYAN}→{RESET} Updating local tokensafe-ui in {pdir} ({pm} update tokensafe-ui)...")
2599
+ subprocess.run([pm, "update", "tokensafe-ui"], cwd=pdir, capture_output=True, text=True, timeout=60)
2600
+ print(f" {GREEN}✔{RESET} Local tokensafe-ui updated.")
2601
+ except Exception:
2602
+ pass
2603
+
2604
+ for cand_py in [os.path.join(cwd, "pyproject.toml"), os.path.join(cwd, "backend", "pyproject.toml")]:
2605
+ if os.path.isfile(cand_py):
2606
+ try:
2607
+ with open(cand_py, "r", encoding="utf-8") as f:
2608
+ txt = f.read()
2609
+ if "tokensafe-python" in txt and pip_cmd:
2610
+ pdir = os.path.dirname(cand_py)
2611
+ print(f" {CYAN}→{RESET} Updating local tokensafe-python in {pdir}...")
2612
+ subprocess.run([pip_cmd, "install", "--upgrade", "tokensafe-python"], cwd=pdir, capture_output=True, text=True, timeout=60)
2613
+ print(f" {GREEN}✔{RESET} Local tokensafe-python updated.")
2614
+ except Exception:
2615
+ pass
2616
+
2560
2617
  # 4. Re-synchronize all detected agents
2561
2618
  print(f"\n {CYAN}→{RESET} Re-synchronizing AI Agent MCP configs & rules...")
2562
2619
  agents = cls.detect_available_agents()
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.4.5"
45
+ "version": "4.4.6"
46
46
  }
47
47
 
48
48
  # MCP client attribution: the initialize handshake carries clientInfo, which
@@ -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.4.5"
244
+ "User-Agent": "TokenSafe-Sync/4.4.6"
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.4.5"
20
+ CURRENT_VERSION = "4.4.6"
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