taskmaster-api 0.1.0__py3-none-any.whl → 0.2.0__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.
taskmaster_api/client.py CHANGED
@@ -12,7 +12,7 @@ import urllib.request
12
12
  from typing import Any, Mapping, Optional
13
13
 
14
14
  DEFAULT_BASE_URL = "http://127.0.0.1:8737"
15
- VERSION = "0.1.0"
15
+ VERSION = "0.2.0"
16
16
 
17
17
 
18
18
  class TaskmasterError(Exception):
@@ -65,6 +65,84 @@ class Taskmaster:
65
65
  raise TaskmasterError(0, "pair response had no token")
66
66
  return token
67
67
 
68
+ def computer_status(self) -> dict[str, Any]:
69
+ """``GET /api/computer/status``."""
70
+ return self._object(self.call("GET", "/api/computer/status"))
71
+
72
+ def computer_enable(self, enabled: bool) -> dict[str, Any]:
73
+ """``POST /api/computer/toggle``. Turns Local computer use on or off."""
74
+ return self._object(self.call("POST", "/api/computer/toggle", {"enabled": enabled}))
75
+
76
+ def computer_mode(self, mode: str) -> dict[str, Any]:
77
+ """``POST /api/computer/mode``. ``mode`` is ``host`` or ``virtual``."""
78
+ return self._object(self.call("POST", "/api/computer/mode", {"mode": mode}))
79
+
80
+ def computer_sessions(self) -> list[Any]:
81
+ """``GET /api/computer/sessions``."""
82
+ listed = self._object(self.call("GET", "/api/computer/sessions"))
83
+ sessions = listed.get("sessions")
84
+ if not isinstance(sessions, list):
85
+ raise TaskmasterError(0, "sessions response had no list")
86
+ return sessions
87
+
88
+ def computer_start(
89
+ self,
90
+ task: str,
91
+ *,
92
+ bot_id: Optional[str] = None,
93
+ harness: Optional[str] = None,
94
+ model: Optional[str] = None,
95
+ parent_session_id: Optional[str] = None,
96
+ attachments: Optional[list[str]] = None,
97
+ ) -> dict[str, Any]:
98
+ """``POST /api/computer/sessions``. Starts the Computer agent on ``task``."""
99
+ body: dict[str, Any] = {"task": task}
100
+ if bot_id is not None:
101
+ body["bot_id"] = bot_id
102
+ if harness is not None:
103
+ body["harness"] = harness
104
+ if model is not None:
105
+ body["model"] = model
106
+ if parent_session_id is not None:
107
+ body["parent_session_id"] = parent_session_id
108
+ if attachments:
109
+ body["attachments"] = attachments
110
+ return self._object(self.call("POST", "/api/computer/sessions", body))
111
+
112
+ def computer_session(self, session_id: str) -> dict[str, Any]:
113
+ """``GET /api/computer/sessions/{id}``."""
114
+ return self._object(self.call("GET", f"/api/computer/sessions/{_segment(session_id)}"))
115
+
116
+ def computer_resume(self, session_id: str, note: Optional[str] = None) -> dict[str, Any]:
117
+ """``POST /api/computer/sessions/{id}/resume``. ``note`` is the next instruction."""
118
+ body: dict[str, Any] = {"note": note} if note else {}
119
+ return self._object(self.call("POST", f"/api/computer/sessions/{_segment(session_id)}/resume", body))
120
+
121
+ def computer_cancel(self, session_id: str) -> Any:
122
+ """``POST /api/computer/sessions/{id}/cancel``. Stops the agent."""
123
+ return self.call("POST", f"/api/computer/sessions/{_segment(session_id)}/cancel", {})
124
+
125
+ def computer_screen(self) -> dict[str, Any]:
126
+ """``POST /api/computer/screen``. ``data`` is base64 PNG bytes."""
127
+ return self._object(self.call("POST", "/api/computer/screen", {}))
128
+
129
+ def computer_act(self, action: str, **args: Any) -> dict[str, Any]:
130
+ """``POST /api/computer/act``.
131
+
132
+ ``action`` is ``click``, ``click_text``, ``type``, ``press``, ``open_url``,
133
+ ``open_app``, and the other names the daemon accepts. Coordinates are a
134
+ 0–1000 grid.
135
+ """
136
+ return self._object(self.call("POST", "/api/computer/act", {"action": action, **args}))
137
+
138
+ def computer_routines(self) -> Any:
139
+ """``GET /api/computer/routines``."""
140
+ return self.call("GET", "/api/computer/routines")
141
+
142
+ def computer_run_routine(self, routine_id: str) -> Any:
143
+ """``POST /api/computer/routines/{id}/run``."""
144
+ return self.call("POST", f"/api/computer/routines/{_segment(routine_id)}/run", {})
145
+
68
146
  def runs(self) -> dict[str, Any]:
69
147
  """``GET /api/runs``. The body is ``{"runs": [...], "seq": n}``."""
70
148
  return self._object(self.call("GET", "/api/runs"))
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: taskmaster-api
3
+ Version: 0.2.0
4
+ Summary: Client for the Taskmaster Computer agent
5
+ Author: Naren Sengodan
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/narensen/taskmaster-api
8
+ Project-URL: Repository, https://github.com/narensen/taskmaster-api
9
+ Keywords: taskmaster,api,client,daemon
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Dynamic: license-file
17
+
18
+ # taskmaster-api
19
+
20
+ Client for the [Taskmaster](https://github.com/narensen/Taskmaster) Computer agent running on your machine.
21
+
22
+ `tm serve .` listens on `http://127.0.0.1:8737`. Pair first. Computer stays off until `computer_enable(True)`.
23
+
24
+ ```python
25
+ from taskmaster_api import Taskmaster
26
+
27
+ tm = Taskmaster()
28
+ tm.set_token(tm.pair("ABCD", label="laptop", kind="agent"))
29
+ tm.computer_enable(True)
30
+
31
+ session = tm.computer_start("Open Chrome and search for the weather")
32
+ tm.computer_resume(session["id"], "Read the first forecast")
33
+ tm.computer_cancel(session["id"])
34
+ ```
35
+
36
+ `computer_act` sends one action on the 0–1000 screen grid. `computer_mode("virtual")` aims the agent at the isolated desktop.
37
+
38
+ ```python
39
+ acted = tm.computer_act("open_url", url="https://example.com", capture_after=True)
40
+ print(acted["result"])
41
+ ```
42
+
43
+ The standard library is the only dependency. Coding-run methods (`start`, `approve`, `events`) remain. `call(method, path, body)` sends any other route.
44
+
45
+ The same client is published for Rust (`cargo add taskmaster-api`) and JavaScript (`npm install taskmaster-api`).
46
+
47
+ MIT © 2026 Naren Sengodan
@@ -0,0 +1,8 @@
1
+ taskmaster_api/__init__.py,sha256=hBTAlTQhG9qByXoDJILAlfmJeNdMoWrwG2fsXuvEM1M,236
2
+ taskmaster_api/client.py,sha256=-N64YwiEpuJj2cMCzW9ChbEcKk2nUXLprJoXYuQWjkE,12368
3
+ taskmaster_api/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
+ taskmaster_api-0.2.0.dist-info/licenses/LICENSE,sha256=dMTuPSKtnP69xjRoU09WxOfzuCXMfZ_e8GPCjZEY830,1071
5
+ taskmaster_api-0.2.0.dist-info/METADATA,sha256=XXOVDvhK_72UhOHezpw2BP1FlHVjIywSSmXjx2VLGWQ,1667
6
+ taskmaster_api-0.2.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
7
+ taskmaster_api-0.2.0.dist-info/top_level.txt,sha256=bN4d_q-hbPNkU7dCogKdyXzJg8JZyhtdlAnmcsH_RE4,15
8
+ taskmaster_api-0.2.0.dist-info/RECORD,,
@@ -1,44 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: taskmaster-api
3
- Version: 0.1.0
4
- Summary: Client for the Taskmaster local daemon HTTP API
5
- Author: Naren Sengodan
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/narensen/taskmaster-api
8
- Project-URL: Repository, https://github.com/narensen/taskmaster-api
9
- Keywords: taskmaster,api,client,daemon
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Typing :: Typed
13
- Requires-Python: >=3.9
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
- Dynamic: license-file
17
-
18
- # taskmaster-api
19
-
20
- Client for a [Taskmaster](https://github.com/narensen/Taskmaster) daemon running on your machine.
21
-
22
- `tm serve .` listens on `http://127.0.0.1:8737`. `GET /api/health` and `POST /api/pair` need no token. Every other `/api` route needs `Authorization: Bearer <token>`.
23
-
24
- ```python
25
- from taskmaster_api import Taskmaster
26
-
27
- tm = Taskmaster()
28
- tm.set_token(tm.pair("ABCD", label="laptop", kind="agent"))
29
-
30
- accepted = tm.start("Add a command palette", yes=True)
31
- page = tm.events(accepted["id"])
32
- print(page["next"])
33
- ```
34
-
35
- `0.1.0` covers health, pairing, projects, providers, doctor, and the run lifecycle: list, get, start, approve, reject, resume, cancel, undo, and events. `call(method, path, body)` sends any other route and returns the JSON value.
36
-
37
- ```python
38
- doctor = tm.doctor()
39
- dictionary = tm.call("GET", "/api/dictionary?q=button")
40
- ```
41
-
42
- The standard library is the only dependency. The same client is published for Rust (`cargo add taskmaster-api`) and JavaScript (`npm install taskmaster-api`).
43
-
44
- MIT © 2026 Naren Sengodan
@@ -1,8 +0,0 @@
1
- taskmaster_api/__init__.py,sha256=hBTAlTQhG9qByXoDJILAlfmJeNdMoWrwG2fsXuvEM1M,236
2
- taskmaster_api/client.py,sha256=42WuW9Izgl1RJXTp2-l6KmFPJP_rSt0rnpmhNmrpyqo,8745
3
- taskmaster_api/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
- taskmaster_api-0.1.0.dist-info/licenses/LICENSE,sha256=dMTuPSKtnP69xjRoU09WxOfzuCXMfZ_e8GPCjZEY830,1071
5
- taskmaster_api-0.1.0.dist-info/METADATA,sha256=l2Aq4XN3opc8uCjCJNZVZsXH_JL77Tf4Ia_x7aasJxA,1602
6
- taskmaster_api-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
7
- taskmaster_api-0.1.0.dist-info/top_level.txt,sha256=bN4d_q-hbPNkU7dCogKdyXzJg8JZyhtdlAnmcsH_RE4,15
8
- taskmaster_api-0.1.0.dist-info/RECORD,,