tokensafe 4.1.9 → 4.1.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.
- package/.codex-plugin/plugin.json +1 -1
- package/kimi.plugin.json +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/server.json +3 -3
- package/src/cli.py +11 -0
- package/src/installer.py +33 -1
- package/src/mcp_server.py +1 -1
- package/src/telemetry_sync.py +1 -1
- package/src/version_checker.py +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.1.
|
|
2
|
+
"version": "4.1.10",
|
|
3
3
|
"name": "tokensafe",
|
|
4
4
|
"description": "Your coding agent isn't getting dumber. Your context is just full of trash. Local context firewall & zero-loss runtime for Cursor, Claude Code, and autonomous agents.",
|
|
5
5
|
"author": {
|
package/kimi.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tokensafe",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.10",
|
|
4
4
|
"description": "Your coding agent isn't getting dumber. Your context is just full of trash. Local context firewall & zero-loss runtime for Cursor, Claude Code, and autonomous 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.1.
|
|
4
|
+
"version": "4.1.10",
|
|
5
5
|
"description": "Your coding agent isn't getting dumber. Your context is just full of trash. Local context firewall & zero-loss runtime for Cursor, Claude Code, and autonomous 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.1.
|
|
4
|
+
"version": "4.1.10",
|
|
5
5
|
"description": "Your coding agent isn't getting dumber. Your context is just full of trash. Local context firewall & zero-loss runtime for Cursor, Claude Code, and autonomous agents.",
|
|
6
6
|
"logo": "https://tokensafe.dev/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 agent isn't getting dumber, your context is full of trash. Local firewall & zero-loss runtime.",
|
|
6
|
-
"version": "4.1.
|
|
6
|
+
"version": "4.1.10",
|
|
7
7
|
"websiteUrl": "https://tokensafe.dev",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/tokensafe-dev/tokensafe",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"registryType": "npm",
|
|
31
31
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
32
32
|
"identifier": "tokensafe",
|
|
33
|
-
"version": "4.1.
|
|
33
|
+
"version": "4.1.10",
|
|
34
34
|
"runtimeHint": "npx",
|
|
35
35
|
"transport": {
|
|
36
36
|
"type": "stdio"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"registryType": "pypi",
|
|
47
47
|
"registryBaseUrl": "https://pypi.org",
|
|
48
48
|
"identifier": "tokensafe",
|
|
49
|
-
"version": "4.1.
|
|
49
|
+
"version": "4.1.10",
|
|
50
50
|
"runtimeHint": "uvx",
|
|
51
51
|
"transport": {
|
|
52
52
|
"type": "stdio"
|
package/src/cli.py
CHANGED
|
@@ -371,6 +371,17 @@ def main(argv: Optional[List[str]] = None):
|
|
|
371
371
|
latest = info.get("latest_version", CURRENT_VERSION)
|
|
372
372
|
avail = info.get("update_available", False)
|
|
373
373
|
print(f" Latest version: v{latest}")
|
|
374
|
+
try:
|
|
375
|
+
from src.license_manager import LicenseManager
|
|
376
|
+
tier, lic = LicenseManager.get_active_license()
|
|
377
|
+
if tier == "guest":
|
|
378
|
+
from src.metrics import MetricsTracker
|
|
379
|
+
quota = LicenseManager.check_quota(MetricsTracker())
|
|
380
|
+
saved = int(quota.get("monthly_saved", 0))
|
|
381
|
+
pct = min(100.0, (saved / 50_000) * 100) if 50_000 > 0 else 0.0
|
|
382
|
+
print(f" \033[2mQuota:\033[0m \033[33mGuest Mode\033[0m ({saved:,} / 50,000 tokens used, {pct:.1f}%) • Run '\033[36mtokensafe login\033[0m' for 500k/mo.")
|
|
383
|
+
except Exception:
|
|
384
|
+
pass
|
|
374
385
|
banner = VersionChecker.get_banner()
|
|
375
386
|
if banner:
|
|
376
387
|
print(banner)
|
package/src/installer.py
CHANGED
|
@@ -682,7 +682,39 @@ WantedBy=default.target
|
|
|
682
682
|
raise EOFError("No interactive TTY")
|
|
683
683
|
|
|
684
684
|
if context == "update":
|
|
685
|
-
|
|
685
|
+
used_tokens = 0
|
|
686
|
+
try:
|
|
687
|
+
from src.metrics import MetricsTracker
|
|
688
|
+
quota = LicenseManager.check_quota(MetricsTracker())
|
|
689
|
+
used_tokens = int(quota.get("monthly_saved", 0))
|
|
690
|
+
except Exception:
|
|
691
|
+
used_tokens = 0
|
|
692
|
+
pct = min(100.0, (used_tokens / 50_000) * 100) if 50_000 > 0 else 0.0
|
|
693
|
+
try:
|
|
694
|
+
from src.version_checker import CURRENT_VERSION
|
|
695
|
+
ver_label = f"v{CURRENT_VERSION}"
|
|
696
|
+
except Exception:
|
|
697
|
+
ver_label = ""
|
|
698
|
+
header_text = f"⚡ TOKENSAFE UPDATED {ver_label} ⚡".strip()
|
|
699
|
+
|
|
700
|
+
print(f"\n{BOLD}{CYAN}╔════════════════════════════════════════════════════════════════════╗{RESET}")
|
|
701
|
+
print(f"{BOLD}{CYAN}║{header_text.center(68)}║{RESET}")
|
|
702
|
+
print(f"{BOLD}{CYAN}╚════════════════════════════════════════════════════════════════════╝{RESET}\n")
|
|
703
|
+
print(f" • Current Status: Local Guest (50,000 tokens/month) [{GREEN}Active Now{RESET}]")
|
|
704
|
+
print(f" • Monthly Usage: {used_tokens:,} / 50,000 tokens used ({pct:.1f}%)\n")
|
|
705
|
+
print(" Connect your free account to unlock:")
|
|
706
|
+
print(" ✔ 500,000 free tokens every month (10x boost)")
|
|
707
|
+
print(" ✔ Cloud Web Dashboard & live analytics (tokensafe.dev/dashboard)")
|
|
708
|
+
print(" ✔ Full code search & AST slicing across all AI agents\n")
|
|
709
|
+
|
|
710
|
+
answer = _read_input(f" {CYAN}→ Activate your free 500k Community license now? [{GREEN}Y{RESET}/n]: {RESET}").lower()
|
|
711
|
+
if answer in ("", "y", "yes"):
|
|
712
|
+
from src.cli import main as cli_main
|
|
713
|
+
cli_main(["login"])
|
|
714
|
+
else:
|
|
715
|
+
# Strict 1-step polite decline (no nagging on update)
|
|
716
|
+
print(f"\n {CYAN}ℹ{RESET} Continuing in Guest Mode (50,000 tokens/mo limit).")
|
|
717
|
+
print(f" Run {BOLD}tokensafe login{RESET} anytime in your terminal to unlock 500,000 free tokens/mo!\n")
|
|
686
718
|
return
|
|
687
719
|
|
|
688
720
|
print(f"\n{BOLD}{CYAN}╔════════════════════════════════════════════════════════════════════╗{RESET}")
|
package/src/mcp_server.py
CHANGED
package/src/telemetry_sync.py
CHANGED
|
@@ -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.1.
|
|
244
|
+
"User-Agent": "TokenSafe-Sync/4.1.10"
|
|
245
245
|
}
|
|
246
246
|
if active_key:
|
|
247
247
|
headers["Authorization"] = f"Bearer {active_key}"
|
package/src/version_checker.py
CHANGED
|
@@ -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.1.
|
|
20
|
+
CURRENT_VERSION = "4.1.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
|