agentenv-framework-protocol 0.1.386__tar.gz → 0.1.387__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 (100) hide show
  1. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/PKG-INFO +1 -1
  2. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/pyproject.toml +1 -1
  3. agentenv_framework_protocol-0.1.387/src/agentenv_protocol/computer/serve.py +38 -0
  4. agentenv_framework_protocol-0.1.387/tests/test_computer_serve.py +75 -0
  5. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/.gitignore +0 -0
  6. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/LICENSE +0 -0
  7. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/NOTICE +0 -0
  8. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/README.md +0 -0
  9. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/THIRD_PARTY_NOTICES.md +0 -0
  10. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/examples/__init__.py +0 -0
  11. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/examples/advanced_agent.py +0 -0
  12. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/examples/basic_agent.py +0 -0
  13. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/examples/custom_extensions_agent.py +0 -0
  14. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/examples/multimodal_agent.py +0 -0
  15. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/examples/reference_model.py +0 -0
  16. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/examples/streaming_agent.py +0 -0
  17. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/__init__.py +0 -0
  18. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/__init__.py +0 -0
  19. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +0 -0
  20. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
  21. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/extensions.py +0 -0
  22. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/framework.py +0 -0
  23. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/peer_agents.py +0 -0
  24. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/proxy.py +0 -0
  25. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/registry.py +0 -0
  26. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
  27. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +0 -0
  28. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/a2a_agent/tasks/v1.py +0 -0
  29. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/agent_env_environment.py +0 -0
  30. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/client.py +0 -0
  31. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/__init__.py +0 -0
  32. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/_declare.py +0 -0
  33. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/card.py +0 -0
  34. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/checks.py +0 -0
  35. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/conformance/__init__.py +0 -0
  36. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/conformance/__main__.py +0 -0
  37. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/conformance/checks.py +0 -0
  38. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/conformance/client.py +0 -0
  39. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/conformance/fixture.py +0 -0
  40. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/conformance/mp4.py +0 -0
  41. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/conformance/report.py +0 -0
  42. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/dataplane.py +0 -0
  43. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/driver.py +0 -0
  44. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/errors.py +0 -0
  45. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/extensions.py +0 -0
  46. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/frames.py +0 -0
  47. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/keys.py +0 -0
  48. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/linux.py +0 -0
  49. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/manifest.py +0 -0
  50. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/operations.py +0 -0
  51. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/platform.py +0 -0
  52. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/queue.py +0 -0
  53. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/recording.py +0 -0
  54. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/results.py +0 -0
  55. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/runtime.py +0 -0
  56. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/settings.py +0 -0
  57. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/spaces.py +0 -0
  58. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/computer/tools.py +0 -0
  59. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/errors.py +0 -0
  60. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/manifest.py +0 -0
  61. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/preflight.py +0 -0
  62. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/tool_access.py +0 -0
  63. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/tool_client.py +0 -0
  64. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/tool_context.py +0 -0
  65. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/transfers.py +0 -0
  66. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/src/agentenv_protocol/types.py +0 -0
  67. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/computer_fake.py +0 -0
  68. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/probe_fake.py +0 -0
  69. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_a2a_agent.py +0 -0
  70. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_a2a_agent_examples.py +0 -0
  71. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_a2a_object_transfers.py +0 -0
  72. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_a2a_peer_agents.py +0 -0
  73. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_a2a_proxy.py +0 -0
  74. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_a2a_staging.py +0 -0
  75. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_a2a_trajectory_log.py +0 -0
  76. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_agent_env_environment.py +0 -0
  77. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_client.py +0 -0
  78. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_conformance.py +0 -0
  79. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_conformance_checks.py +0 -0
  80. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_conformance_recording.py +0 -0
  81. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_dataplane.py +0 -0
  82. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_declare.py +0 -0
  83. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_driver.py +0 -0
  84. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_extensions.py +0 -0
  85. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_frames.py +0 -0
  86. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_queue.py +0 -0
  87. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_recording.py +0 -0
  88. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_computer_spaces.py +0 -0
  89. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_data_objects.py +0 -0
  90. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_errors.py +0 -0
  91. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_extension_methods.py +0 -0
  92. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_intake.py +0 -0
  93. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_manifest.py +0 -0
  94. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_preflight.py +0 -0
  95. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_tool_access.py +0 -0
  96. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_tool_annotations.py +0 -0
  97. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_tool_client.py +0 -0
  98. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_tool_context.py +0 -0
  99. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_tool_context_fastmcp.py +0 -0
  100. {agentenv_framework_protocol-0.1.386 → agentenv_framework_protocol-0.1.387}/tests/test_tool_context_injection.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentenv-framework-protocol
3
- Version: 0.1.386
3
+ Version: 0.1.387
4
4
  Summary: Open data-plane protocol and server SDK for agent environments.
5
5
  Project-URL: Homepage, https://www.agentenvframework.com
6
6
  Project-URL: Documentation, https://www.agentenvframework.com/docs
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentenv-framework-protocol"
3
- version = "0.1.386"
3
+ version = "0.1.387"
4
4
  description = "Open data-plane protocol and server SDK for agent environments."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -0,0 +1,38 @@
1
+ """Serve a computer driver from its file, as a composed computer's program starts it:
2
+ ``python -m agentenv_protocol.computer.serve <file>:<Class>``, run in the driver's folder, serves the class on
3
+ ``MCP_PORT``. The file's folder is importable, so it may import its own modules."""
4
+ from __future__ import annotations
5
+
6
+ import importlib.util
7
+ import sys
8
+ from pathlib import Path
9
+
10
+ from .driver import ComputerDriverEnvironment
11
+
12
+ USAGE = "usage: python -m agentenv_protocol.computer.serve <file>:<Class>"
13
+
14
+
15
+ def main(argv: list[str]) -> None:
16
+ if len(argv) != 1 or ":" not in argv[0]:
17
+ raise SystemExit(USAGE)
18
+ file, _, name = argv[0].partition(":")
19
+ driver_class(Path(file), name)().serve()
20
+
21
+
22
+ def driver_class(file: Path, name: str) -> type[ComputerDriverEnvironment]:
23
+ """The class ``name`` in ``file``, imported as a module of its own; exits saying why when it isn't a driver."""
24
+ if not file.is_file():
25
+ raise SystemExit(f"{file} isn't a file")
26
+ sys.path.insert(0, str(file.resolve().parent))
27
+ spec = importlib.util.spec_from_file_location(file.stem, file)
28
+ module = importlib.util.module_from_spec(spec)
29
+ sys.modules[file.stem] = module
30
+ spec.loader.exec_module(module)
31
+ cls = getattr(module, name, None)
32
+ if not (isinstance(cls, type) and issubclass(cls, ComputerDriverEnvironment)):
33
+ raise SystemExit(f"{file} has no ComputerDriverEnvironment subclass named {name}")
34
+ return cls
35
+
36
+
37
+ if __name__ == "__main__":
38
+ main(sys.argv[1:])
@@ -0,0 +1,75 @@
1
+ """Serving a driver from its file: the class is imported with its folder importable and served; anything that isn't
2
+ a driver class exits saying why."""
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+
7
+ import pytest
8
+
9
+ pytest.importorskip("mcp.server.fastmcp")
10
+ pytest.importorskip("PIL")
11
+
12
+ from agentenv_protocol.computer import ComputerDriverEnvironment # noqa: E402
13
+ from agentenv_protocol.computer.serve import USAGE, main # noqa: E402
14
+
15
+ DRIVER = '''from desk_helpers import SIZE
16
+
17
+ from agentenv_protocol.computer import (ComputerDriverEnvironment, Display, capture, click, computer_driver, display,
18
+ drag, press, scroll, type_text)
19
+
20
+
21
+ @computer_driver(name="desk", supports=[{"os": {"type": "linux", "display": ["x11"]}, "arch": ["amd64"]}])
22
+ class Desk(ComputerDriverEnvironment):
23
+ @display
24
+ def size(self): return Display(*SIZE)
25
+
26
+ @capture
27
+ def grab(self): ...
28
+
29
+ @click
30
+ def click(self, x, y, button, count): ...
31
+
32
+ @drag
33
+ def drag(self, path, button): ...
34
+
35
+ @scroll
36
+ def scroll(self, x, y, dx, dy): ...
37
+
38
+ @type_text
39
+ def type(self, text): ...
40
+
41
+ @press
42
+ def press(self, keys): ...
43
+ '''
44
+
45
+
46
+ @pytest.fixture
47
+ def served(monkeypatch):
48
+ calls = []
49
+ monkeypatch.setattr(ComputerDriverEnvironment, "serve", lambda self: calls.append(type(self).__name__))
50
+ monkeypatch.setattr(sys, "path", list(sys.path))
51
+ monkeypatch.setattr(sys, "modules", dict(sys.modules))
52
+ return calls
53
+
54
+
55
+ def test_the_class_is_imported_from_its_file_with_its_folder_importable_and_served(tmp_path, served):
56
+ (tmp_path / "driver.py").write_text(DRIVER)
57
+ (tmp_path / "desk_helpers.py").write_text("SIZE = (10, 10)\n")
58
+
59
+ main([f"{tmp_path / 'driver.py'}:Desk"])
60
+
61
+ assert served == ["Desk"]
62
+
63
+
64
+ @pytest.mark.parametrize("argv, message", [
65
+ ([], USAGE), (["driver.py"], USAGE), (["missing.py:Desk"], "missing.py isn't a file"),
66
+ (["driver.py:Helper"], "has no ComputerDriverEnvironment subclass named Helper"),
67
+ ], ids=["nothing", "no-class", "no-file", "not-a-driver"])
68
+ def test_what_isnt_a_driver_class_exits_saying_why(tmp_path, served, monkeypatch, argv, message):
69
+ (tmp_path / "driver.py").write_text("class Helper:\n pass\n")
70
+ monkeypatch.chdir(tmp_path)
71
+
72
+ with pytest.raises(SystemExit) as stopped:
73
+ main(argv)
74
+
75
+ assert message in str(stopped.value) and served == []