boxd 0.3.2.dev1178__tar.gz → 0.3.2.dev1188__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.
- {boxd-0.3.2.dev1178/src/boxd.egg-info → boxd-0.3.2.dev1188}/PKG-INFO +47 -4
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/README.md +46 -3
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/pyproject.toml +1 -1
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/__init__.py +18 -0
- boxd-0.3.2.dev1188/src/boxd/_generated/api_pb2.py +834 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_generated/api_pb2_grpc.py +230 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_mappers.py +82 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_regions.py +4 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_requests.py +12 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/models.py +126 -0
- boxd-0.3.2.dev1188/src/boxd/resources/agents.py +1234 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188/src/boxd.egg-info}/PKG-INFO +47 -4
- boxd-0.3.2.dev1188/tests/test_agents.py +1617 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_regions.py +21 -0
- boxd-0.3.2.dev1178/src/boxd/_generated/api_pb2.py +0 -810
- boxd-0.3.2.dev1178/src/boxd/resources/agents.py +0 -416
- boxd-0.3.2.dev1178/tests/test_agents.py +0 -710
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/LICENSE +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/setup.cfg +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_client.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_credentials.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_generated/__init__.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_streaming.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_transport.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_urls.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/_version_check.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/computer_use.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/errors.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/py.typed +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/__init__.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/account.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/computer.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/credentials.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/disks.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/domains.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/fs.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/machines.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/orgs.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/regions.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/snapshots.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/teams.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/resources/vars.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd/spec.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd.egg-info/SOURCES.txt +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd.egg-info/dependency_links.txt +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd.egg-info/requires.txt +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/src/boxd.egg-info/top_level.txt +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_computer.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_computer_use.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_create_in_one_call.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_credentials.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_delete_self.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_fs.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_mappers.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_namespaces.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_python_versions.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_raw_key.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_requests.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_spec.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_streaming.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_transport.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_urls.py +0 -0
- {boxd-0.3.2.dev1178 → boxd-0.3.2.dev1188}/tests/test_version_check.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: boxd
|
|
3
|
-
Version: 0.3.2.
|
|
3
|
+
Version: 0.3.2.dev1188
|
|
4
4
|
Summary: Python SDK for the boxd cloud VM platform
|
|
5
5
|
Author: Azin
|
|
6
6
|
License-Expression: MIT
|
|
@@ -1073,6 +1073,12 @@ Claude Code, tool calls for Codex). `interrupt()` stops the running turn
|
|
|
1073
1073
|
session, and `list(machine, all=True)` also shows closed and failed sessions.
|
|
1074
1074
|
`harnesses()` lists the agents a machine can run.
|
|
1075
1075
|
|
|
1076
|
+
`start` and `send` are retried after a lost connection without running
|
|
1077
|
+
anything twice: each carries a `request_id`, and a repeat with the same one
|
|
1078
|
+
gets the first answer. The SDK makes up a new one for each call; pass
|
|
1079
|
+
`request_id=` yourself to retry from another process, such as an automation
|
|
1080
|
+
running a step again.
|
|
1081
|
+
|
|
1076
1082
|
The events are `AgentTurnStarted`, `AgentUserMessage`, `AgentMessageDelta`,
|
|
1077
1083
|
`AgentMessage`, `AgentThinkingDelta`, `AgentToolStarted`, `AgentToolOutput`,
|
|
1078
1084
|
`AgentToolFinished`, `AgentPlan`, `AgentUsage` and `AgentTurnFinished`, told
|
|
@@ -1082,14 +1088,51 @@ apart by `type`; every turn ends with `turn.finished` and its `reason`
|
|
|
1082
1088
|
Without `follow`, `events()` ends after the latest event; with it, it has no
|
|
1083
1089
|
deadline and stops when you stop iterating.
|
|
1084
1090
|
|
|
1091
|
+
`run()` does one task in one call: it starts a session, sends the task, waits
|
|
1092
|
+
for that turn to end and closes the session again:
|
|
1093
|
+
|
|
1094
|
+
```python
|
|
1095
|
+
result = agents.run("my-box", "claude-code", "Fix the failing test", cwd="/home/boxd/app")
|
|
1096
|
+
print(result.reply)
|
|
1097
|
+
if result.reason != "done":
|
|
1098
|
+
print(f"[{result.reason}] {result.error or ''}")
|
|
1099
|
+
```
|
|
1100
|
+
|
|
1101
|
+
`result.reply` is the agent's last reply in the turn, `result.reason` how the
|
|
1102
|
+
turn ended (a turn that doesn't end `"done"` is returned, not raised), and
|
|
1103
|
+
`result.usage` its tokens. `keep=True` leaves the session open, `session=` sends
|
|
1104
|
+
the task to an open session instead, `on_event=` sees each event as it happens,
|
|
1105
|
+
and Ctrl-C (or cancelling the task, with `AsyncBoxd`) interrupts the turn.
|
|
1106
|
+
|
|
1107
|
+
`runs()` reads how finished turns went from the platform's run history, newest
|
|
1108
|
+
first, across the machines you can see:
|
|
1109
|
+
|
|
1110
|
+
```python
|
|
1111
|
+
from datetime import datetime, timedelta, timezone
|
|
1112
|
+
|
|
1113
|
+
page = agents.runs(machine="my-box", since=datetime.now(timezone.utc) - timedelta(days=1))
|
|
1114
|
+
for run in page.runs:
|
|
1115
|
+
print(run.session_id, run.turn, run.reason, run.error or "")
|
|
1116
|
+
# page.next_page_token, passed as page_token=, reads the next, older page;
|
|
1117
|
+
# iter_runs() reads every page for you.
|
|
1118
|
+
```
|
|
1119
|
+
|
|
1120
|
+
Each `AgentRun` has the machine, the session, the turn, the agent and its
|
|
1121
|
+
version, how the turn started and ended (`reason`, `error`), when, its steps and
|
|
1122
|
+
its tokens, but no prompts or output. Filter by `machine`, `session` and
|
|
1123
|
+
`since`; `limit` is 50 by default, at most 500. Reading the history never wakes
|
|
1124
|
+
a machine, and it keeps 30 days of runs, also after a machine is deleted. A
|
|
1125
|
+
cluster that doesn't keep run history (some self-hosted ones) answers with a
|
|
1126
|
+
`ConflictError`.
|
|
1127
|
+
|
|
1085
1128
|
The agent runs as the machine's user without asking before it acts, with the
|
|
1086
1129
|
machine's env vars and secrets (`env=` adds more). Give it a key as a secret
|
|
1087
1130
|
(`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`, bound to its provider's host so the
|
|
1088
1131
|
machine only holds a placeholder), or sign Claude Code or Codex in once and
|
|
1089
1132
|
boxd serves the login to your private machines. The machine stays awake while
|
|
1090
|
-
a turn runs. `start
|
|
1091
|
-
|
|
1092
|
-
twice. `AsyncBoxd` has the same methods, awaited, and `events()` there is an
|
|
1133
|
+
a turn runs. `start` and `send` are sent again after a lost connection with
|
|
1134
|
+
the same request id, so a repeat never starts a second session or delivers a
|
|
1135
|
+
message twice; `interrupt` is sent once. `AsyncBoxd` has the same methods, awaited, and `events()` there is an
|
|
1093
1136
|
async iterator. More: [Coding agent sessions](https://docs.boxd.sh/guides/coding-agents).
|
|
1094
1137
|
|
|
1095
1138
|
### Ports and proxies
|
|
@@ -1038,6 +1038,12 @@ Claude Code, tool calls for Codex). `interrupt()` stops the running turn
|
|
|
1038
1038
|
session, and `list(machine, all=True)` also shows closed and failed sessions.
|
|
1039
1039
|
`harnesses()` lists the agents a machine can run.
|
|
1040
1040
|
|
|
1041
|
+
`start` and `send` are retried after a lost connection without running
|
|
1042
|
+
anything twice: each carries a `request_id`, and a repeat with the same one
|
|
1043
|
+
gets the first answer. The SDK makes up a new one for each call; pass
|
|
1044
|
+
`request_id=` yourself to retry from another process, such as an automation
|
|
1045
|
+
running a step again.
|
|
1046
|
+
|
|
1041
1047
|
The events are `AgentTurnStarted`, `AgentUserMessage`, `AgentMessageDelta`,
|
|
1042
1048
|
`AgentMessage`, `AgentThinkingDelta`, `AgentToolStarted`, `AgentToolOutput`,
|
|
1043
1049
|
`AgentToolFinished`, `AgentPlan`, `AgentUsage` and `AgentTurnFinished`, told
|
|
@@ -1047,14 +1053,51 @@ apart by `type`; every turn ends with `turn.finished` and its `reason`
|
|
|
1047
1053
|
Without `follow`, `events()` ends after the latest event; with it, it has no
|
|
1048
1054
|
deadline and stops when you stop iterating.
|
|
1049
1055
|
|
|
1056
|
+
`run()` does one task in one call: it starts a session, sends the task, waits
|
|
1057
|
+
for that turn to end and closes the session again:
|
|
1058
|
+
|
|
1059
|
+
```python
|
|
1060
|
+
result = agents.run("my-box", "claude-code", "Fix the failing test", cwd="/home/boxd/app")
|
|
1061
|
+
print(result.reply)
|
|
1062
|
+
if result.reason != "done":
|
|
1063
|
+
print(f"[{result.reason}] {result.error or ''}")
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
`result.reply` is the agent's last reply in the turn, `result.reason` how the
|
|
1067
|
+
turn ended (a turn that doesn't end `"done"` is returned, not raised), and
|
|
1068
|
+
`result.usage` its tokens. `keep=True` leaves the session open, `session=` sends
|
|
1069
|
+
the task to an open session instead, `on_event=` sees each event as it happens,
|
|
1070
|
+
and Ctrl-C (or cancelling the task, with `AsyncBoxd`) interrupts the turn.
|
|
1071
|
+
|
|
1072
|
+
`runs()` reads how finished turns went from the platform's run history, newest
|
|
1073
|
+
first, across the machines you can see:
|
|
1074
|
+
|
|
1075
|
+
```python
|
|
1076
|
+
from datetime import datetime, timedelta, timezone
|
|
1077
|
+
|
|
1078
|
+
page = agents.runs(machine="my-box", since=datetime.now(timezone.utc) - timedelta(days=1))
|
|
1079
|
+
for run in page.runs:
|
|
1080
|
+
print(run.session_id, run.turn, run.reason, run.error or "")
|
|
1081
|
+
# page.next_page_token, passed as page_token=, reads the next, older page;
|
|
1082
|
+
# iter_runs() reads every page for you.
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
Each `AgentRun` has the machine, the session, the turn, the agent and its
|
|
1086
|
+
version, how the turn started and ended (`reason`, `error`), when, its steps and
|
|
1087
|
+
its tokens, but no prompts or output. Filter by `machine`, `session` and
|
|
1088
|
+
`since`; `limit` is 50 by default, at most 500. Reading the history never wakes
|
|
1089
|
+
a machine, and it keeps 30 days of runs, also after a machine is deleted. A
|
|
1090
|
+
cluster that doesn't keep run history (some self-hosted ones) answers with a
|
|
1091
|
+
`ConflictError`.
|
|
1092
|
+
|
|
1050
1093
|
The agent runs as the machine's user without asking before it acts, with the
|
|
1051
1094
|
machine's env vars and secrets (`env=` adds more). Give it a key as a secret
|
|
1052
1095
|
(`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`, bound to its provider's host so the
|
|
1053
1096
|
machine only holds a placeholder), or sign Claude Code or Codex in once and
|
|
1054
1097
|
boxd serves the login to your private machines. The machine stays awake while
|
|
1055
|
-
a turn runs. `start
|
|
1056
|
-
|
|
1057
|
-
twice. `AsyncBoxd` has the same methods, awaited, and `events()` there is an
|
|
1098
|
+
a turn runs. `start` and `send` are sent again after a lost connection with
|
|
1099
|
+
the same request id, so a repeat never starts a second session or delivers a
|
|
1100
|
+
message twice; `interrupt` is sent once. `AsyncBoxd` has the same methods, awaited, and `events()` there is an
|
|
1058
1101
|
async iterator. More: [Coding agent sessions](https://docs.boxd.sh/guides/coding-agents).
|
|
1059
1102
|
|
|
1060
1103
|
### Ports and proxies
|
|
@@ -45,10 +45,19 @@ from .models import (
|
|
|
45
45
|
AgentEventBase,
|
|
46
46
|
AgentFinishReason,
|
|
47
47
|
AgentInterruptResult,
|
|
48
|
+
AgentLogin,
|
|
49
|
+
AgentLoginMethod,
|
|
50
|
+
AgentLoginResult,
|
|
51
|
+
AgentLoginStart,
|
|
48
52
|
AgentMessage,
|
|
49
53
|
AgentMessageDelta,
|
|
50
54
|
AgentPlan,
|
|
51
55
|
AgentPlanItem,
|
|
56
|
+
AgentRun,
|
|
57
|
+
AgentRunResult,
|
|
58
|
+
AgentRunStartedBy,
|
|
59
|
+
AgentRunUsage,
|
|
60
|
+
AgentRunsPage,
|
|
52
61
|
AgentSendResult,
|
|
53
62
|
AgentSendWhen,
|
|
54
63
|
AgentSession,
|
|
@@ -196,10 +205,19 @@ __all__ = [
|
|
|
196
205
|
"AgentEventBase",
|
|
197
206
|
"AgentFinishReason",
|
|
198
207
|
"AgentInterruptResult",
|
|
208
|
+
"AgentLogin",
|
|
209
|
+
"AgentLoginMethod",
|
|
210
|
+
"AgentLoginResult",
|
|
211
|
+
"AgentLoginStart",
|
|
199
212
|
"AgentMessage",
|
|
200
213
|
"AgentMessageDelta",
|
|
201
214
|
"AgentPlan",
|
|
202
215
|
"AgentPlanItem",
|
|
216
|
+
"AgentRun",
|
|
217
|
+
"AgentRunResult",
|
|
218
|
+
"AgentRunStartedBy",
|
|
219
|
+
"AgentRunUsage",
|
|
220
|
+
"AgentRunsPage",
|
|
203
221
|
"AgentSendResult",
|
|
204
222
|
"AgentSendWhen",
|
|
205
223
|
"AgentSession",
|