Skip to content

Commit 48e6946

Browse files
committed
fix(sdk,api,core): remove tool resources
1 parent 295bdcf commit 48e6946

40 files changed

Lines changed: 2097 additions & 3355 deletions

File tree

docs/api-reference/openapi.json

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,78 +1688,6 @@
16881688
} ]
16891689
}
16901690
},
1691-
"/tool/name" : {
1692-
"get" : {
1693-
"description" : "Get all tool names within a project",
1694-
"responses" : {
1695-
"200" : {
1696-
"content" : {
1697-
"application/json" : {
1698-
"schema" : {
1699-
"$ref" : "#/components/schemas/_tool_name_get_200_response"
1700-
}
1701-
}
1702-
},
1703-
"description" : "OK"
1704-
}
1705-
},
1706-
"security" : [ {
1707-
"BearerAuth" : [ ]
1708-
} ],
1709-
"summary" : "Get tool names",
1710-
"tags" : [ "tool" ],
1711-
"x-code-samples" : [ {
1712-
"label" : "Python",
1713-
"lang" : "python",
1714-
"source" : "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get all tool names\ntools = client.tools.list()\nfor tool in tools:\n print(f\"{tool.name}: {tool.sop_count} SOPs\")\n"
1715-
}, {
1716-
"label" : "JavaScript",
1717-
"lang" : "javascript",
1718-
"source" : "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get all tool names\nconst tools = await client.tools.list();\nfor (const tool of tools) {\n console.log(`${tool.name}: ${tool.sop_count} SOPs`);\n}\n"
1719-
} ]
1720-
},
1721-
"put" : {
1722-
"description" : "Rename one or more tool names within a project",
1723-
"requestBody" : {
1724-
"content" : {
1725-
"application/json" : {
1726-
"schema" : {
1727-
"$ref" : "#/components/schemas/handler.RenameToolNameReq"
1728-
}
1729-
}
1730-
},
1731-
"description" : "Tool rename request",
1732-
"required" : true
1733-
},
1734-
"responses" : {
1735-
"200" : {
1736-
"content" : {
1737-
"application/json" : {
1738-
"schema" : {
1739-
"$ref" : "#/components/schemas/_sandbox__sandbox_id__delete_200_response"
1740-
}
1741-
}
1742-
},
1743-
"description" : "OK"
1744-
}
1745-
},
1746-
"security" : [ {
1747-
"BearerAuth" : [ ]
1748-
} ],
1749-
"summary" : "Rename tool names",
1750-
"tags" : [ "tool" ],
1751-
"x-code-samples" : [ {
1752-
"label" : "Python",
1753-
"lang" : "python",
1754-
"source" : "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Rename tool names\nresult = client.tools.rename([\n {\"old_name\": \"old_tool_name\", \"new_name\": \"new_tool_name\"}\n])\nprint(result.status)\n"
1755-
}, {
1756-
"label" : "JavaScript",
1757-
"lang" : "javascript",
1758-
"source" : "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Rename tool names\nconst result = await client.tools.rename([\n { oldName: 'old_tool_name', newName: 'new_tool_name' }\n]);\nconsole.log(result.status);\n"
1759-
} ],
1760-
"x-codegen-request-body-name" : "payload"
1761-
}
1762-
},
17631691
"/user/ls" : {
17641692
"get" : {
17651693
"description" : "Get all users under a project. If limit is not provided or 0, all users will be returned.",
@@ -2040,19 +1968,6 @@
20401968
},
20411969
"type" : "object"
20421970
},
2043-
"handler.RenameToolNameReq" : {
2044-
"properties" : {
2045-
"rename" : {
2046-
"items" : {
2047-
"$ref" : "#/components/schemas/handler.ToolRenameItem"
2048-
},
2049-
"minItems" : 1,
2050-
"type" : "array"
2051-
}
2052-
},
2053-
"required" : [ "rename" ],
2054-
"type" : "object"
2055-
},
20561971
"handler.StoreMessageReq" : {
20571972
"properties" : {
20581973
"blob" : {
@@ -2075,18 +1990,6 @@
20751990
},
20761991
"type" : "object"
20771992
},
2078-
"handler.ToolRenameItem" : {
2079-
"properties" : {
2080-
"new_name" : {
2081-
"type" : "string"
2082-
},
2083-
"old_name" : {
2084-
"type" : "string"
2085-
}
2086-
},
2087-
"required" : [ "new_name", "old_name" ],
2088-
"type" : "object"
2089-
},
20901993
"handler.UpdateArtifactReq" : {
20911994
"properties" : {
20921995
"file_path" : {
@@ -2182,17 +2085,6 @@
21822085
},
21832086
"type" : "object"
21842087
},
2185-
"httpclient.ToolReferenceData" : {
2186-
"properties" : {
2187-
"name" : {
2188-
"type" : "string"
2189-
},
2190-
"sop_count" : {
2191-
"type" : "integer"
2192-
}
2193-
},
2194-
"type" : "object"
2195-
},
21962088
"model.AgentSkills" : {
21972089
"properties" : {
21982090
"created_at" : {
@@ -3025,21 +2917,6 @@
30252917
"type" : "object"
30262918
} ]
30272919
},
3028-
"_tool_name_get_200_response" : {
3029-
"allOf" : [ {
3030-
"$ref" : "#/components/schemas/serializer.Response"
3031-
}, {
3032-
"properties" : {
3033-
"data" : {
3034-
"items" : {
3035-
"$ref" : "#/components/schemas/httpclient.ToolReferenceData"
3036-
},
3037-
"type" : "array"
3038-
}
3039-
},
3040-
"type" : "object"
3041-
} ]
3042-
},
30432920
"_user_ls_get_200_response" : {
30442921
"allOf" : [ {
30452922
"$ref" : "#/components/schemas/serializer.Response"

src/client/acontext-py/src/acontext/async_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from .resources.async_disks import AsyncDisksAPI as AsyncDisksAPI
1616
from .resources.async_sandboxes import AsyncSandboxesAPI as AsyncSandboxesAPI
1717
from .resources.async_sessions import AsyncSessionsAPI as AsyncSessionsAPI
18-
from .resources.async_tools import AsyncToolsAPI as AsyncToolsAPI
1918
from .resources.async_skills import AsyncSkillsAPI as AsyncSkillsAPI
2019
from .resources.async_users import AsyncUsersAPI as AsyncUsersAPI
2120

@@ -107,7 +106,6 @@ def __init__(
107106
self.sessions = AsyncSessionsAPI(self)
108107
self.disks = AsyncDisksAPI(self)
109108
self.artifacts = self.disks.artifacts
110-
self.tools = AsyncToolsAPI(self)
111109
self.skills = AsyncSkillsAPI(self)
112110
self.users = AsyncUsersAPI(self)
113111
self.sandboxes = AsyncSandboxesAPI(self)

src/client/acontext-py/src/acontext/client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from .resources.disks import DisksAPI as DisksAPI
1616
from .resources.sandboxes import SandboxesAPI as SandboxesAPI
1717
from .resources.sessions import SessionsAPI as SessionsAPI
18-
from .resources.tools import ToolsAPI as ToolsAPI
1918
from .resources.skills import SkillsAPI as SkillsAPI
2019
from .resources.users import UsersAPI as UsersAPI
2120

@@ -107,7 +106,6 @@ def __init__(
107106
self.sessions = SessionsAPI(self)
108107
self.disks = DisksAPI(self)
109108
self.artifacts = self.disks.artifacts
110-
self.tools = ToolsAPI(self)
111109
self.skills = SkillsAPI(self)
112110
self.users = UsersAPI(self)
113111
self.sandboxes = SandboxesAPI(self)

src/client/acontext-py/src/acontext/resources/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
from .async_disks import AsyncDisksAPI, AsyncDiskArtifactsAPI
44
from .async_sandboxes import AsyncSandboxesAPI
55
from .async_sessions import AsyncSessionsAPI
6-
from .async_tools import AsyncToolsAPI
76
from .async_skills import AsyncSkillsAPI
87
from .async_users import AsyncUsersAPI
98
from .disks import DisksAPI, DiskArtifactsAPI
109
from .sandboxes import SandboxesAPI
1110
from .sessions import SessionsAPI
12-
from .tools import ToolsAPI
1311
from .skills import SkillsAPI
1412
from .users import UsersAPI
1513

@@ -18,14 +16,12 @@
1816
"DiskArtifactsAPI",
1917
"SandboxesAPI",
2018
"SessionsAPI",
21-
"ToolsAPI",
2219
"SkillsAPI",
2320
"UsersAPI",
2421
"AsyncDisksAPI",
2522
"AsyncDiskArtifactsAPI",
2623
"AsyncSandboxesAPI",
2724
"AsyncSessionsAPI",
28-
"AsyncToolsAPI",
2925
"AsyncSkillsAPI",
3026
"AsyncUsersAPI",
3127
]

src/client/acontext-py/src/acontext/resources/async_sandboxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
SandboxCommandOutput,
1010
SandboxRuntimeInfo,
1111
)
12-
from ..types.tool import FlagResponse
12+
from ..types.common import FlagResponse
1313

1414

1515
class AsyncSandboxesAPI:

src/client/acontext-py/src/acontext/resources/async_tools.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/client/acontext-py/src/acontext/resources/sandboxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
SandboxCommandOutput,
1010
SandboxRuntimeInfo,
1111
)
12-
from ..types.tool import FlagResponse
12+
from ..types.common import FlagResponse
1313

1414

1515
class SandboxesAPI:

src/client/acontext-py/src/acontext/resources/tools.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/client/acontext-py/src/acontext/types/__init__.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Type definitions for API responses."""
22

3-
from .common import FileContent
3+
from .common import FileContent, FlagResponse
44
from .disk import (
55
Artifact,
66
Disk,
@@ -22,11 +22,6 @@
2222
TaskData,
2323
TokenCounts,
2424
)
25-
from .tool import (
26-
FlagResponse,
27-
ToolReferenceData,
28-
ToolRenameItem,
29-
)
3025
from .skill import (
3126
FileInfo,
3227
GetSkillFileResp,
@@ -50,10 +45,12 @@
5045
)
5146

5247
__all__ = [
48+
# Common types
49+
"FileContent",
50+
"FlagResponse",
5351
# Disk types
5452
"Artifact",
5553
"Disk",
56-
"FileContent",
5754
"GetArtifactResp",
5855
"ListArtifactsResp",
5956
"ListDisksOutput",
@@ -70,10 +67,6 @@
7067
"Task",
7168
"TaskData",
7269
"TokenCounts",
73-
# Tool types
74-
"FlagResponse",
75-
"ToolReferenceData",
76-
"ToolRenameItem",
7770
# Skill types
7871
"FileInfo",
7972
"Skill",

src/client/acontext-py/src/acontext/types/common.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,10 @@ class FileContent(BaseModel):
99
type: str = Field(..., description="File content type: 'text', 'json', 'csv', or 'code'")
1010
raw: str = Field(..., description="Raw text content of the file")
1111

12+
13+
class FlagResponse(BaseModel):
14+
"""Response model for flag operations like kill sandbox."""
15+
16+
status: int = Field(..., description="Status code of the operation")
17+
errmsg: str = Field(..., description="Error message if any")
18+

0 commit comments

Comments
 (0)