acontext 0.1.3__py3-none-any.whl → 0.1.4__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.
- acontext/__init__.py +0 -8
- acontext/agent/__init__.py +2 -0
- acontext/agent/base.py +2 -1
- acontext/agent/disk.py +25 -18
- acontext/agent/prompts.py +96 -0
- acontext/agent/sandbox.py +532 -0
- acontext/agent/skill.py +35 -44
- acontext/agent/text_editor.py +436 -0
- acontext/async_client.py +4 -5
- acontext/client.py +4 -5
- acontext/client_types.py +2 -0
- acontext/resources/__init__.py +0 -8
- acontext/resources/async_sandboxes.py +27 -0
- acontext/resources/async_sessions.py +0 -41
- acontext/resources/async_skills.py +40 -0
- acontext/resources/async_users.py +2 -2
- acontext/resources/sandboxes.py +27 -0
- acontext/resources/sessions.py +0 -41
- acontext/resources/skills.py +40 -0
- acontext/resources/users.py +2 -2
- acontext/types/__init__.py +8 -22
- acontext/types/sandbox.py +27 -0
- acontext/types/session.py +0 -16
- acontext/types/skill.py +11 -0
- acontext/types/tool.py +0 -6
- acontext/types/user.py +0 -1
- {acontext-0.1.3.dist-info → acontext-0.1.4.dist-info}/METADATA +1 -1
- acontext-0.1.4.dist-info/RECORD +41 -0
- acontext/resources/async_blocks.py +0 -164
- acontext/resources/async_spaces.py +0 -200
- acontext/resources/blocks.py +0 -163
- acontext/resources/spaces.py +0 -198
- acontext/types/block.py +0 -26
- acontext/types/space.py +0 -70
- acontext-0.1.3.dist-info/RECORD +0 -44
- {acontext-0.1.3.dist-info → acontext-0.1.4.dist-info}/WHEEL +0 -0
|
@@ -12,7 +12,6 @@ from ..types.session import (
|
|
|
12
12
|
EditStrategy,
|
|
13
13
|
GetMessagesOutput,
|
|
14
14
|
GetTasksOutput,
|
|
15
|
-
LearningStatus,
|
|
16
15
|
ListSessionsOutput,
|
|
17
16
|
Message,
|
|
18
17
|
MessageObservingStatus,
|
|
@@ -38,8 +37,6 @@ class AsyncSessionsAPI:
|
|
|
38
37
|
self,
|
|
39
38
|
*,
|
|
40
39
|
user: str | None = None,
|
|
41
|
-
space_id: str | None = None,
|
|
42
|
-
not_connected: bool | None = None,
|
|
43
40
|
limit: int | None = None,
|
|
44
41
|
cursor: str | None = None,
|
|
45
42
|
time_desc: bool | None = None,
|
|
@@ -48,8 +45,6 @@ class AsyncSessionsAPI:
|
|
|
48
45
|
|
|
49
46
|
Args:
|
|
50
47
|
user: Filter by user identifier. Defaults to None.
|
|
51
|
-
space_id: Filter sessions by space ID. Defaults to None.
|
|
52
|
-
not_connected: Filter sessions that are not connected to a space. Defaults to None.
|
|
53
48
|
limit: Maximum number of sessions to return. Defaults to None.
|
|
54
49
|
cursor: Cursor for pagination. Defaults to None.
|
|
55
50
|
time_desc: Order by created_at descending if True, ascending if False. Defaults to None.
|
|
@@ -60,11 +55,8 @@ class AsyncSessionsAPI:
|
|
|
60
55
|
params: dict[str, Any] = {}
|
|
61
56
|
if user:
|
|
62
57
|
params["user"] = user
|
|
63
|
-
if space_id:
|
|
64
|
-
params["space_id"] = space_id
|
|
65
58
|
params.update(
|
|
66
59
|
build_params(
|
|
67
|
-
not_connected=not_connected,
|
|
68
60
|
limit=limit,
|
|
69
61
|
cursor=cursor,
|
|
70
62
|
time_desc=time_desc,
|
|
@@ -77,7 +69,6 @@ class AsyncSessionsAPI:
|
|
|
77
69
|
self,
|
|
78
70
|
*,
|
|
79
71
|
user: str | None = None,
|
|
80
|
-
space_id: str | None = None,
|
|
81
72
|
disable_task_tracking: bool | None = None,
|
|
82
73
|
configs: Mapping[str, Any] | None = None,
|
|
83
74
|
) -> Session:
|
|
@@ -85,7 +76,6 @@ class AsyncSessionsAPI:
|
|
|
85
76
|
|
|
86
77
|
Args:
|
|
87
78
|
user: Optional user identifier string. Defaults to None.
|
|
88
|
-
space_id: Optional space ID to associate with the session. Defaults to None.
|
|
89
79
|
disable_task_tracking: Whether to disable task tracking for this session. Defaults to None (server default: False).
|
|
90
80
|
configs: Optional session configuration dictionary. Defaults to None.
|
|
91
81
|
|
|
@@ -95,8 +85,6 @@ class AsyncSessionsAPI:
|
|
|
95
85
|
payload: dict[str, Any] = {}
|
|
96
86
|
if user:
|
|
97
87
|
payload["user"] = user
|
|
98
|
-
if space_id:
|
|
99
|
-
payload["space_id"] = space_id
|
|
100
88
|
if disable_task_tracking is not None:
|
|
101
89
|
payload["disable_task_tracking"] = disable_task_tracking
|
|
102
90
|
if configs is not None:
|
|
@@ -141,18 +129,6 @@ class AsyncSessionsAPI:
|
|
|
141
129
|
data = await self._requester.request("GET", f"/session/{session_id}/configs")
|
|
142
130
|
return Session.model_validate(data)
|
|
143
131
|
|
|
144
|
-
async def connect_to_space(self, session_id: str, *, space_id: str) -> None:
|
|
145
|
-
"""Connect a session to a space.
|
|
146
|
-
|
|
147
|
-
Args:
|
|
148
|
-
session_id: The UUID of the session.
|
|
149
|
-
space_id: The UUID of the space to connect to.
|
|
150
|
-
"""
|
|
151
|
-
payload = {"space_id": space_id}
|
|
152
|
-
await self._requester.request(
|
|
153
|
-
"POST", f"/session/{session_id}/connect_to_space", json_data=payload
|
|
154
|
-
)
|
|
155
|
-
|
|
156
132
|
async def get_tasks(
|
|
157
133
|
self,
|
|
158
134
|
session_id: str,
|
|
@@ -382,23 +358,6 @@ class AsyncSessionsAPI:
|
|
|
382
358
|
data = await self._requester.request("POST", f"/session/{session_id}/flush")
|
|
383
359
|
return data # type: ignore
|
|
384
360
|
|
|
385
|
-
async def get_learning_status(self, session_id: str) -> LearningStatus:
|
|
386
|
-
"""Get learning status for a session.
|
|
387
|
-
|
|
388
|
-
Returns the count of space digested tasks and not space digested tasks.
|
|
389
|
-
If the session is not connected to a space, returns 0 and 0.
|
|
390
|
-
|
|
391
|
-
Args:
|
|
392
|
-
session_id: The UUID of the session.
|
|
393
|
-
|
|
394
|
-
Returns:
|
|
395
|
-
LearningStatus object containing space_digested_count and not_space_digested_count.
|
|
396
|
-
"""
|
|
397
|
-
data = await self._requester.request(
|
|
398
|
-
"GET", f"/session/{session_id}/get_learning_status"
|
|
399
|
-
)
|
|
400
|
-
return LearningStatus.model_validate(data)
|
|
401
|
-
|
|
402
361
|
async def get_token_counts(self, session_id: str) -> TokenCounts:
|
|
403
362
|
"""Get total token counts for all text and tool-call parts in a session.
|
|
404
363
|
|
|
@@ -9,6 +9,7 @@ from typing import Any, BinaryIO, cast
|
|
|
9
9
|
from .._utils import build_params
|
|
10
10
|
from ..client_types import AsyncRequesterProtocol
|
|
11
11
|
from ..types.skill import (
|
|
12
|
+
DownloadSkillToSandboxResp,
|
|
12
13
|
GetSkillFileResp,
|
|
13
14
|
ListSkillsOutput,
|
|
14
15
|
Skill,
|
|
@@ -133,3 +134,42 @@ class AsyncSkillsAPI:
|
|
|
133
134
|
|
|
134
135
|
data = await self._requester.request("GET", endpoint, params=params)
|
|
135
136
|
return GetSkillFileResp.model_validate(data)
|
|
137
|
+
|
|
138
|
+
async def download_to_sandbox(
|
|
139
|
+
self,
|
|
140
|
+
*,
|
|
141
|
+
skill_id: str,
|
|
142
|
+
sandbox_id: str,
|
|
143
|
+
) -> DownloadSkillToSandboxResp:
|
|
144
|
+
"""Download all files from a skill to a sandbox environment.
|
|
145
|
+
|
|
146
|
+
Files are placed at /skills/{skill_name}/.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
skill_id: The UUID of the skill to download.
|
|
150
|
+
sandbox_id: The UUID of the target sandbox.
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
DownloadSkillToSandboxResp containing success status, the directory path
|
|
154
|
+
where the skill was installed, and the skill's name and description.
|
|
155
|
+
|
|
156
|
+
Example:
|
|
157
|
+
```python
|
|
158
|
+
result = await client.skills.download_to_sandbox(
|
|
159
|
+
skill_id="skill-uuid",
|
|
160
|
+
sandbox_id="sandbox-uuid"
|
|
161
|
+
)
|
|
162
|
+
print(f"Success: {result.success}")
|
|
163
|
+
print(f"Skill installed at: {result.dir_path}")
|
|
164
|
+
print(f"Skill name: {result.name}")
|
|
165
|
+
print(f"Description: {result.description}")
|
|
166
|
+
```
|
|
167
|
+
"""
|
|
168
|
+
payload: dict[str, Any] = {"sandbox_id": sandbox_id}
|
|
169
|
+
|
|
170
|
+
data = await self._requester.request(
|
|
171
|
+
"POST",
|
|
172
|
+
f"/agent_skills/{skill_id}/download_to_sandbox",
|
|
173
|
+
json_data=payload,
|
|
174
|
+
)
|
|
175
|
+
return DownloadSkillToSandboxResp.model_validate(data)
|
|
@@ -41,7 +41,7 @@ class AsyncUsersAPI:
|
|
|
41
41
|
identifier: The user identifier string.
|
|
42
42
|
|
|
43
43
|
Returns:
|
|
44
|
-
GetUserResourcesOutput containing counts for
|
|
44
|
+
GetUserResourcesOutput containing counts for Sessions, Disks, and Skills.
|
|
45
45
|
"""
|
|
46
46
|
data = await self._requester.request(
|
|
47
47
|
"GET", f"/user/{quote(identifier, safe='')}/resources"
|
|
@@ -49,7 +49,7 @@ class AsyncUsersAPI:
|
|
|
49
49
|
return GetUserResourcesOutput.model_validate(data)
|
|
50
50
|
|
|
51
51
|
async def delete(self, identifier: str) -> None:
|
|
52
|
-
"""Delete a user and cascade delete all associated resources (
|
|
52
|
+
"""Delete a user and cascade delete all associated resources (Session, Disk, Skill).
|
|
53
53
|
|
|
54
54
|
Args:
|
|
55
55
|
identifier: The user identifier string.
|
acontext/resources/sandboxes.py
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
Sandboxes endpoints.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
from .._utils import build_params
|
|
5
6
|
from ..client_types import RequesterProtocol
|
|
6
7
|
from ..types.sandbox import (
|
|
8
|
+
GetSandboxLogsOutput,
|
|
7
9
|
SandboxCommandOutput,
|
|
8
10
|
SandboxRuntimeInfo,
|
|
9
11
|
)
|
|
@@ -28,12 +30,15 @@ class SandboxesAPI:
|
|
|
28
30
|
*,
|
|
29
31
|
sandbox_id: str,
|
|
30
32
|
command: str,
|
|
33
|
+
timeout: float | None = None,
|
|
31
34
|
) -> SandboxCommandOutput:
|
|
32
35
|
"""Execute a shell command in the sandbox.
|
|
33
36
|
|
|
34
37
|
Args:
|
|
35
38
|
sandbox_id: The UUID of the sandbox.
|
|
36
39
|
command: The shell command to execute.
|
|
40
|
+
timeout: Optional timeout in seconds for this command.
|
|
41
|
+
If not provided, uses the client's default timeout.
|
|
37
42
|
|
|
38
43
|
Returns:
|
|
39
44
|
SandboxCommandOutput containing stdout, stderr, and exit code.
|
|
@@ -42,6 +47,7 @@ class SandboxesAPI:
|
|
|
42
47
|
"POST",
|
|
43
48
|
f"/sandbox/{sandbox_id}/exec",
|
|
44
49
|
json_data={"command": command},
|
|
50
|
+
timeout=timeout,
|
|
45
51
|
)
|
|
46
52
|
return SandboxCommandOutput.model_validate(data)
|
|
47
53
|
|
|
@@ -56,3 +62,24 @@ class SandboxesAPI:
|
|
|
56
62
|
"""
|
|
57
63
|
data = self._requester.request("DELETE", f"/sandbox/{sandbox_id}")
|
|
58
64
|
return FlagResponse.model_validate(data)
|
|
65
|
+
|
|
66
|
+
def get_logs(
|
|
67
|
+
self,
|
|
68
|
+
*,
|
|
69
|
+
limit: int | None = None,
|
|
70
|
+
cursor: str | None = None,
|
|
71
|
+
time_desc: bool | None = None,
|
|
72
|
+
) -> GetSandboxLogsOutput:
|
|
73
|
+
"""Get sandbox logs for the project with cursor-based pagination.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
limit: Maximum number of logs to return (default 20, max 200).
|
|
77
|
+
cursor: Cursor for pagination. Use the cursor from the previous response to get the next page.
|
|
78
|
+
time_desc: Order by created_at descending if True, ascending if False (default False).
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
GetSandboxLogsOutput containing the list of sandbox logs and pagination information.
|
|
82
|
+
"""
|
|
83
|
+
params = build_params(limit=limit, cursor=cursor, time_desc=time_desc)
|
|
84
|
+
data = self._requester.request("GET", "/sandbox/logs", params=params or None)
|
|
85
|
+
return GetSandboxLogsOutput.model_validate(data)
|
acontext/resources/sessions.py
CHANGED
|
@@ -12,7 +12,6 @@ from ..types.session import (
|
|
|
12
12
|
EditStrategy,
|
|
13
13
|
GetMessagesOutput,
|
|
14
14
|
GetTasksOutput,
|
|
15
|
-
LearningStatus,
|
|
16
15
|
ListSessionsOutput,
|
|
17
16
|
Message,
|
|
18
17
|
MessageObservingStatus,
|
|
@@ -38,8 +37,6 @@ class SessionsAPI:
|
|
|
38
37
|
self,
|
|
39
38
|
*,
|
|
40
39
|
user: str | None = None,
|
|
41
|
-
space_id: str | None = None,
|
|
42
|
-
not_connected: bool | None = None,
|
|
43
40
|
limit: int | None = None,
|
|
44
41
|
cursor: str | None = None,
|
|
45
42
|
time_desc: bool | None = None,
|
|
@@ -48,8 +45,6 @@ class SessionsAPI:
|
|
|
48
45
|
|
|
49
46
|
Args:
|
|
50
47
|
user: Filter by user identifier. Defaults to None.
|
|
51
|
-
space_id: Filter sessions by space ID. Defaults to None.
|
|
52
|
-
not_connected: Filter sessions that are not connected to a space. Defaults to None.
|
|
53
48
|
limit: Maximum number of sessions to return. Defaults to None.
|
|
54
49
|
cursor: Cursor for pagination. Defaults to None.
|
|
55
50
|
time_desc: Order by created_at descending if True, ascending if False. Defaults to None.
|
|
@@ -60,11 +55,8 @@ class SessionsAPI:
|
|
|
60
55
|
params: dict[str, Any] = {}
|
|
61
56
|
if user:
|
|
62
57
|
params["user"] = user
|
|
63
|
-
if space_id:
|
|
64
|
-
params["space_id"] = space_id
|
|
65
58
|
params.update(
|
|
66
59
|
build_params(
|
|
67
|
-
not_connected=not_connected,
|
|
68
60
|
limit=limit,
|
|
69
61
|
cursor=cursor,
|
|
70
62
|
time_desc=time_desc,
|
|
@@ -77,7 +69,6 @@ class SessionsAPI:
|
|
|
77
69
|
self,
|
|
78
70
|
*,
|
|
79
71
|
user: str | None = None,
|
|
80
|
-
space_id: str | None = None,
|
|
81
72
|
disable_task_tracking: bool | None = None,
|
|
82
73
|
configs: Mapping[str, Any] | None = None,
|
|
83
74
|
) -> Session:
|
|
@@ -85,7 +76,6 @@ class SessionsAPI:
|
|
|
85
76
|
|
|
86
77
|
Args:
|
|
87
78
|
user: Optional user identifier string. Defaults to None.
|
|
88
|
-
space_id: Optional space ID to associate with the session. Defaults to None.
|
|
89
79
|
disable_task_tracking: Whether to disable task tracking for this session. Defaults to None (server default: False).
|
|
90
80
|
configs: Optional session configuration dictionary. Defaults to None.
|
|
91
81
|
|
|
@@ -95,8 +85,6 @@ class SessionsAPI:
|
|
|
95
85
|
payload: dict[str, Any] = {}
|
|
96
86
|
if user:
|
|
97
87
|
payload["user"] = user
|
|
98
|
-
if space_id:
|
|
99
|
-
payload["space_id"] = space_id
|
|
100
88
|
if disable_task_tracking is not None:
|
|
101
89
|
payload["disable_task_tracking"] = disable_task_tracking
|
|
102
90
|
if configs is not None:
|
|
@@ -141,18 +129,6 @@ class SessionsAPI:
|
|
|
141
129
|
data = self._requester.request("GET", f"/session/{session_id}/configs")
|
|
142
130
|
return Session.model_validate(data)
|
|
143
131
|
|
|
144
|
-
def connect_to_space(self, session_id: str, *, space_id: str) -> None:
|
|
145
|
-
"""Connect a session to a space.
|
|
146
|
-
|
|
147
|
-
Args:
|
|
148
|
-
session_id: The UUID of the session.
|
|
149
|
-
space_id: The UUID of the space to connect to.
|
|
150
|
-
"""
|
|
151
|
-
payload = {"space_id": space_id}
|
|
152
|
-
self._requester.request(
|
|
153
|
-
"POST", f"/session/{session_id}/connect_to_space", json_data=payload
|
|
154
|
-
)
|
|
155
|
-
|
|
156
132
|
def get_tasks(
|
|
157
133
|
self,
|
|
158
134
|
session_id: str,
|
|
@@ -382,23 +358,6 @@ class SessionsAPI:
|
|
|
382
358
|
data = self._requester.request("POST", f"/session/{session_id}/flush")
|
|
383
359
|
return data # type: ignore
|
|
384
360
|
|
|
385
|
-
def get_learning_status(self, session_id: str) -> LearningStatus:
|
|
386
|
-
"""Get learning status for a session.
|
|
387
|
-
|
|
388
|
-
Returns the count of space digested tasks and not space digested tasks.
|
|
389
|
-
If the session is not connected to a space, returns 0 and 0.
|
|
390
|
-
|
|
391
|
-
Args:
|
|
392
|
-
session_id: The UUID of the session.
|
|
393
|
-
|
|
394
|
-
Returns:
|
|
395
|
-
LearningStatus object containing space_digested_count and not_space_digested_count.
|
|
396
|
-
"""
|
|
397
|
-
data = self._requester.request(
|
|
398
|
-
"GET", f"/session/{session_id}/get_learning_status"
|
|
399
|
-
)
|
|
400
|
-
return LearningStatus.model_validate(data)
|
|
401
|
-
|
|
402
361
|
def get_token_counts(self, session_id: str) -> TokenCounts:
|
|
403
362
|
"""Get total token counts for all text and tool-call parts in a session.
|
|
404
363
|
|
acontext/resources/skills.py
CHANGED
|
@@ -9,6 +9,7 @@ from typing import Any, BinaryIO, cast
|
|
|
9
9
|
from .._utils import build_params
|
|
10
10
|
from ..client_types import RequesterProtocol
|
|
11
11
|
from ..types.skill import (
|
|
12
|
+
DownloadSkillToSandboxResp,
|
|
12
13
|
GetSkillFileResp,
|
|
13
14
|
ListSkillsOutput,
|
|
14
15
|
Skill,
|
|
@@ -135,3 +136,42 @@ class SkillsAPI:
|
|
|
135
136
|
|
|
136
137
|
data = self._requester.request("GET", endpoint, params=params)
|
|
137
138
|
return GetSkillFileResp.model_validate(data)
|
|
139
|
+
|
|
140
|
+
def download_to_sandbox(
|
|
141
|
+
self,
|
|
142
|
+
*,
|
|
143
|
+
skill_id: str,
|
|
144
|
+
sandbox_id: str,
|
|
145
|
+
) -> DownloadSkillToSandboxResp:
|
|
146
|
+
"""Download all files from a skill to a sandbox environment.
|
|
147
|
+
|
|
148
|
+
Files are placed at /skills/{skill_name}/.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
skill_id: The UUID of the skill to download.
|
|
152
|
+
sandbox_id: The UUID of the target sandbox.
|
|
153
|
+
|
|
154
|
+
Returns:
|
|
155
|
+
DownloadSkillToSandboxResp containing success status, the directory path
|
|
156
|
+
where the skill was installed, and the skill's name and description.
|
|
157
|
+
|
|
158
|
+
Example:
|
|
159
|
+
```python
|
|
160
|
+
result = client.skills.download_to_sandbox(
|
|
161
|
+
skill_id="skill-uuid",
|
|
162
|
+
sandbox_id="sandbox-uuid"
|
|
163
|
+
)
|
|
164
|
+
print(f"Success: {result.success}")
|
|
165
|
+
print(f"Skill installed at: {result.dir_path}")
|
|
166
|
+
print(f"Skill name: {result.name}")
|
|
167
|
+
print(f"Description: {result.description}")
|
|
168
|
+
```
|
|
169
|
+
"""
|
|
170
|
+
payload: dict[str, Any] = {"sandbox_id": sandbox_id}
|
|
171
|
+
|
|
172
|
+
data = self._requester.request(
|
|
173
|
+
"POST",
|
|
174
|
+
f"/agent_skills/{skill_id}/download_to_sandbox",
|
|
175
|
+
json_data=payload,
|
|
176
|
+
)
|
|
177
|
+
return DownloadSkillToSandboxResp.model_validate(data)
|
acontext/resources/users.py
CHANGED
|
@@ -41,7 +41,7 @@ class UsersAPI:
|
|
|
41
41
|
identifier: The user identifier string.
|
|
42
42
|
|
|
43
43
|
Returns:
|
|
44
|
-
GetUserResourcesOutput containing counts for
|
|
44
|
+
GetUserResourcesOutput containing counts for Sessions, Disks, and Skills.
|
|
45
45
|
"""
|
|
46
46
|
data = self._requester.request(
|
|
47
47
|
"GET", f"/user/{quote(identifier, safe='')}/resources"
|
|
@@ -49,7 +49,7 @@ class UsersAPI:
|
|
|
49
49
|
return GetUserResourcesOutput.model_validate(data)
|
|
50
50
|
|
|
51
51
|
def delete(self, identifier: str) -> None:
|
|
52
|
-
"""Delete a user and cascade delete all associated resources (
|
|
52
|
+
"""Delete a user and cascade delete all associated resources (Session, Disk, Skill).
|
|
53
53
|
|
|
54
54
|
Args:
|
|
55
55
|
identifier: The user identifier string.
|
acontext/types/__init__.py
CHANGED
|
@@ -13,7 +13,6 @@ from .session import (
|
|
|
13
13
|
Asset,
|
|
14
14
|
GetMessagesOutput,
|
|
15
15
|
GetTasksOutput,
|
|
16
|
-
LearningStatus,
|
|
17
16
|
ListSessionsOutput,
|
|
18
17
|
Message,
|
|
19
18
|
Part,
|
|
@@ -23,18 +22,8 @@ from .session import (
|
|
|
23
22
|
TaskData,
|
|
24
23
|
TokenCounts,
|
|
25
24
|
)
|
|
26
|
-
from .block import Block
|
|
27
|
-
from .space import (
|
|
28
|
-
ExperienceConfirmation,
|
|
29
|
-
ListExperienceConfirmationsOutput,
|
|
30
|
-
ListSpacesOutput,
|
|
31
|
-
SearchResultBlockItem,
|
|
32
|
-
Space,
|
|
33
|
-
SpaceSearchResult,
|
|
34
|
-
)
|
|
35
25
|
from .tool import (
|
|
36
26
|
FlagResponse,
|
|
37
|
-
InsertBlockResponse,
|
|
38
27
|
ToolReferenceData,
|
|
39
28
|
ToolRenameItem,
|
|
40
29
|
)
|
|
@@ -46,7 +35,11 @@ from .skill import (
|
|
|
46
35
|
SkillCatalogItem,
|
|
47
36
|
)
|
|
48
37
|
from .sandbox import (
|
|
38
|
+
GeneratedFile,
|
|
39
|
+
GetSandboxLogsOutput,
|
|
40
|
+
HistoryCommand,
|
|
49
41
|
SandboxCommandOutput,
|
|
42
|
+
SandboxLog,
|
|
50
43
|
SandboxRuntimeInfo,
|
|
51
44
|
)
|
|
52
45
|
from .user import (
|
|
@@ -69,7 +62,6 @@ __all__ = [
|
|
|
69
62
|
"Asset",
|
|
70
63
|
"GetMessagesOutput",
|
|
71
64
|
"GetTasksOutput",
|
|
72
|
-
"LearningStatus",
|
|
73
65
|
"ListSessionsOutput",
|
|
74
66
|
"Message",
|
|
75
67
|
"Part",
|
|
@@ -78,18 +70,8 @@ __all__ = [
|
|
|
78
70
|
"Task",
|
|
79
71
|
"TaskData",
|
|
80
72
|
"TokenCounts",
|
|
81
|
-
# Space types
|
|
82
|
-
"ExperienceConfirmation",
|
|
83
|
-
"ListExperienceConfirmationsOutput",
|
|
84
|
-
"ListSpacesOutput",
|
|
85
|
-
"SearchResultBlockItem",
|
|
86
|
-
"Space",
|
|
87
|
-
"SpaceSearchResult",
|
|
88
|
-
# Block types
|
|
89
|
-
"Block",
|
|
90
73
|
# Tool types
|
|
91
74
|
"FlagResponse",
|
|
92
|
-
"InsertBlockResponse",
|
|
93
75
|
"ToolReferenceData",
|
|
94
76
|
"ToolRenameItem",
|
|
95
77
|
# Skill types
|
|
@@ -101,6 +83,10 @@ __all__ = [
|
|
|
101
83
|
# Sandbox types
|
|
102
84
|
"SandboxCommandOutput",
|
|
103
85
|
"SandboxRuntimeInfo",
|
|
86
|
+
"SandboxLog",
|
|
87
|
+
"HistoryCommand",
|
|
88
|
+
"GeneratedFile",
|
|
89
|
+
"GetSandboxLogsOutput",
|
|
104
90
|
# User types
|
|
105
91
|
"GetUserResourcesOutput",
|
|
106
92
|
"ListUsersOutput",
|
acontext/types/sandbox.py
CHANGED
|
@@ -18,3 +18,30 @@ class SandboxCommandOutput(BaseModel):
|
|
|
18
18
|
stdout: str = Field(..., description="Standard output from the command")
|
|
19
19
|
stderr: str = Field(..., description="Standard error from the command")
|
|
20
20
|
exit_code: int = Field(..., description="Exit code of the command")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class HistoryCommand(BaseModel):
|
|
24
|
+
command: str = Field(..., description="The shell command that was executed")
|
|
25
|
+
exit_code: int = Field(..., description="The exit code of the command")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class GeneratedFile(BaseModel):
|
|
29
|
+
sandbox_path: str = Field(..., description="The path to the file in the sandbox")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class SandboxLog(BaseModel):
|
|
33
|
+
id: str = Field(..., description="Sandbox log UUID")
|
|
34
|
+
project_id: str = Field(..., description="Project UUID")
|
|
35
|
+
backend_sandbox_id: str | None = Field(None, description="Backend sandbox ID")
|
|
36
|
+
backend_type: str = Field(..., description="Backend type (e.g., e2b, cloudflare)")
|
|
37
|
+
history_commands: list[HistoryCommand] = Field(..., description="Array of command execution records")
|
|
38
|
+
generated_files: list[GeneratedFile] = Field(..., description="Array of files generated/downloaded from the sandbox")
|
|
39
|
+
will_total_alive_seconds: int = Field(..., description="Total seconds the sandbox will be alive")
|
|
40
|
+
created_at: str = Field(..., description="ISO 8601 formatted creation timestamp")
|
|
41
|
+
updated_at: str = Field(..., description="ISO 8601 formatted update timestamp")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class GetSandboxLogsOutput(BaseModel):
|
|
45
|
+
items: list[SandboxLog] = Field(..., description="List of sandbox logs")
|
|
46
|
+
next_cursor: str | None = Field(None, description="Cursor for pagination")
|
|
47
|
+
has_more: bool = Field(..., description="Whether there are more items")
|
acontext/types/session.py
CHANGED
|
@@ -171,7 +171,6 @@ class Session(BaseModel):
|
|
|
171
171
|
disable_task_tracking: bool = Field(
|
|
172
172
|
False, description="Whether task tracking is disabled for this session"
|
|
173
173
|
)
|
|
174
|
-
space_id: str | None = Field(None, description="Space UUID, optional")
|
|
175
174
|
configs: dict[str, Any] | None = Field(
|
|
176
175
|
None, description="Session configuration dictionary"
|
|
177
176
|
)
|
|
@@ -193,9 +192,6 @@ class TaskData(BaseModel):
|
|
|
193
192
|
user_preferences: list[str] | None = Field(
|
|
194
193
|
None, description="List of user preferences related to the task"
|
|
195
194
|
)
|
|
196
|
-
sop_thinking: str | None = Field(
|
|
197
|
-
None, description="Standard Operating Procedure thinking notes"
|
|
198
|
-
)
|
|
199
195
|
|
|
200
196
|
|
|
201
197
|
class Task(BaseModel):
|
|
@@ -211,7 +207,6 @@ class Task(BaseModel):
|
|
|
211
207
|
description="Task status: 'success', 'failed', 'running', or 'pending'",
|
|
212
208
|
)
|
|
213
209
|
is_planning: bool = Field(..., description="Whether the task is in planning phase")
|
|
214
|
-
space_digested: bool = Field(..., description="Whether the space has been digested")
|
|
215
210
|
created_at: str = Field(..., description="ISO 8601 formatted creation timestamp")
|
|
216
211
|
updated_at: str = Field(..., description="ISO 8601 formatted update timestamp")
|
|
217
212
|
|
|
@@ -280,17 +275,6 @@ class GetTasksOutput(BaseModel):
|
|
|
280
275
|
has_more: bool = Field(..., description="Whether there are more items")
|
|
281
276
|
|
|
282
277
|
|
|
283
|
-
class LearningStatus(BaseModel):
|
|
284
|
-
"""Response model for learning status."""
|
|
285
|
-
|
|
286
|
-
space_digested_count: int = Field(
|
|
287
|
-
..., description="Number of tasks that are space digested"
|
|
288
|
-
)
|
|
289
|
-
not_space_digested_count: int = Field(
|
|
290
|
-
..., description="Number of tasks that are not space digested"
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
|
|
294
278
|
class TokenCounts(BaseModel):
|
|
295
279
|
"""Response model for token counts."""
|
|
296
280
|
|
acontext/types/skill.py
CHANGED
|
@@ -63,3 +63,14 @@ class GetSkillFileResp(BaseModel):
|
|
|
63
63
|
None,
|
|
64
64
|
description="Parsed file content if available (present if file is parseable)",
|
|
65
65
|
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class DownloadSkillToSandboxResp(BaseModel):
|
|
69
|
+
"""Response model for downloading a skill to sandbox."""
|
|
70
|
+
|
|
71
|
+
success: bool = Field(..., description="Whether the download was successful")
|
|
72
|
+
dir_path: str = Field(
|
|
73
|
+
..., description="Full path to the skill directory in sandbox"
|
|
74
|
+
)
|
|
75
|
+
name: str = Field(..., description="Skill name")
|
|
76
|
+
description: str = Field(..., description="Skill description")
|
acontext/types/tool.py
CHANGED
|
@@ -10,12 +10,6 @@ class FlagResponse(BaseModel):
|
|
|
10
10
|
errmsg: str = Field(..., description="Error message")
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class InsertBlockResponse(BaseModel):
|
|
14
|
-
"""Response from inserting a block."""
|
|
15
|
-
|
|
16
|
-
id: str = Field(..., description="Block UUID")
|
|
17
|
-
|
|
18
|
-
|
|
19
13
|
class ToolReferenceData(BaseModel):
|
|
20
14
|
"""Tool reference data."""
|
|
21
15
|
|
acontext/types/user.py
CHANGED
|
@@ -24,7 +24,6 @@ class ListUsersOutput(BaseModel):
|
|
|
24
24
|
class UserResourceCounts(BaseModel):
|
|
25
25
|
"""Resource counts for a user."""
|
|
26
26
|
|
|
27
|
-
spaces_count: int = Field(..., description="Number of spaces")
|
|
28
27
|
sessions_count: int = Field(..., description="Number of sessions")
|
|
29
28
|
disks_count: int = Field(..., description="Number of disks")
|
|
30
29
|
skills_count: int = Field(..., description="Number of skills")
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
acontext/__init__.py,sha256=o99U8tML8Xx8EWqNiT9GYJw9a3whtTIUOHg3cyYDcbQ,879
|
|
2
|
+
acontext/_constants.py,sha256=Ikuy_Wz3CPmXjKPLXb4Y580-fe54o1hZ2ZB1Bpw3sFE,363
|
|
3
|
+
acontext/_utils.py,sha256=GKQH45arKh0sDu64u-5jwrII_ctnU_oChYlgR5lRkfE,1250
|
|
4
|
+
acontext/agent/__init__.py,sha256=lx5HqeVDfIxkbGfAt0ju8hkk8EPsgFvKmMrQzjNXR8w,213
|
|
5
|
+
acontext/agent/base.py,sha256=BDTqfqkPrPzvQIH_llOX6S_bkcDw3E30J5x9yd47Q6g,3526
|
|
6
|
+
acontext/agent/disk.py,sha256=q-3DRkLcQLfdAXADJM3GPo6reWPzhKQrnyBiZdBZvIY,22775
|
|
7
|
+
acontext/agent/prompts.py,sha256=Y20C78f9PacjpyN_I_urQBDzoiAeVSXE4Cj5BV67Qhg,4865
|
|
8
|
+
acontext/agent/sandbox.py,sha256=eGN_yBTo3jWNhxTZMi-Rkr0ALJ6YP5WZbF8u0oBPn2Y,18209
|
|
9
|
+
acontext/agent/skill.py,sha256=uB7teH7OAk4Cy6pOLRCJFBi5KZbyMMgZSLEt77TLB20,12880
|
|
10
|
+
acontext/agent/text_editor.py,sha256=HsmDexX2wqacaeIwkCyDrojZDQiI9mr4krt6phSKS7g,13247
|
|
11
|
+
acontext/async_client.py,sha256=WjqW7ruMtlYTBlk6PQ1-1yhjFSBBxGqI3oxrfEqqIpQ,8471
|
|
12
|
+
acontext/client.py,sha256=XggELxXU9-8BcAcHOoiqQZypfPmkhe7SyJ3plHq-A9M,8217
|
|
13
|
+
acontext/client_types.py,sha256=oR6lSDMjEERx0mIVOpKaTXbEu_lfoxe3fDpzA-ALE-8,1063
|
|
14
|
+
acontext/errors.py,sha256=W9i7_t46q9kbci3XAyZiyQhS154d4R9rSon3na-gjgs,1296
|
|
15
|
+
acontext/messages.py,sha256=oNRZStfhcPFt6DPOfs_-Q7R1Xui6dOMr3wmpmC8pzvE,2310
|
|
16
|
+
acontext/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
acontext/resources/__init__.py,sha256=i2_12EUfxo2z-dgMu8dyAsEiT9nf2P00voN2_vMZ2K8,843
|
|
18
|
+
acontext/resources/async_disks.py,sha256=rc8hSdVsZ1UbrK2kwxmEMZyP0aEMsvjyZ70cYddpiF8,12051
|
|
19
|
+
acontext/resources/async_sandboxes.py,sha256=qkpEhmUUUrq_C1mVSVyUzBvxzBdq6BvL9e76FXyk19M,2850
|
|
20
|
+
acontext/resources/async_sessions.py,sha256=wBUUIDUvMqe_mdR3l_3HuPfEWUcq65SOJLc5mKTu0nI,14691
|
|
21
|
+
acontext/resources/async_skills.py,sha256=eRn3NjBhR6_6GmEyZO_nKc0OnHgR_TeIHxqGX_73lwo,5999
|
|
22
|
+
acontext/resources/async_tools.py,sha256=RbGaF2kX65Mun-q-Fp5H1J8waWTLIdCOfbdY19jpn1o,1091
|
|
23
|
+
acontext/resources/async_users.py,sha256=CjW_Xz-UnNf449Hr1j3YeGgtIVZi2ePY5-r7Uj3wMIc,2005
|
|
24
|
+
acontext/resources/disks.py,sha256=YyAzm6A00T4A3dI8YTEAOxwm6bnCnp8gWIoZ4lLGN5w,11859
|
|
25
|
+
acontext/resources/sandboxes.py,sha256=2E9Ls15t3FQ9LBZOnk0--IjQhxwZGTPkbpS5zcnOJSo,2779
|
|
26
|
+
acontext/resources/sessions.py,sha256=yaFwiWsShM4HVguwsM-Mp9HHJohl84R-LOFp8uGJUyU,14454
|
|
27
|
+
acontext/resources/skills.py,sha256=CZFgJhRDtGlbDcTBKNxFkG4DlqoaJb0c_ymfV12QKdM,5930
|
|
28
|
+
acontext/resources/tools.py,sha256=II_185B0HYKSP43hizE6C1zs7kjkkPLKihuEG8s-DRY,1046
|
|
29
|
+
acontext/resources/users.py,sha256=vZfBHd2ARmd9d5d8n5rLaMUT5z2bMO82k7OcqMaFqxk,1946
|
|
30
|
+
acontext/types/__init__.py,sha256=rZHoT0gWIQ576J2mGqhyqWu4Uh8jn0HINdhNJwbjZ8U,1725
|
|
31
|
+
acontext/types/common.py,sha256=5kLwzszlIofz8qZ9-Wj_zcBBiF22mAWgH9uWPkcgWCE,327
|
|
32
|
+
acontext/types/disk.py,sha256=jdQqQ8HF3cwl_Y1dh98TOXZKfcdN_gSzaSrCE8PKT-0,2250
|
|
33
|
+
acontext/types/sandbox.py,sha256=vbgpwjbVjjY3uwXxSbOP8IfC65lhkJ_4BYA19dqj5FE,2248
|
|
34
|
+
acontext/types/session.py,sha256=WqhEtrg1jwknIiQ9TipUeLONS4bY_J_C7Xd_TrYlsWg,11003
|
|
35
|
+
acontext/types/skill.py,sha256=v7OAvtkwTeZAkLG7NQMcwFoSJ4g-HDWjPZ4EoMyU3mk,2779
|
|
36
|
+
acontext/types/tool.py,sha256=UlX6JIGRKd96vPayOkyi6pGwFi6w9GwWwAxr4BcqVts,670
|
|
37
|
+
acontext/types/user.py,sha256=dBzHCqULSJ3Sqw7T8nA0U8Sctz76Pd0hm1qsHvtEIBQ,1264
|
|
38
|
+
acontext/uploads.py,sha256=6twnqQOY_eerNuEjeSKsE_3S0IfJUiczXtAy4aXqDl8,1379
|
|
39
|
+
acontext-0.1.4.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
|
|
40
|
+
acontext-0.1.4.dist-info/METADATA,sha256=wvxyJ9Rq48wlqsbGdig2RELL5RvXYGtVENosB7a0nGU,888
|
|
41
|
+
acontext-0.1.4.dist-info/RECORD,,
|