orgo 0.0.4__tar.gz → 0.0.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orgo
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: Desktop infrastructure for AI agents
5
5
  Author: Orgo Team
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "orgo"
7
- version = "0.0.4"
7
+ version = "0.0.5"
8
8
  description = "Desktop infrastructure for AI agents"
9
9
  authors = [{name = "Orgo Team"}]
10
10
  license = {text = "MIT"}
@@ -3,31 +3,21 @@
3
3
  import os
4
4
  import io
5
5
  import base64
6
- from typing import Dict, Any, Optional
6
+ from typing import Dict, Any
7
7
  from PIL import Image
8
8
 
9
9
  from .api.client import ApiClient
10
10
 
11
11
  class Computer:
12
- def __init__(self, project_id: Optional[str] = None, api_key: Optional[str] = None, config: Optional[Dict[str, Any]] = None):
13
- """
14
- Initialize a computer instance.
15
-
16
- Args:
17
- project_id: Existing project ID to connect to
18
- api_key: API key for authentication (falls back to ORGO_API_KEY env var)
19
- config: Configuration for creating a new computer
20
- """
12
+ def __init__(self, project_id=None, api_key=None, config=None):
21
13
  self.api = ApiClient(api_key or os.environ.get("ORGO_API_KEY"))
22
- self._info = {}
23
14
 
24
15
  if project_id:
25
- # Simply set the project ID if provided
26
16
  self.project_id = project_id
17
+ self._info = self.api.connect_computer(project_id)
27
18
  else:
28
- # Create a new computer instance
29
19
  response = self.api.create_computer(config)
30
- self.project_id = response.get("id")
20
+ self.project_id = response.get("name")
31
21
  self._info = response
32
22
 
33
23
  if not self.project_id:
@@ -75,13 +65,13 @@ class Computer:
75
65
  def screenshot(self) -> Image.Image:
76
66
  """Capture screenshot and return as PIL Image"""
77
67
  response = self.api.get_screenshot(self.project_id)
78
- img_data = base64.b64decode(response.get("image", ""))
68
+ img_data = base64.b64decode(response.get("screenshot", ""))
79
69
  return Image.open(io.BytesIO(img_data))
80
70
 
81
71
  def screenshot_base64(self) -> str:
82
72
  """Capture screenshot and return as base64 string"""
83
73
  response = self.api.get_screenshot(self.project_id)
84
- return response.get("image", "")
74
+ return response.get("screenshot", "")
85
75
 
86
76
  # Execution methods
87
77
  def bash(self, command: str) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orgo
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: Desktop infrastructure for AI agents
5
5
  Author: Orgo Team
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes