boxd 0.3.2__tar.gz → 0.3.2.dev1178__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/src/boxd.egg-info → boxd-0.3.2.dev1178}/PKG-INFO +55 -1
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/README.md +54 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/pyproject.toml +1 -1
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/__init__.py +46 -0
- boxd-0.3.2.dev1178/src/boxd/_generated/api_pb2.py +810 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_generated/api_pb2_grpc.py +360 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_mappers.py +177 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_regions.py +5 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/models.py +266 -1
- boxd-0.3.2.dev1178/src/boxd/resources/agents.py +416 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/machines.py +3 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178/src/boxd.egg-info}/PKG-INFO +55 -1
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd.egg-info/SOURCES.txt +2 -0
- boxd-0.3.2.dev1178/tests/test_agents.py +710 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_regions.py +38 -0
- boxd-0.3.2/src/boxd/_generated/api_pb2.py +0 -740
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/LICENSE +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/setup.cfg +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_client.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_credentials.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_generated/__init__.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_requests.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_streaming.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_transport.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_urls.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/_version_check.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/computer_use.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/errors.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/py.typed +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/__init__.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/account.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/computer.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/credentials.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/disks.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/domains.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/fs.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/orgs.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/regions.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/snapshots.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/teams.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/resources/vars.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd/spec.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd.egg-info/dependency_links.txt +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd.egg-info/requires.txt +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/src/boxd.egg-info/top_level.txt +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_computer.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_computer_use.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_create_in_one_call.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_credentials.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_delete_self.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_fs.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_mappers.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_namespaces.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_python_versions.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_raw_key.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_requests.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_spec.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_streaming.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_transport.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/tests/test_urls.py +0 -0
- {boxd-0.3.2 → boxd-0.3.2.dev1178}/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.dev1178
|
|
4
4
|
Summary: Python SDK for the boxd cloud VM platform
|
|
5
5
|
Author: Azin
|
|
6
6
|
License-Expression: MIT
|
|
@@ -1038,6 +1038,60 @@ The model does whatever it decides to on the machine, as the machine's user:
|
|
|
1038
1038
|
give it a machine of its own. A complete Claude agent:
|
|
1039
1039
|
[`examples/claude_computer_use.py`](https://github.com/boxd-sh/sdk/blob/main/python/examples/claude_computer_use.py).
|
|
1040
1040
|
|
|
1041
|
+
### Coding agents
|
|
1042
|
+
|
|
1043
|
+
`machines.agents` runs Claude Code or Codex inside a machine through one API.
|
|
1044
|
+
A session is one conversation with one agent; each message you send runs as a
|
|
1045
|
+
turn, one at a time, and everything the turn does comes back as typed events,
|
|
1046
|
+
numbered by `seq`. The agent keeps working if you disconnect: pass the last
|
|
1047
|
+
`seq` you saw as `after_seq` to pick up where you left off.
|
|
1048
|
+
|
|
1049
|
+
```python
|
|
1050
|
+
agents = boxd.machines.agents
|
|
1051
|
+
|
|
1052
|
+
session = agents.start("my-box", "claude-code", cwd="/home/boxd/app")
|
|
1053
|
+
sent = agents.send("my-box", session.id, "Add a /health endpoint and a test for it")
|
|
1054
|
+
for event in agents.events("my-box", session.id, follow=True):
|
|
1055
|
+
if event.type == "message.delta":
|
|
1056
|
+
print(event.text, end="", flush=True)
|
|
1057
|
+
elif event.type == "tool.started":
|
|
1058
|
+
print(f"\n▸ {event.name} {event.input}")
|
|
1059
|
+
elif event.type == "turn.finished" and event.turn == sent.turn:
|
|
1060
|
+
print(f"\n[{event.reason}]")
|
|
1061
|
+
break
|
|
1062
|
+
agents.close("my-box", session.id)
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
`send` returns once the message is delivered, not when the turn ends:
|
|
1066
|
+
`sent.turn` is the turn it started, joined or will start, and `sent.delivery`
|
|
1067
|
+
says how (`"started"`, `"queued"`, `"joined"`, `"queued_fallback"`). A message
|
|
1068
|
+
sent while a turn runs waits as a turn of its own; `send(..., when="now")` adds
|
|
1069
|
+
it to the running turn instead. `timeout_secs=` and `max_steps=` interrupt a
|
|
1070
|
+
turn the message starts after that many seconds or steps (model calls for
|
|
1071
|
+
Claude Code, tool calls for Codex). `interrupt()` stops the running turn
|
|
1072
|
+
(`clear_queue=True` also drops the waiting messages), `close()` ends the
|
|
1073
|
+
session, and `list(machine, all=True)` also shows closed and failed sessions.
|
|
1074
|
+
`harnesses()` lists the agents a machine can run.
|
|
1075
|
+
|
|
1076
|
+
The events are `AgentTurnStarted`, `AgentUserMessage`, `AgentMessageDelta`,
|
|
1077
|
+
`AgentMessage`, `AgentThinkingDelta`, `AgentToolStarted`, `AgentToolOutput`,
|
|
1078
|
+
`AgentToolFinished`, `AgentPlan`, `AgentUsage` and `AgentTurnFinished`, told
|
|
1079
|
+
apart by `type`; every turn ends with `turn.finished` and its `reason`
|
|
1080
|
+
(`"done"`, `"interrupted"`, `"timeout"`, `"max_steps"`, `"max_tokens"`,
|
|
1081
|
+
`"refused"`, `"failed"`). An event of a type this SDK doesn't know is skipped.
|
|
1082
|
+
Without `follow`, `events()` ends after the latest event; with it, it has no
|
|
1083
|
+
deadline and stops when you stop iterating.
|
|
1084
|
+
|
|
1085
|
+
The agent runs as the machine's user without asking before it acts, with the
|
|
1086
|
+
machine's env vars and secrets (`env=` adds more). Give it a key as a secret
|
|
1087
|
+
(`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`, bound to its provider's host so the
|
|
1088
|
+
machine only holds a placeholder), or sign Claude Code or Codex in once and
|
|
1089
|
+
boxd serves the login to your private machines. The machine stays awake while
|
|
1090
|
+
a turn runs. `start`, `send` and `interrupt` are sent once: a lost answer is
|
|
1091
|
+
not retried, since that could start a second session or deliver a message
|
|
1092
|
+
twice. `AsyncBoxd` has the same methods, awaited, and `events()` there is an
|
|
1093
|
+
async iterator. More: [Coding agent sessions](https://docs.boxd.sh/guides/coding-agents).
|
|
1094
|
+
|
|
1041
1095
|
### Ports and proxies
|
|
1042
1096
|
|
|
1043
1097
|
```python
|
|
@@ -1003,6 +1003,60 @@ The model does whatever it decides to on the machine, as the machine's user:
|
|
|
1003
1003
|
give it a machine of its own. A complete Claude agent:
|
|
1004
1004
|
[`examples/claude_computer_use.py`](https://github.com/boxd-sh/sdk/blob/main/python/examples/claude_computer_use.py).
|
|
1005
1005
|
|
|
1006
|
+
### Coding agents
|
|
1007
|
+
|
|
1008
|
+
`machines.agents` runs Claude Code or Codex inside a machine through one API.
|
|
1009
|
+
A session is one conversation with one agent; each message you send runs as a
|
|
1010
|
+
turn, one at a time, and everything the turn does comes back as typed events,
|
|
1011
|
+
numbered by `seq`. The agent keeps working if you disconnect: pass the last
|
|
1012
|
+
`seq` you saw as `after_seq` to pick up where you left off.
|
|
1013
|
+
|
|
1014
|
+
```python
|
|
1015
|
+
agents = boxd.machines.agents
|
|
1016
|
+
|
|
1017
|
+
session = agents.start("my-box", "claude-code", cwd="/home/boxd/app")
|
|
1018
|
+
sent = agents.send("my-box", session.id, "Add a /health endpoint and a test for it")
|
|
1019
|
+
for event in agents.events("my-box", session.id, follow=True):
|
|
1020
|
+
if event.type == "message.delta":
|
|
1021
|
+
print(event.text, end="", flush=True)
|
|
1022
|
+
elif event.type == "tool.started":
|
|
1023
|
+
print(f"\n▸ {event.name} {event.input}")
|
|
1024
|
+
elif event.type == "turn.finished" and event.turn == sent.turn:
|
|
1025
|
+
print(f"\n[{event.reason}]")
|
|
1026
|
+
break
|
|
1027
|
+
agents.close("my-box", session.id)
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
`send` returns once the message is delivered, not when the turn ends:
|
|
1031
|
+
`sent.turn` is the turn it started, joined or will start, and `sent.delivery`
|
|
1032
|
+
says how (`"started"`, `"queued"`, `"joined"`, `"queued_fallback"`). A message
|
|
1033
|
+
sent while a turn runs waits as a turn of its own; `send(..., when="now")` adds
|
|
1034
|
+
it to the running turn instead. `timeout_secs=` and `max_steps=` interrupt a
|
|
1035
|
+
turn the message starts after that many seconds or steps (model calls for
|
|
1036
|
+
Claude Code, tool calls for Codex). `interrupt()` stops the running turn
|
|
1037
|
+
(`clear_queue=True` also drops the waiting messages), `close()` ends the
|
|
1038
|
+
session, and `list(machine, all=True)` also shows closed and failed sessions.
|
|
1039
|
+
`harnesses()` lists the agents a machine can run.
|
|
1040
|
+
|
|
1041
|
+
The events are `AgentTurnStarted`, `AgentUserMessage`, `AgentMessageDelta`,
|
|
1042
|
+
`AgentMessage`, `AgentThinkingDelta`, `AgentToolStarted`, `AgentToolOutput`,
|
|
1043
|
+
`AgentToolFinished`, `AgentPlan`, `AgentUsage` and `AgentTurnFinished`, told
|
|
1044
|
+
apart by `type`; every turn ends with `turn.finished` and its `reason`
|
|
1045
|
+
(`"done"`, `"interrupted"`, `"timeout"`, `"max_steps"`, `"max_tokens"`,
|
|
1046
|
+
`"refused"`, `"failed"`). An event of a type this SDK doesn't know is skipped.
|
|
1047
|
+
Without `follow`, `events()` ends after the latest event; with it, it has no
|
|
1048
|
+
deadline and stops when you stop iterating.
|
|
1049
|
+
|
|
1050
|
+
The agent runs as the machine's user without asking before it acts, with the
|
|
1051
|
+
machine's env vars and secrets (`env=` adds more). Give it a key as a secret
|
|
1052
|
+
(`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`, bound to its provider's host so the
|
|
1053
|
+
machine only holds a placeholder), or sign Claude Code or Codex in once and
|
|
1054
|
+
boxd serves the login to your private machines. The machine stays awake while
|
|
1055
|
+
a turn runs. `start`, `send` and `interrupt` are sent once: a lost answer is
|
|
1056
|
+
not retried, since that could start a second session or deliver a message
|
|
1057
|
+
twice. `AsyncBoxd` has the same methods, awaited, and `events()` there is an
|
|
1058
|
+
async iterator. More: [Coding agent sessions](https://docs.boxd.sh/guides/coding-agents).
|
|
1059
|
+
|
|
1006
1060
|
### Ports and proxies
|
|
1007
1061
|
|
|
1008
1062
|
```python
|
|
@@ -40,6 +40,28 @@ from .errors import (
|
|
|
40
40
|
)
|
|
41
41
|
from .models import (
|
|
42
42
|
Account,
|
|
43
|
+
AgentDelivery,
|
|
44
|
+
AgentEvent,
|
|
45
|
+
AgentEventBase,
|
|
46
|
+
AgentFinishReason,
|
|
47
|
+
AgentInterruptResult,
|
|
48
|
+
AgentMessage,
|
|
49
|
+
AgentMessageDelta,
|
|
50
|
+
AgentPlan,
|
|
51
|
+
AgentPlanItem,
|
|
52
|
+
AgentSendResult,
|
|
53
|
+
AgentSendWhen,
|
|
54
|
+
AgentSession,
|
|
55
|
+
AgentSessionState,
|
|
56
|
+
AgentThinkingDelta,
|
|
57
|
+
AgentToolFinished,
|
|
58
|
+
AgentToolKind,
|
|
59
|
+
AgentToolOutput,
|
|
60
|
+
AgentToolStarted,
|
|
61
|
+
AgentTurnFinished,
|
|
62
|
+
AgentTurnStarted,
|
|
63
|
+
AgentUsage,
|
|
64
|
+
AgentUserMessage,
|
|
43
65
|
ApiKey,
|
|
44
66
|
Backup,
|
|
45
67
|
BackupSchedule,
|
|
@@ -67,6 +89,7 @@ from .models import (
|
|
|
67
89
|
ExecResult,
|
|
68
90
|
SelfDeleteResult,
|
|
69
91
|
ExposedPort,
|
|
92
|
+
Harness,
|
|
70
93
|
BillingActivityEntry,
|
|
71
94
|
BillingActivityPage,
|
|
72
95
|
Machine,
|
|
@@ -168,6 +191,28 @@ __all__ = [
|
|
|
168
191
|
"OutputChunk",
|
|
169
192
|
# Models
|
|
170
193
|
"Account",
|
|
194
|
+
"AgentDelivery",
|
|
195
|
+
"AgentEvent",
|
|
196
|
+
"AgentEventBase",
|
|
197
|
+
"AgentFinishReason",
|
|
198
|
+
"AgentInterruptResult",
|
|
199
|
+
"AgentMessage",
|
|
200
|
+
"AgentMessageDelta",
|
|
201
|
+
"AgentPlan",
|
|
202
|
+
"AgentPlanItem",
|
|
203
|
+
"AgentSendResult",
|
|
204
|
+
"AgentSendWhen",
|
|
205
|
+
"AgentSession",
|
|
206
|
+
"AgentSessionState",
|
|
207
|
+
"AgentThinkingDelta",
|
|
208
|
+
"AgentToolFinished",
|
|
209
|
+
"AgentToolKind",
|
|
210
|
+
"AgentToolOutput",
|
|
211
|
+
"AgentToolStarted",
|
|
212
|
+
"AgentTurnFinished",
|
|
213
|
+
"AgentTurnStarted",
|
|
214
|
+
"AgentUsage",
|
|
215
|
+
"AgentUserMessage",
|
|
171
216
|
"ApiKey",
|
|
172
217
|
"Backup",
|
|
173
218
|
"BackupSchedule",
|
|
@@ -195,6 +240,7 @@ __all__ = [
|
|
|
195
240
|
"FsEntryType",
|
|
196
241
|
"SelfDeleteResult",
|
|
197
242
|
"ExposedPort",
|
|
243
|
+
"Harness",
|
|
198
244
|
"BillingActivityEntry",
|
|
199
245
|
"BillingActivityPage",
|
|
200
246
|
"Machine",
|