libentry 1.27__py3-none-any.whl → 1.28__py3-none-any.whl

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.
libentry/mcp/client.py CHANGED
@@ -144,11 +144,16 @@ class SubroutineMixIn(abc.ABC):
144
144
 
145
145
  @staticmethod
146
146
  def _iter_results_from_subroutine(responses: Iterable[SubroutineResponse]) -> Iterable[JSONType]:
147
+ full_result = None
147
148
  for response in responses:
148
149
  if response.error is None:
149
- yield response.result
150
+ if response.chunk:
151
+ yield response.result
152
+ else:
153
+ full_result = response.result
150
154
  else:
151
155
  raise ServiceError.from_subroutine_error(response.error)
156
+ return full_result
152
157
 
153
158
  def get(
154
159
  self,
libentry/mcp/service.py CHANGED
@@ -98,24 +98,26 @@ class SubroutineAdapter:
98
98
  @staticmethod
99
99
  def _iter_response(
100
100
  results: Iterable[Any]
101
- ) -> Generator[SubroutineResponse, None, Optional[SubroutineResponse]]:
101
+ ) -> Iterable[SubroutineResponse]:
102
102
  it = iter(results)
103
103
  while True:
104
104
  try:
105
105
  result = next(it)
106
106
  if not isinstance(result, SubroutineResponse):
107
107
  result = SubroutineResponse(result=result)
108
+ result.chunk = True
108
109
  yield result
109
110
  except StopIteration as e:
110
111
  final_result = e.value
111
112
  if not isinstance(final_result, SubroutineResponse):
112
113
  final_result = SubroutineResponse(result=final_result)
114
+ final_result.chunk = False
115
+ yield final_result
113
116
  break
114
117
  except Exception as e:
115
118
  final_result = SubroutineResponse(error=SubroutineError.from_exception(e))
116
119
  yield final_result
117
120
  break
118
- return final_result
119
121
 
120
122
 
121
123
  class JSONRPCAdapter:
libentry/mcp/types.py CHANGED
@@ -48,6 +48,7 @@ class SubroutineError(BaseModel):
48
48
  class SubroutineResponse(BaseModel):
49
49
  result: Optional[Any] = None
50
50
  error: Optional[SubroutineError] = None
51
+ chunk: bool = False
51
52
 
52
53
 
53
54
  class HTTPOptions(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: libentry
3
- Version: 1.27
3
+ Version: 1.28
4
4
  Summary: Entries for experimental utilities.
5
5
  Home-page: https://github.com/XoriieInpottn/libentry
6
6
  Author: xi
@@ -12,9 +12,9 @@ libentry/test_api.py,sha256=bs7P8gveLtuUvHxrpujSrfuYqLVJ3fOXVg_MZnZxoJ4,4504
12
12
  libentry/utils.py,sha256=vCm6UyAlibnPOlPJHZO57u3TXhw5PZmGM5_vBAPUnB4,1981
13
13
  libentry/mcp/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
14
14
  libentry/mcp/api.py,sha256=GDErVCz_hh_ZeMxLS8bTPyBUhCTHw3Mm-nGFMV2W2yo,3669
15
- libentry/mcp/client.py,sha256=qFbigNIOJvEf8ZICN2K8nnmVcITIzDhJgaw3c0P-WXM,23078
16
- libentry/mcp/service.py,sha256=YMzP9sTR6RaeguwbwapFZFcc7MjKuDDfpeXSCD09Xzg,39081
17
- libentry/mcp/types.py,sha256=aAoVO4jjqEvDzNneuZapmRYonLLnGsbcLoypVyRNNYg,12389
15
+ libentry/mcp/client.py,sha256=OzAgM-hZ5t24A7MC-i_FkchxQaYM17T6E6M0jPuZJwk,23243
16
+ libentry/mcp/service.py,sha256=cE6K6RVDQ9Jc4pxcJUWOr5zWJMpSvROL54cq8vbJWHE,39130
17
+ libentry/mcp/types.py,sha256=P4lnwDCdETTzfoD7u1XMqx9ZKN4mXl0KSEMk4e_o_k0,12413
18
18
  libentry/service/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
19
19
  libentry/service/common.py,sha256=OVaW2afgKA6YqstJmtnprBCqQEUZEWotZ6tHavmJJeU,42
20
20
  libentry/service/flask.py,sha256=2egCFFhRAfLpmSyibgaJ-3oexI-j27P1bmaPEn-hSlc,13817
@@ -22,10 +22,10 @@ libentry/service/list.py,sha256=ElHWhTgShGOhaxMUEwVbMXos0NQKjHsODboiQ-3AMwE,1397
22
22
  libentry/service/running.py,sha256=FrPJoJX6wYxcHIysoatAxhW3LajCCm0Gx6l7__6sULQ,5105
23
23
  libentry/service/start.py,sha256=mZT7b9rVULvzy9GTZwxWnciCHgv9dbGN2JbxM60OMn4,1270
24
24
  libentry/service/stop.py,sha256=wOpwZgrEJ7QirntfvibGq-XsTC6b3ELhzRW2zezh-0s,1187
25
- libentry-1.27.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
26
- libentry-1.27.dist-info/METADATA,sha256=4Kmb2RNxxAYb26wbovxkx8haDAaW7tBg_JEuxPwkwuI,1133
27
- libentry-1.27.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
28
- libentry-1.27.dist-info/entry_points.txt,sha256=1v_nLVDsjvVJp9SWhl4ef2zZrsLTBtFWgrYFgqvQBgc,61
29
- libentry-1.27.dist-info/top_level.txt,sha256=u2uF6-X5fn2Erf9PYXOg_6tntPqTpyT-yzUZrltEd6I,9
30
- libentry-1.27.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
31
- libentry-1.27.dist-info/RECORD,,
25
+ libentry-1.28.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
26
+ libentry-1.28.dist-info/METADATA,sha256=NmtlVZk1U8IW_q8pw22_e6UF3UvAhgIhFLyzF3i1BRU,1133
27
+ libentry-1.28.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
28
+ libentry-1.28.dist-info/entry_points.txt,sha256=1v_nLVDsjvVJp9SWhl4ef2zZrsLTBtFWgrYFgqvQBgc,61
29
+ libentry-1.28.dist-info/top_level.txt,sha256=u2uF6-X5fn2Erf9PYXOg_6tntPqTpyT-yzUZrltEd6I,9
30
+ libentry-1.28.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
31
+ libentry-1.28.dist-info/RECORD,,