vis-agent 0.5.22.dev9332__py3-none-any.whl → 0.5.22.dev9358__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.
@@ -310,7 +310,7 @@ class ClientExtensions:
310
310
  return
311
311
  self._draining = True
312
312
  try:
313
- batch = client.get_session_client_calls(session_id)
313
+ batch = client.routes.get_session_client_calls(session_id)
314
314
  if (
315
315
  not isinstance(batch, dict)
316
316
  or set(batch) != {"calls"}
@@ -324,14 +324,14 @@ class ClientExtensions:
324
324
  raise ProtocolError("invalid client extension call")
325
325
 
326
326
  def publish(presentation, call_id=call["id"]):
327
- client.post_session_client_call_activity(
327
+ client.routes.post_session_client_call_activity(
328
328
  session_id, call_id, body=presentation
329
329
  )
330
330
  return True
331
331
 
332
332
  result = self.dispatch(call, publish, client.session(session_id))
333
333
  try:
334
- client.post_session_client_call_result(
334
+ client.routes.post_session_client_call_result(
335
335
  session_id, call["id"], body=result
336
336
  )
337
337
  except GatewayError as error:
@@ -10,7 +10,7 @@ from typing import Any
10
10
  class SessionGroup:
11
11
  """A named group of sessions in one project.
12
12
 
13
- Get it from `ExecutionLayer.group`, `create_group` or `groups`. The record is
13
+ Get it from `EngineClient.group`, `create_group` or `groups`. The record is
14
14
  a snapshot of one read. ``color`` is a palette token, for example ``blue``.
15
15
  ``archived_at`` is None while the group is active.
16
16
  """
@@ -13,7 +13,7 @@ from collections.abc import Callable
13
13
  from pathlib import PurePosixPath
14
14
 
15
15
  from ._client import (
16
- ExecutionLayer,
16
+ EngineClient,
17
17
  ProtocolError,
18
18
  SessionOptions,
19
19
  TransportError,
@@ -21,11 +21,11 @@ from ._client import (
21
21
  from ._local import _envelope, _LocalJobEvents, _LocalSession, _reply, _request_frame
22
22
 
23
23
 
24
- class HostLayer(ExecutionLayer):
25
- """Execution layer that sends each SDK request through an extension host door.
24
+ class HostLayer(EngineClient):
25
+ """Client that sends each SDK request through an extension host door.
26
26
 
27
27
  `call` takes one JSON request frame and returns one JSON reply envelope. The
28
- extension module creates this layer; an extension does not construct it.
28
+ extension module creates this client; an extension does not construct it.
29
29
  Responses follow the gateway contract. Refusals raise `GatewayError`, and
30
30
  a host without a gateway raises `TransportError`. Events use polling.
31
31
  """
@@ -28,7 +28,7 @@ from urllib.parse import urlencode
28
28
 
29
29
  from ._client import (
30
30
  _PROTOCOL,
31
- ExecutionLayer,
31
+ EngineClient,
32
32
  JobEvents,
33
33
  ProtocolError,
34
34
  Session,
@@ -131,7 +131,7 @@ def _reply(status, decoded, headers):
131
131
  return _Reply(status, decoded, headers)
132
132
 
133
133
 
134
- class StdioEngineClient(ExecutionLayer):
134
+ class StdioEngineClient(EngineClient):
135
135
  """Own a private Vis process over standard input and output, without an HTTP server.
136
136
 
137
137
  `Agent()` without a client creates one of these. Use this class yourself when
@@ -157,10 +157,10 @@ class StdioEngineClient(ExecutionLayer):
157
157
  Construction is lazy. `connect` or context entry starts the subprocess, and repeated
158
158
  connection calls reuse it. `close` stops only this owned process and discards its
159
159
  temporary session database. It does not revert project edits or stop any separately
160
- running Vis server. Explicitly injected agents borrow this layer. Close those agents
161
- before you leave the layer's context. If you do not close the layer, the process
162
- stops and the temporary database is removed when Python collects the layer or exits.
163
- Do not rely on this: an unclosed layer keeps its process until then.
160
+ running Vis server. Explicitly injected agents borrow this client. Close those agents
161
+ before you leave the client's context. If you do not close the client, the process
162
+ stops and the temporary database is removed when Python collects the client or exits.
163
+ Do not rely on this: an unclosed client keeps its process until then.
164
164
 
165
165
  The first session of a new engine copy can take more than a minute, for example
166
166
  after the first download or an SDK update. The engine then prepares the installed
@@ -259,7 +259,7 @@ class StdioEngineClient(ExecutionLayer):
259
259
  def connect(self):
260
260
  """Start the owned process once and validate its protocol handshake.
261
261
 
262
- Return this layer for chaining. A closed layer cannot be restarted. After a
262
+ Return this client for chaining. A closed client cannot be restarted. After a
263
263
  failure or close, create a new one. A startup failure cleans up the process and
264
264
  temporary database before the error propagates.
265
265
  """
@@ -370,7 +370,7 @@ class StdioEngineClient(ExecutionLayer):
370
370
  return _reply(status, decoded, headers)
371
371
 
372
372
  def _session_create_timeout(self, timeout: float | None) -> float | None:
373
- """Wait for the first session up to the startup deadline of the layer."""
373
+ """Wait for the first session up to the startup deadline of the client."""
374
374
  return max(self.timeout, self._startup_timeout) if timeout is None else timeout
375
375
 
376
376
  def session(self, sid):