use-computer 0.0.6__tar.gz → 0.0.7__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 (41) hide show
  1. {use_computer-0.0.6 → use_computer-0.0.7}/PKG-INFO +1 -1
  2. {use_computer-0.0.6 → use_computer-0.0.7}/examples/_4_file_transfer.py +1 -0
  3. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/tasks/__init__.py +25 -1
  4. {use_computer-0.0.6 → use_computer-0.0.7}/pyproject.toml +1 -1
  5. {use_computer-0.0.6 → use_computer-0.0.7}/.env.example +0 -0
  6. {use_computer-0.0.6 → use_computer-0.0.7}/.gitignore +0 -0
  7. {use_computer-0.0.6 → use_computer-0.0.7}/.pre-commit-config.yaml +0 -0
  8. {use_computer-0.0.6 → use_computer-0.0.7}/README.md +0 -0
  9. {use_computer-0.0.6 → use_computer-0.0.7}/examples/_1_hello_macos.py +0 -0
  10. {use_computer-0.0.6 → use_computer-0.0.7}/examples/_2_hello_ios.py +0 -0
  11. {use_computer-0.0.6 → use_computer-0.0.7}/examples/_3_recording.py +0 -0
  12. {use_computer-0.0.6 → use_computer-0.0.7}/examples/_5_keepalive.py +0 -0
  13. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/__init__.py +0 -0
  14. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/ax_transpile.py +0 -0
  15. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/client.py +0 -0
  16. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/display.py +0 -0
  17. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/errors.py +0 -0
  18. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/ios/__init__.py +0 -0
  19. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/ios/apps.py +0 -0
  20. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/ios/environment.py +0 -0
  21. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/ios/input.py +0 -0
  22. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/macos/__init__.py +0 -0
  23. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/macos/keyboard.py +0 -0
  24. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/macos/mouse.py +0 -0
  25. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/models.py +0 -0
  26. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/parsers.py +0 -0
  27. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/py.typed +0 -0
  28. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/recording.py +0 -0
  29. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/retry.py +0 -0
  30. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/sandbox.py +0 -0
  31. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/screenshot.py +0 -0
  32. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/tasks/templates/pre_command.sh +0 -0
  33. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/tasks/templates/task.toml +0 -0
  34. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/tasks/templates/test_ios.sh +0 -0
  35. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/tasks/templates/test_ios_nograder.sh +0 -0
  36. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/tasks/templates/test_macos.sh +0 -0
  37. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/tasks/templates/test_macos_check.sh +0 -0
  38. {use_computer-0.0.6 → use_computer-0.0.7}/mmini/tasks/templates/test_macos_nograder.sh +0 -0
  39. {use_computer-0.0.6 → use_computer-0.0.7}/use_computer/__init__.py +0 -0
  40. {use_computer-0.0.6 → use_computer-0.0.7}/use_computer/py.typed +0 -0
  41. {use_computer-0.0.6 → use_computer-0.0.7}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: use-computer
3
- Version: 0.0.6
3
+ Version: 0.0.7
4
4
  Summary: Python SDK for the use.computer macOS and iOS Computer Use API
5
5
  Project-URL: Homepage, https://use.computer
6
6
  Project-URL: Documentation, https://api.use.computer/docs
@@ -1,6 +1,7 @@
1
1
  from use_computer import Computer
2
2
 
3
3
  with Computer().create() as mac:
4
+ # Seed data files the task needs before handing the sandbox to an agent.
4
5
  mac.upload_bytes(b"hello from use.computer\n", "/Users/lume/Desktop/hello.txt")
5
6
  mac.download_file("/Users/lume/Desktop/hello.txt", "hello.txt")
6
7
  print("saved hello.txt")
@@ -29,6 +29,13 @@ def _render(text: str, **kwargs: str) -> str:
29
29
  return out
30
30
 
31
31
 
32
+ def _strip_ios_prefix(s: str, kind: str) -> str:
33
+ """Drop boilerplate `com.apple.CoreSimulator.<kind>.` so the toml is readable.
34
+ `kind` is "SimDeviceType" or "SimRuntime"."""
35
+ prefix = f"com.apple.CoreSimulator.{kind}."
36
+ return s[len(prefix) :] if s.startswith(prefix) else s
37
+
38
+
32
39
  @dataclass
33
40
  class TaskSummary:
34
41
  """Lightweight task info from the list endpoint."""
@@ -66,6 +73,8 @@ class Task:
66
73
  accessibility_tree: dict | None = None
67
74
  grader: str = ""
68
75
  setup_actions: list = field(default_factory=list)
76
+ device_type: str = ""
77
+ runtime: str = ""
69
78
 
70
79
  @property
71
80
  def runnable(self) -> bool:
@@ -115,6 +124,8 @@ class TasksClient:
115
124
  accessibility_tree=d.get("accessibility_tree"),
116
125
  grader=d.get("grader", ""),
117
126
  setup_actions=d.get("setup_actions") or [],
127
+ device_type=d.get("device_type", ""),
128
+ runtime=d.get("runtime", ""),
118
129
  )
119
130
 
120
131
  def export_harbor(
@@ -227,7 +238,10 @@ def task_to_harbor(
227
238
  # instruction.md
228
239
  (task_dir / "instruction.md").write_text(task.instruction + "\n", encoding="utf-8")
229
240
 
230
- # task.toml
241
+ # task.toml — append the [ios] block when the task pins a device/runtime so
242
+ # the runner can spin up the matching simulator. Long
243
+ # com.apple.CoreSimulator.* identifiers are shortened to the readable form
244
+ # ("iPhone-17-Pro" / "iOS-26-4"); the runner reconstructs the prefix.
231
245
  tags = ["collected", "gui", task.platform]
232
246
  if category:
233
247
  tags.append(category)
@@ -237,6 +251,16 @@ def task_to_harbor(
237
251
  PLATFORM=task.platform,
238
252
  RUNNABLE="true" if task.runnable else "false",
239
253
  )
254
+ if task.platform == "ios":
255
+ device_type = _strip_ios_prefix(task.device_type, "SimDeviceType")
256
+ runtime = _strip_ios_prefix(task.runtime, "SimRuntime")
257
+ if device_type or runtime:
258
+ ios_block = ["\n[ios]\n"]
259
+ if device_type:
260
+ ios_block.append(f'device_type = "{device_type}"\n')
261
+ if runtime:
262
+ ios_block.append(f'runtime = "{runtime}"\n')
263
+ toml += "".join(ios_block)
240
264
  (task_dir / "task.toml").write_text(toml, encoding="utf-8")
241
265
 
242
266
  # actions.json — flat {steps: [{function, args}, ...]} for the debug agent's
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "use-computer"
7
- version = "0.0.6"
7
+ version = "0.0.7"
8
8
  description = "Python SDK for the use.computer macOS and iOS Computer Use API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes