tokensafe 4.7.8 → 4.7.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/auto_inject.py +312 -33
- package/src/installer.py +17 -10
- package/src/mcp_server.py +133 -14
- package/src/oumv_gateway.py +376 -52
- package/src/retrofit.py +69 -10
- package/src/telemetry_sync.py +1 -1
- package/src/version_checker.py +1 -1
package/src/retrofit.py
CHANGED
|
@@ -4,9 +4,11 @@ Enables existing frontend and backend projects to adopt the OUMV protocol
|
|
|
4
4
|
incrementally without migrating frameworks or restructuring codebases.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
+
import glob
|
|
7
8
|
import os
|
|
8
9
|
import json
|
|
9
10
|
import time
|
|
11
|
+
from pathlib import Path
|
|
10
12
|
from typing import Dict, Any, List, Optional, Tuple
|
|
11
13
|
|
|
12
14
|
# Top-level directories that hold frontend source in a repo-root app (as opposed to
|
|
@@ -310,6 +312,44 @@ def detect_project_stack(workspace_dir: str) -> Dict[str, Any]:
|
|
|
310
312
|
})
|
|
311
313
|
break
|
|
312
314
|
|
|
315
|
+
# ASP.NET Core detection: Microsoft.NET.Sdk.Web or the ASP.NET Core
|
|
316
|
+
# framework reference in a csproj.
|
|
317
|
+
for csproj in sorted(glob.glob(os.path.join(target_dir, "**", "*.csproj"), recursive=True)):
|
|
318
|
+
if any(part in ("bin", "obj", "node_modules") for part in Path(csproj).parts):
|
|
319
|
+
continue
|
|
320
|
+
try:
|
|
321
|
+
with open(csproj, "r", encoding="utf-8", errors="replace") as f:
|
|
322
|
+
csproj_content = f.read()
|
|
323
|
+
except Exception:
|
|
324
|
+
continue
|
|
325
|
+
if "Microsoft.NET.Sdk.Web" not in csproj_content and "Microsoft.AspNetCore.App" not in csproj_content:
|
|
326
|
+
continue
|
|
327
|
+
rel_csproj = os.path.relpath(csproj, workspace_dir)
|
|
328
|
+
_add_detected(rel_csproj)
|
|
329
|
+
if "nuget/dotnet" not in stack["package_managers"]:
|
|
330
|
+
stack["package_managers"].append("nuget/dotnet")
|
|
331
|
+
dotnet_entry = {
|
|
332
|
+
"framework": "aspnetcore",
|
|
333
|
+
"provider": "dotnet",
|
|
334
|
+
"adapter": "tokensafe-backend/dotnet",
|
|
335
|
+
"language": "csharp",
|
|
336
|
+
"root": os.path.dirname(rel_csproj) or ".",
|
|
337
|
+
"oumv_supported": True,
|
|
338
|
+
"status": "ready",
|
|
339
|
+
}
|
|
340
|
+
if not stack["backend"] or not stack["backend"].get("oumv_supported", False):
|
|
341
|
+
stack["backend"] = dotnet_entry
|
|
342
|
+
_add_package({
|
|
343
|
+
"role": "backend",
|
|
344
|
+
"path": dotnet_entry["root"],
|
|
345
|
+
"framework": "aspnetcore",
|
|
346
|
+
"provider": "dotnet",
|
|
347
|
+
"adapter": "tokensafe-backend/dotnet",
|
|
348
|
+
"oumvSupported": True,
|
|
349
|
+
"status": "ready",
|
|
350
|
+
})
|
|
351
|
+
break
|
|
352
|
+
|
|
313
353
|
composer_path = os.path.join(target_dir, "composer.json")
|
|
314
354
|
if os.path.isfile(composer_path):
|
|
315
355
|
try:
|
|
@@ -476,21 +516,14 @@ def get_adapters_catalog() -> List[Dict[str, Any]]:
|
|
|
476
516
|
"profiles": ["frontend"],
|
|
477
517
|
"repo": "tokensafe-ui",
|
|
478
518
|
"mode": "hybrid",
|
|
479
|
-
"status": "
|
|
480
|
-
"description": "
|
|
519
|
+
"status": "planned",
|
|
520
|
+
"description": "Planned: fine-grained reactive signals causality + virtual DOM observer. No Solid runtime adapter is implemented yet (the tokensafe-ui plugin ships React and Vue); a Solid repo must use static analysis tools instead",
|
|
481
521
|
"technology": {
|
|
482
522
|
"language": "typescript",
|
|
483
523
|
"framework": "solidjs",
|
|
484
524
|
"package": {"manager": "npm", "name": "tokensafe-ui", "install": "npm install tokensafe-ui"},
|
|
485
525
|
},
|
|
486
|
-
"capabilities": [
|
|
487
|
-
{"name": "observe.resources", "constraints": {"readOnly": True, "developmentOnly": False}},
|
|
488
|
-
{"name": "observe.runtime_state", "constraints": {"readOnly": True, "developmentOnly": True}},
|
|
489
|
-
{"name": "understand.causality", "constraints": {"readOnly": True, "developmentOnly": True}},
|
|
490
|
-
{"name": "understand.impact", "constraints": {"readOnly": True, "developmentOnly": False}},
|
|
491
|
-
{"name": "mutate.source", "constraints": {"readOnly": False, "developmentOnly": False, "requiresPermission": "permissions.mutate != false"}},
|
|
492
|
-
{"name": "verify.runtime_behavior", "constraints": {"readOnly": True, "developmentOnly": True}},
|
|
493
|
-
],
|
|
526
|
+
"capabilities": [],
|
|
494
527
|
},
|
|
495
528
|
{
|
|
496
529
|
"id": "frontend/vue",
|
|
@@ -585,6 +618,32 @@ def get_adapters_catalog() -> List[Dict[str, Any]]:
|
|
|
585
618
|
{"name": "verify.behavior", "constraints": {"readOnly": True, "developmentOnly": True}},
|
|
586
619
|
],
|
|
587
620
|
},
|
|
621
|
+
{
|
|
622
|
+
"id": "backend/aspnetcore",
|
|
623
|
+
"name": "ASP.NET Core Adapter (minimal APIs, MVC controllers, EF Core)",
|
|
624
|
+
"profile": "backend",
|
|
625
|
+
"profiles": ["backend"],
|
|
626
|
+
"repo": "tokensafe-backend/dotnet",
|
|
627
|
+
"mode": "hybrid",
|
|
628
|
+
"status": "ready",
|
|
629
|
+
"description": "In-process endpoint dispatch for minimal APIs and controllers, Roslyn syntax pre-flight, and verify.sandboxRollback that rolls every auto-discovered EF Core DbContext back",
|
|
630
|
+
"technology": {
|
|
631
|
+
"language": "csharp",
|
|
632
|
+
"framework": "aspnetcore",
|
|
633
|
+
"package": {
|
|
634
|
+
"manager": "nuget",
|
|
635
|
+
"name": "TokenSafe.Oumv.AspNetCore",
|
|
636
|
+
"install": "dotnet add package TokenSafe.Oumv.AspNetCore",
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
"capabilities": [
|
|
640
|
+
{"name": "observe.resources", "constraints": {"readOnly": True, "developmentOnly": False}},
|
|
641
|
+
{"name": "observe.runtime_state", "constraints": {"readOnly": True, "developmentOnly": False}},
|
|
642
|
+
{"name": "understand.causality", "constraints": {"readOnly": True, "developmentOnly": False, "limitations": ["requires observed request traces (UseTokensafe middleware or oumv/verify)"]}},
|
|
643
|
+
{"name": "mutate.source", "constraints": {"readOnly": False, "developmentOnly": False, "requiresPermission": "permissions.mutate != false"}},
|
|
644
|
+
{"name": "verify.runtime_behavior", "constraints": {"readOnly": True, "developmentOnly": False}},
|
|
645
|
+
],
|
|
646
|
+
},
|
|
588
647
|
{
|
|
589
648
|
"id": "backend/spring",
|
|
590
649
|
"name": "Spring Boot Adapter (JDK-only sidecar)",
|
package/src/telemetry_sync.py
CHANGED
|
@@ -311,7 +311,7 @@ class TelemetrySync:
|
|
|
311
311
|
current_last_id = last_id
|
|
312
312
|
headers = {
|
|
313
313
|
"Content-Type": "application/json",
|
|
314
|
-
"User-Agent": "TokenSafe-Sync/4.7.
|
|
314
|
+
"User-Agent": "TokenSafe-Sync/4.7.10"
|
|
315
315
|
}
|
|
316
316
|
if active_key:
|
|
317
317
|
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.7.
|
|
20
|
+
CURRENT_VERSION = "4.7.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
|