anna-app-runtime-local 0.2.0a33__tar.gz → 0.2.0a34__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 (19) hide show
  1. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/PKG-INFO +2 -2
  2. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/pyproject.toml +2 -2
  3. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/src/anna_app_runtime_local/__init__.py +1 -1
  4. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/src/anna_app_runtime_local/bridge.py +12 -6
  5. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/src/anna_app_runtime_local/executa.py +2 -5
  6. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/src/anna_app_runtime_local/web_local.py +1 -3
  7. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/tests/test_frame_limits.py +5 -5
  8. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/.gitignore +0 -0
  9. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/README.md +0 -0
  10. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/src/anna_app_runtime_local/jobs.py +0 -0
  11. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/src/anna_app_runtime_local/session.py +0 -0
  12. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/src/anna_app_runtime_local/store.py +0 -0
  13. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/src/anna_app_runtime_local/token.py +0 -0
  14. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/tests/__init__.py +0 -0
  15. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/tests/conftest.py +0 -0
  16. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/tests/test_local_dispatch.py +0 -0
  17. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/tests/test_reverse_rpc.py +0 -0
  18. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/tests/test_tool_jobs.py +0 -0
  19. {anna_app_runtime_local-0.2.0a33 → anna_app_runtime_local-0.2.0a34}/tests/test_web_local_images.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: anna-app-runtime-local
3
- Version: 0.2.0a33
3
+ Version: 0.2.0a34
4
4
  Summary: Local-dev in-memory runtime for Anna Apps. Wraps anna-app-core's dispatcher with an InMemoryWindowStore + WebSocket bridge.
5
5
  Author: Talent AI
6
6
  License: Proprietary
7
7
  Keywords: anna,anna-app,dev,executa,harness
8
8
  Requires-Python: >=3.10
9
- Requires-Dist: anna-app-core<0.29,>=0.28.0
9
+ Requires-Dist: anna-app-core<0.30,>=0.29.0
10
10
  Requires-Dist: ddgs<10,>=9.13
11
11
  Description-Content-Type: text/markdown
12
12
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "anna-app-runtime-local"
3
- version = "0.2.0a33"
3
+ version = "0.2.0a34"
4
4
  description = "Local-dev in-memory runtime for Anna Apps. Wraps anna-app-core's dispatcher with an InMemoryWindowStore + WebSocket bridge."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -36,7 +36,7 @@ keywords = ["anna", "anna-app", "executa", "dev", "harness"]
36
36
  # (platform-media-generation-music §7) — same bridge-forward / not_implemented
37
37
  # contract as video.*.
38
38
  dependencies = [
39
- "anna-app-core>=0.28.0,<0.29",
39
+ "anna-app-core>=0.29.0,<0.30",
40
40
  "ddgs>=9.13,<10",
41
41
  ]
42
42
 
@@ -29,4 +29,4 @@ __all__ = [
29
29
  "DevTokenError",
30
30
  ]
31
31
 
32
- __version__ = "0.2.0a33"
32
+ __version__ = "0.2.0a34"
@@ -74,7 +74,11 @@ from .executa import (
74
74
  frame_rpc_id,
75
75
  read_frame,
76
76
  )
77
- from .session import LocalDispatcherSession, LocalServerRequestHandler, LocalSessionError
77
+ from .session import (
78
+ LocalDispatcherSession,
79
+ LocalServerRequestHandler,
80
+ LocalSessionError,
81
+ )
78
82
  from .store import InMemoryWindowStore, _HostCallError
79
83
  from .token import mint_dev_token
80
84
 
@@ -91,7 +95,9 @@ class _Bridge:
91
95
  executa_pool=self._executa_pool,
92
96
  host_call=self._call_host,
93
97
  aps_forward_storage=(
94
- os.environ.get("ANNA_APP_RUNTIME_STORAGE_MODE", "legacy").strip().lower()
98
+ os.environ.get("ANNA_APP_RUNTIME_STORAGE_MODE", "legacy")
99
+ .strip()
100
+ .lower()
95
101
  == "aps"
96
102
  ),
97
103
  web_forward_real=(
@@ -171,7 +177,9 @@ class _Bridge:
171
177
  else f"jsonrpc_{code}"
172
178
  )
173
179
  fut.set_exception(
174
- _HostCallError(string_code, str(err.get("message", "unknown error")), data)
180
+ _HostCallError(
181
+ string_code, str(err.get("message", "unknown error")), data
182
+ )
175
183
  )
176
184
  else:
177
185
  result = env.get("result")
@@ -351,9 +359,7 @@ async def _iter_stdin_lines() -> AsyncIterator[bytes | OversizedFrame]:
351
359
  finally:
352
360
  loop.call_soon_threadsafe(queue.put_nowait, None)
353
361
 
354
- threading.Thread(
355
- target=_pump, name="anna-bridge-stdin", daemon=True
356
- ).start()
362
+ threading.Thread(target=_pump, name="anna-bridge-stdin", daemon=True).start()
357
363
 
358
364
  while True:
359
365
  item = await queue.get()
@@ -460,9 +460,7 @@ class ExecutaPool:
460
460
  fut.set_result(msg.get("result"))
461
461
  except Exception as e: # transport failure — NOT a plugin exit
462
462
  close_reason = f"executa stdout reader failed: {e!r}"
463
- logger.exception(
464
- "stdout reader for '%s' crashed", ep.spec.tool_id
465
- )
463
+ logger.exception("stdout reader for '%s' crashed", ep.spec.tool_id)
466
464
  finally:
467
465
  ep.closed = True
468
466
  for fut in ep.pending.values():
@@ -517,8 +515,7 @@ class ExecutaPool:
517
515
  )
518
516
  return
519
517
  logger.warning(
520
- "oversized frame from '%s' dropped (%d bytes, no matching "
521
- "pending call)",
518
+ "oversized frame from '%s' dropped (%d bytes, no matching " "pending call)",
522
519
  ep.spec.tool_id,
523
520
  frame.size,
524
521
  )
@@ -229,9 +229,7 @@ def _image_search_sync(args: dict[str, Any]) -> list[dict[str, Any]]:
229
229
  max_results = min(int(args.get("max_results") or 8), 50)
230
230
  with DDGS(timeout=10) as d:
231
231
  try:
232
- raw = list(
233
- d.images(query, max_results=max_results * 2, safesearch="on")
234
- )
232
+ raw = list(d.images(query, max_results=max_results * 2, safesearch="on"))
235
233
  except Exception as e: # noqa: BLE001
236
234
  if _is_no_results(e):
237
235
  return [] # 零结果≠失败
@@ -32,8 +32,7 @@ from anna_app_runtime_local.executa import (
32
32
  )
33
33
 
34
34
  # A minimal stdio plugin: `invoke` with {"size": N} echoes an N-byte payload.
35
- _STUB_PLUGIN = textwrap.dedent(
36
- """
35
+ _STUB_PLUGIN = textwrap.dedent("""
37
36
  import json, sys
38
37
  for line in sys.stdin:
39
38
  req = json.loads(line)
@@ -46,8 +45,7 @@ _STUB_PLUGIN = textwrap.dedent(
46
45
  }
47
46
  sys.stdout.write(json.dumps(resp) + "\\n")
48
47
  sys.stdout.flush()
49
- """
50
- )
48
+ """)
51
49
 
52
50
 
53
51
  def _stub_pool(tmp_path) -> ExecutaPool:
@@ -309,7 +307,9 @@ async def test_bridge_survives_oversized_request(tmp_path):
309
307
 
310
308
  # Bridge must still be alive and serving.
311
309
  proc.stdin.write(
312
- json.dumps({"jsonrpc": "2.0", "id": 2, "method": "ping", "params": {}}).encode()
310
+ json.dumps(
311
+ {"jsonrpc": "2.0", "id": 2, "method": "ping", "params": {}}
312
+ ).encode()
313
313
  + b"\n"
314
314
  )
315
315
  await proc.stdin.drain()