trinity-lite 0.7.1__tar.gz → 0.7.2__tar.gz

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.
Files changed (45) hide show
  1. {trinity_lite-0.7.1/trinity_lite.egg-info → trinity_lite-0.7.2}/PKG-INFO +1 -1
  2. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/pyproject.toml +1 -1
  3. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_mcp_server.py +13 -0
  4. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/__init__.py +1 -1
  5. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/mcp_server.py +15 -4
  6. {trinity_lite-0.7.1 → trinity_lite-0.7.2/trinity_lite.egg-info}/PKG-INFO +1 -1
  7. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/LICENSE +0 -0
  8. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/README.md +0 -0
  9. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/setup.cfg +0 -0
  10. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_bus.py +0 -0
  11. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_cli.py +0 -0
  12. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_doctor.py +0 -0
  13. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_guard.py +0 -0
  14. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_init.py +0 -0
  15. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_orchestrator.py +0 -0
  16. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_pipeline.py +0 -0
  17. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_proof.py +0 -0
  18. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_router.py +0 -0
  19. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_worker.py +0 -0
  20. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/tests/test_worktree.py +0 -0
  21. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/__main__.py +0 -0
  22. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/adapters.py +0 -0
  23. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/bus.py +0 -0
  24. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/cli.py +0 -0
  25. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/config.py +0 -0
  26. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/doctor.py +0 -0
  27. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/guard.py +0 -0
  28. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/init.py +0 -0
  29. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/model_autodetect.py +0 -0
  30. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/model_pool_wizard.py +0 -0
  31. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/model_selector.py +0 -0
  32. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/orchestrator.py +0 -0
  33. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/paths.py +0 -0
  34. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/pipeline.py +0 -0
  35. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/proof.py +0 -0
  36. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/py.typed +0 -0
  37. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/router.py +0 -0
  38. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/validation.py +0 -0
  39. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/worker.py +0 -0
  40. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite/worktree.py +0 -0
  41. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite.egg-info/SOURCES.txt +0 -0
  42. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite.egg-info/dependency_links.txt +0 -0
  43. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite.egg-info/entry_points.txt +0 -0
  44. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite.egg-info/requires.txt +0 -0
  45. {trinity_lite-0.7.1 → trinity_lite-0.7.2}/trinity_lite.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trinity-lite
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Local AgentOps for cross-vendor CLI agents: route work, recover state, and accept only with evidence.
5
5
  Author: Yomiracle
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "trinity-lite"
7
- version = "0.7.1"
7
+ version = "0.7.2"
8
8
  description = "Local AgentOps for cross-vendor CLI agents: route work, recover state, and accept only with evidence."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -75,6 +75,19 @@ class McpServerTest(unittest.TestCase):
75
75
  resp = self._call(self._msg("initialized"))
76
76
  self.assertIsNone(resp)
77
77
 
78
+ def test_notifications_initialized_returns_none(self):
79
+ # Real MCP clients send `notifications/initialized` (no id) after
80
+ # initialize. Must return None and never emit an id:null error.
81
+ resp = self._call({"jsonrpc": "2.0", "method": "notifications/initialized"})
82
+ self.assertIsNone(resp)
83
+
84
+ def test_unknown_notification_returns_none(self):
85
+ # Any notification (no id) must not receive a response, even if the
86
+ # method is unknown. Regression for id:null error responses that
87
+ # crashed the official mcp SDK >= 2.x stdio transport.
88
+ resp = self._call({"jsonrpc": "2.0", "method": "notifications/whatever"})
89
+ self.assertIsNone(resp)
90
+
78
91
  def test_shutdown_returns_empty_result(self):
79
92
  resp = self._call(self._msg("shutdown", 1, {}))
80
93
  self.assertEqual(resp["id"], 1)
@@ -1,3 +1,3 @@
1
1
  """Trinity Lite: local AgentOps for cross-vendor CLI agents."""
2
2
 
3
- __version__ = "0.7.1"
3
+ __version__ = "0.7.2"
@@ -374,6 +374,7 @@ RESOURCE_DEFINITIONS = [
374
374
  ALLOWED_METHODS = {
375
375
  "initialize",
376
376
  "initialized",
377
+ "notifications/initialized",
377
378
  "tools/list",
378
379
  "tools/call",
379
380
  "resources/list",
@@ -1073,6 +1074,13 @@ def handle_request(msg, bus, agents_path, routes_path):
1073
1074
  id_ = msg.get("id")
1074
1075
  params = msg.get("params", {})
1075
1076
 
1077
+ # JSON-RPC 2.0: notifications carry no `id` and must NOT receive a
1078
+ # response. Silently accept any notification (known or unknown) so we
1079
+ # never emit an `id: null` error response, which the official `mcp`
1080
+ # SDK >= 2.x stdio transport fails to validate and closes the stream.
1081
+ if id_ is None:
1082
+ return None
1083
+
1076
1084
  if method not in ALLOWED_METHODS:
1077
1085
  return jsonrpc_error(id_, -32601, "method not found: {}".format(method))
1078
1086
 
@@ -1083,7 +1091,7 @@ def handle_request(msg, bus, agents_path, routes_path):
1083
1091
  "serverInfo": {"name": SERVER_NAME, "version": SERVER_VERSION},
1084
1092
  })
1085
1093
 
1086
- if method == "initialized":
1094
+ if method in ("initialized", "notifications/initialized"):
1087
1095
  return None
1088
1096
 
1089
1097
  if method == "tools/list":
@@ -1143,9 +1151,12 @@ def serve(bus, agents_path=None, routes_path=None):
1143
1151
  except Exception:
1144
1152
  tb = traceback.format_exc()
1145
1153
  print("[mcp] unhandled exception:\n{}".format(tb), file=sys.stderr, flush=True)
1146
- error_resp = jsonrpc_error(msg.get("id"), -32603, "internal server error")
1147
- sys.stdout.write(json.dumps(error_resp) + "\n")
1148
- sys.stdout.flush()
1154
+ # Don't emit an `id: null` error for notifications (no id).
1155
+ _err_id = msg.get("id")
1156
+ if _err_id is not None:
1157
+ error_resp = jsonrpc_error(_err_id, -32603, "internal server error")
1158
+ sys.stdout.write(json.dumps(error_resp) + "\n")
1159
+ sys.stdout.flush()
1149
1160
  continue
1150
1161
 
1151
1162
  # Write response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trinity-lite
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Local AgentOps for cross-vendor CLI agents: route work, recover state, and accept only with evidence.
5
5
  Author: Yomiracle
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes