acontext 0.0.14__py3-none-any.whl → 0.0.17__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/types/session.py CHANGED
@@ -13,10 +13,13 @@ class RemoveToolResultParams(TypedDict, total=False):
13
13
  Defaults to 3 if not specified.
14
14
  tool_result_placeholder: Custom text to replace old tool results with.
15
15
  Defaults to "Done" if not specified.
16
+ keep_tools: List of tool names that should never have their results removed.
17
+ Tool results from these tools are always kept regardless of keep_recent_n_tool_results.
16
18
  """
17
19
 
18
20
  keep_recent_n_tool_results: NotRequired[int]
19
21
  tool_result_placeholder: NotRequired[str]
22
+ keep_tools: NotRequired[list[str]]
20
23
 
21
24
 
22
25
  class RemoveToolResultStrategy(TypedDict):
@@ -36,10 +39,12 @@ class RemoveToolCallParamsParams(TypedDict, total=False):
36
39
  Attributes:
37
40
  keep_recent_n_tool_calls: Number of most recent tool calls to keep with full parameters.
38
41
  Defaults to 3 if not specified.
42
+ keep_tools: List of tool names that should never have their parameters removed.
43
+ Tool calls for these tools always keep their full parameters regardless of keep_recent_n_tool_calls.
39
44
  """
40
45
 
41
46
  keep_recent_n_tool_calls: NotRequired[int]
42
-
47
+ keep_tools: NotRequired[list[str]]
43
48
 
44
49
 
45
50
  class RemoveToolCallParamsStrategy(TypedDict):
@@ -57,7 +62,6 @@ class RemoveToolCallParamsStrategy(TypedDict):
57
62
  params: RemoveToolCallParamsParams
58
63
 
59
64
 
60
-
61
65
  class TokenLimitParams(TypedDict):
62
66
  """Parameters for the token_limit edit strategy.
63
67
 
@@ -87,7 +91,9 @@ class TokenLimitStrategy(TypedDict):
87
91
 
88
92
  # Union type for all edit strategies
89
93
  # When adding new strategies, add them to this Union: EditStrategy = Union[RemoveToolResultStrategy, OtherStrategy, ...]
90
- EditStrategy = Union[RemoveToolResultStrategy, RemoveToolCallParamsStrategy, TokenLimitStrategy]
94
+ EditStrategy = Union[
95
+ RemoveToolResultStrategy, RemoveToolCallParamsStrategy, TokenLimitStrategy
96
+ ]
91
97
 
92
98
 
93
99
  class Asset(BaseModel):
@@ -137,6 +143,7 @@ class Session(BaseModel):
137
143
 
138
144
  id: str = Field(..., description="Session UUID")
139
145
  project_id: str = Field(..., description="Project UUID")
146
+ user_id: str | None = Field(None, description="User UUID")
140
147
  disable_task_tracking: bool = Field(
141
148
  False, description="Whether task tracking is disabled for this session"
142
149
  )
@@ -216,15 +223,29 @@ class GetMessagesOutput(BaseModel):
216
223
  description="List of messages in the requested format (Message, OpenAI format, or Anthropic format)",
217
224
  )
218
225
  ids: list[str] = Field(
219
- ...,
220
- description="List of message UUIDs corresponding to each item in the same order",
226
+ ...,
227
+ description="List of message UUIDs corresponding to each item in the same order",
221
228
  )
222
229
  next_cursor: str | None = Field(None, description="Cursor for pagination")
223
230
  has_more: bool = Field(..., description="Whether there are more items")
231
+ this_time_tokens: int = Field(
232
+ ...,
233
+ description="Total token count of the returned messages",
234
+ )
224
235
  public_urls: dict[str, PublicURL] | None = Field(
225
236
  None,
226
237
  description="Map of SHA256 hash to PublicURL (only included when format='acontext')",
227
238
  )
239
+ edit_at_message_id: str | None = Field(
240
+ None,
241
+ description=(
242
+ "The message ID where edit strategies were applied up to. "
243
+ "If pin_editing_strategies_at_message was provided, this equals that value. "
244
+ "Otherwise, this is the ID of the last message in the response. "
245
+ "Use this value to maintain prompt cache stability by passing it as "
246
+ "pin_editing_strategies_at_message in subsequent requests."
247
+ ),
248
+ )
228
249
 
229
250
 
230
251
  class GetTasksOutput(BaseModel):
@@ -254,18 +275,13 @@ class TokenCounts(BaseModel):
254
275
  description="Total token count for all text and tool-call parts in a session",
255
276
  )
256
277
 
278
+
257
279
  class MessageObservingStatus(BaseModel):
258
280
  """Response model for message observing status."""
259
-
260
- observed: int = Field(
261
- ..., description="Number of messages with observed status"
262
- )
281
+
282
+ observed: int = Field(..., description="Number of messages with observed status")
263
283
  in_process: int = Field(
264
284
  ..., description="Number of messages with in_process status"
265
285
  )
266
- pending: int = Field(
267
- ..., description="Number of messages with pending status"
268
- )
269
- updated_at: str = Field(
270
- ..., description="Timestamp when the status was retrieved"
271
- )
286
+ pending: int = Field(..., description="Number of messages with pending status")
287
+ updated_at: str = Field(..., description="Timestamp when the status was retrieved")
@@ -0,0 +1,69 @@
1
+ """Type definitions for skill resources."""
2
+
3
+ from typing import Any
4
+
5
+ from pydantic import BaseModel, Field
6
+
7
+ from .common import FileContent
8
+
9
+
10
+ class FileInfo(BaseModel):
11
+ """File information in a skill."""
12
+
13
+ path: str = Field(..., description="Relative file path from skill root")
14
+ mime: str = Field(..., description="MIME type of the file")
15
+
16
+
17
+ class Skill(BaseModel):
18
+ """Skill model representing an agent skill resource."""
19
+
20
+ id: str = Field(..., description="Skill UUID")
21
+ user_id: str | None = Field(None, description="User UUID")
22
+ name: str = Field(..., description="Skill name (unique within project)")
23
+ description: str = Field(..., description="Skill description")
24
+ file_index: list[FileInfo] = Field(
25
+ ..., description="List of file information (path and MIME type) in the skill"
26
+ )
27
+ meta: dict[str, Any] | None = Field(
28
+ None, description="Custom metadata dictionary"
29
+ )
30
+ created_at: str = Field(..., description="ISO 8601 formatted creation timestamp")
31
+ updated_at: str = Field(..., description="ISO 8601 formatted update timestamp")
32
+
33
+
34
+ class SkillCatalogItem(BaseModel):
35
+ """Catalog item containing only name and description."""
36
+
37
+ name: str = Field(..., description="Skill name (unique within project)")
38
+ description: str = Field(..., description="Skill description")
39
+
40
+
41
+ class ListSkillsOutput(BaseModel):
42
+ """Response model for listing skills (catalog format with name and description only)."""
43
+
44
+ items: list[SkillCatalogItem] = Field(
45
+ ..., description="List of skills with name and description"
46
+ )
47
+ next_cursor: str | None = Field(None, description="Cursor for pagination")
48
+ has_more: bool = Field(..., description="Whether there are more items")
49
+
50
+
51
+ class _ListSkillsResponse(BaseModel):
52
+ """Internal response model for API pagination (full Skill objects).
53
+
54
+ This is used internally to parse the raw API response before converting
55
+ to the catalog format (ListSkillsOutput).
56
+ """
57
+ items: list[Skill]
58
+ next_cursor: str | None = None
59
+ has_more: bool = False
60
+
61
+
62
+ class GetSkillFileResp(BaseModel):
63
+ """Response model for getting a skill file."""
64
+
65
+ path: str = Field(..., description="File path")
66
+ mime: str = Field(..., description="MIME type of the file")
67
+ url: str | None = Field(None, description="Presigned URL for downloading the file (present if file is not parseable)")
68
+ content: FileContent | None = Field(None, description="Parsed file content if available (present if file is parseable)")
69
+
acontext/types/space.py CHANGED
@@ -10,6 +10,7 @@ class Space(BaseModel):
10
10
 
11
11
  id: str = Field(..., description="Space UUID")
12
12
  project_id: str = Field(..., description="Project UUID")
13
+ user_id: str | None = Field(None, description="User UUID")
13
14
  configs: dict[str, Any] | None = Field(
14
15
  None, description="Space configuration dictionary"
15
16
  )
acontext/types/user.py ADDED
@@ -0,0 +1,36 @@
1
+ """Type definitions for user resources."""
2
+
3
+ from pydantic import BaseModel, Field
4
+
5
+
6
+ class User(BaseModel):
7
+ """User model representing a user resource."""
8
+
9
+ id: str = Field(..., description="User UUID")
10
+ project_id: str = Field(..., description="Project UUID")
11
+ identifier: str = Field(..., description="User identifier string")
12
+ created_at: str = Field(..., description="ISO 8601 formatted creation timestamp")
13
+ updated_at: str = Field(..., description="ISO 8601 formatted update timestamp")
14
+
15
+
16
+ class ListUsersOutput(BaseModel):
17
+ """Response model for listing users."""
18
+
19
+ items: list[User] = Field(..., description="List of users")
20
+ next_cursor: str | None = Field(None, description="Cursor for pagination")
21
+ has_more: bool = Field(..., description="Whether there are more items")
22
+
23
+
24
+ class UserResourceCounts(BaseModel):
25
+ """Resource counts for a user."""
26
+
27
+ spaces_count: int = Field(..., description="Number of spaces")
28
+ sessions_count: int = Field(..., description="Number of sessions")
29
+ disks_count: int = Field(..., description="Number of disks")
30
+ skills_count: int = Field(..., description="Number of skills")
31
+
32
+
33
+ class GetUserResourcesOutput(BaseModel):
34
+ """Response model for getting user resources."""
35
+
36
+ counts: UserResourceCounts = Field(..., description="Resource counts")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: acontext
3
- Version: 0.0.14
3
+ Version: 0.0.17
4
4
  Summary: Python SDK for the Acontext API
5
5
  Keywords: acontext,sdk,client,api
6
6
  Requires-Dist: httpx>=0.28.1
@@ -0,0 +1,41 @@
1
+ acontext/__init__.py,sha256=jAgRawWIjyMd6g3gq7Xm_3vNB31cPj8rMFPO4LGQKdM,1027
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=PAUhm1rBYOdKw3lCD-H9d72emkGL4KoxEvVq4GeS9ig,158
5
+ acontext/agent/base.py,sha256=kN2KzV6fOlvmMSi_0yu2QqwVLtHh09TznAy_SDtC8iM,2998
6
+ acontext/agent/disk.py,sha256=dSDjCejP0o4Z4nHJgfKfIXLFZaCA9AFV852Yo9E9GHk,16131
7
+ acontext/agent/skill.py,sha256=opsOTQyuedqQMlwDXWMVwCwg0u9cyehfyELDEbat3bE,4451
8
+ acontext/async_client.py,sha256=sqdSNjl3tx8ijoRNYoEwh1Lxdlhfk0zyd-h-xffIJJE,8372
9
+ acontext/client.py,sha256=3xha-zbHYLwI1njlhmoB_BYK5JIJoXFyrCpvIi63b9o,8097
10
+ acontext/client_types.py,sha256=uVBWzLbZyXrqkljG49ojdQL_xX6N3n_HGt4Bs_TEE48,987
11
+ acontext/errors.py,sha256=W9i7_t46q9kbci3XAyZiyQhS154d4R9rSon3na-gjgs,1296
12
+ acontext/messages.py,sha256=oNRZStfhcPFt6DPOfs_-Q7R1Xui6dOMr3wmpmC8pzvE,2310
13
+ acontext/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ acontext/resources/__init__.py,sha256=Oww11t9hmwdNFK2nC8YW9mf4BBSz5YLPAXAWLlZuNTs,935
15
+ acontext/resources/async_blocks.py,sha256=e_iJpgcAdwS2tXQ16MMCnySlddp5JV3BadN_EyqZSF4,5555
16
+ acontext/resources/async_disks.py,sha256=rwcRwQ79ZYbMMWAj5YDDpKQmfAIOl9M3CTYxOZTy_UU,6830
17
+ acontext/resources/async_sessions.py,sha256=Ld9T8l884r3UuUprRz7MwafSI8BaPfLA0pg0dPfNM1A,14363
18
+ acontext/resources/async_skills.py,sha256=mbEzyUH7S2_jkZ5tfl0FzpHJ7Io3x_biw5FirhokzAQ,5062
19
+ acontext/resources/async_spaces.py,sha256=b8DNG2L43B6iSgfmH8M-0cxAp681IjSCjw-4alfjV2A,6712
20
+ acontext/resources/async_tools.py,sha256=RbGaF2kX65Mun-q-Fp5H1J8waWTLIdCOfbdY19jpn1o,1091
21
+ acontext/resources/async_users.py,sha256=m0nK_Luo6Uuvw2azGx8Wg2cXnipnTnyheolr79fX16Y,2020
22
+ acontext/resources/blocks.py,sha256=HJdAy5HdyTcHCYCPmqNdvApYKZ6aWs-ORIi_wQt3TUM,5447
23
+ acontext/resources/disks.py,sha256=pvxs9gdVBothuy0LSkPmuS061nNOgJX3iffypqLHW1Y,9032
24
+ acontext/resources/sessions.py,sha256=qUoLs01tzmYChHy3kozzGQ3ZeAz_JyWGtCIsVL20BO4,14491
25
+ acontext/resources/skills.py,sha256=FPp1YWhH85I9BU0fJJC9FbePIbFhyX6j2FYxjPuBEAc,4935
26
+ acontext/resources/spaces.py,sha256=Ktvkkn3Jj7CZoKMbn6fYuo0zqImoCWj2EnMsnL2q-0A,6571
27
+ acontext/resources/tools.py,sha256=II_185B0HYKSP43hizE6C1zs7kjkkPLKihuEG8s-DRY,1046
28
+ acontext/resources/users.py,sha256=6xwU7UeMWRIGn6n7LKgsptV9pzYFNWCbJftieptVg6k,1961
29
+ acontext/types/__init__.py,sha256=L6g545qLolIVoo3ltlsOeZOr8T72lTrg9bOK-q1Mw0c,1909
30
+ acontext/types/block.py,sha256=CzKByunk642rWXNNnh8cx67UzKLKDAxODmC_whwjP90,1078
31
+ acontext/types/common.py,sha256=5kLwzszlIofz8qZ9-Wj_zcBBiF22mAWgH9uWPkcgWCE,327
32
+ acontext/types/disk.py,sha256=nMjyXLUre4Xuu_YfBbzzdRQDRxB8qX1Zx9LsNqGCi9E,2223
33
+ acontext/types/session.py,sha256=WIaTiiAw8OujeSnk18Vy_Fn_AffW60pfs-unlPXYuT8,11076
34
+ acontext/types/skill.py,sha256=qBDNysW9ptKX6RcMiZd4PfwWwvcYCzj_dC-6RbXqyx4,2531
35
+ acontext/types/space.py,sha256=9BkGBYGeQDVwYTmPLoIjMY-IUdQzjrt8I7CXca2_5Vc,2600
36
+ acontext/types/tool.py,sha256=-mVn-vgk2SENK0Ubt-ZgWFZxKa-ddABqcAgXQ69YY-E,805
37
+ acontext/types/user.py,sha256=JjE0xZDwUAs2BL741U7NINyyPAso64A1YmgMBPqSuvo,1331
38
+ acontext/uploads.py,sha256=6twnqQOY_eerNuEjeSKsE_3S0IfJUiczXtAy4aXqDl8,1379
39
+ acontext-0.0.17.dist-info/WHEEL,sha256=eycQt0QpYmJMLKpE3X9iDk8R04v2ZF0x82ogq-zP6bQ,79
40
+ acontext-0.0.17.dist-info/METADATA,sha256=Z6rVfzFv3K3o_hSyymhrvdQU2ZGZ20GEwQPjPkNR7Rw,859
41
+ acontext-0.0.17.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.22
2
+ Generator: uv 0.9.24
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,33 +0,0 @@
1
- acontext/__init__.py,sha256=jAgRawWIjyMd6g3gq7Xm_3vNB31cPj8rMFPO4LGQKdM,1027
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=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- acontext/agent/base.py,sha256=kN2KzV6fOlvmMSi_0yu2QqwVLtHh09TznAy_SDtC8iM,2998
6
- acontext/agent/disk.py,sha256=d9sOggIs4da7niB9TaE0ab82_7l0O5n08eOcQxcaYRs,12623
7
- acontext/async_client.py,sha256=mfyR-WVy_LEOXjrkTcXLNaPDC5euaZ9zFI_5e1gapGs,8153
8
- acontext/client.py,sha256=jFr5-Q8obdcZBamUNtY3fCklpOJiNiIKLzEApTmbnTg,7920
9
- acontext/client_types.py,sha256=uVBWzLbZyXrqkljG49ojdQL_xX6N3n_HGt4Bs_TEE48,987
10
- acontext/errors.py,sha256=W9i7_t46q9kbci3XAyZiyQhS154d4R9rSon3na-gjgs,1296
11
- acontext/messages.py,sha256=oNRZStfhcPFt6DPOfs_-Q7R1Xui6dOMr3wmpmC8pzvE,2310
12
- acontext/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- acontext/resources/__init__.py,sha256=KSVQ3YJ-wuU6OWGWJ47gDGbjjetP102aEsVSR8JUb_4,721
14
- acontext/resources/async_blocks.py,sha256=e_iJpgcAdwS2tXQ16MMCnySlddp5JV3BadN_EyqZSF4,5555
15
- acontext/resources/async_disks.py,sha256=2JjLpUkz5YZEkLt_jCts_khTG_b7lvf4cUMfoaJcnI8,6471
16
- acontext/resources/async_sessions.py,sha256=660qEvz9aG_Nn3XiKKj9AbWizMstHhUsQN2m3W8ZGJ4,13357
17
- acontext/resources/async_spaces.py,sha256=5lIZjI8GmgoMBcftAMD2vDj2FmbLZ6pi1-yNCWKv4cM,6408
18
- acontext/resources/async_tools.py,sha256=RbGaF2kX65Mun-q-Fp5H1J8waWTLIdCOfbdY19jpn1o,1091
19
- acontext/resources/blocks.py,sha256=HJdAy5HdyTcHCYCPmqNdvApYKZ6aWs-ORIi_wQt3TUM,5447
20
- acontext/resources/disks.py,sha256=BjVhVXoujHWhg6L0TG9GmW9HLTTldJYEPxCbuppRkc4,6336
21
- acontext/resources/sessions.py,sha256=9qfEMVmiJGmhAqKYQ89yYa14SDZ-dyol1-rPXU3wSI0,13441
22
- acontext/resources/spaces.py,sha256=LJP9krygZGdktMDtYGudCpk7yBxe_4v34QLk3SdejwQ,6267
23
- acontext/resources/tools.py,sha256=II_185B0HYKSP43hizE6C1zs7kjkkPLKihuEG8s-DRY,1046
24
- acontext/types/__init__.py,sha256=QWNLmdSnLE2b5XRXxnI2OKnHVdKQPJH0nJvvOYwhB1o,1448
25
- acontext/types/block.py,sha256=CzKByunk642rWXNNnh8cx67UzKLKDAxODmC_whwjP90,1078
26
- acontext/types/disk.py,sha256=g9u3rgCh05rK-gay19NUi-WyzI5Vt1GQwcyKv-5TSC4,2361
27
- acontext/types/session.py,sha256=H_n4vZJ02ZO5flqGZ8R5AYVSScxScf2r7UgsN5LRIa0,9965
28
- acontext/types/space.py,sha256=uxbPrOHYpsntPHqhMCLQ2KovM7BngHC5Q2j7qexVrN8,2537
29
- acontext/types/tool.py,sha256=-mVn-vgk2SENK0Ubt-ZgWFZxKa-ddABqcAgXQ69YY-E,805
30
- acontext/uploads.py,sha256=6twnqQOY_eerNuEjeSKsE_3S0IfJUiczXtAy4aXqDl8,1379
31
- acontext-0.0.14.dist-info/WHEEL,sha256=KSLUh82mDPEPk0Bx0ScXlWL64bc8KmzIPNcpQZFV-6E,79
32
- acontext-0.0.14.dist-info/METADATA,sha256=sm1g1hhGbW15feWubCtcNkjgK5Ja1S_-xr1lIbXvmjU,859
33
- acontext-0.0.14.dist-info/RECORD,,