splox 0.2.2__tar.gz → 0.2.3__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.
- {splox-0.2.2 → splox-0.2.3}/PKG-INFO +1 -1
- {splox-0.2.2 → splox-0.2.3}/pyproject.toml +1 -1
- {splox-0.2.2 → splox-0.2.3}/src/splox/__init__.py +1 -53
- {splox-0.2.2 → splox-0.2.3}/src/splox/_client.py +2 -24
- {splox-0.2.2 → splox-0.2.3}/src/splox/_mcp.py +12 -12
- {splox-0.2.2 → splox-0.2.3}/src/splox/_models.py +0 -554
- splox-0.2.3/src/splox/_resources.py +491 -0
- {splox-0.2.2 → splox-0.2.3}/src/splox/_transport.py +6 -29
- {splox-0.2.2 → splox-0.2.3}/tests/integration_test.py +5 -33
- {splox-0.2.2 → splox-0.2.3}/tests/integration_test_mcp.py +3 -3
- {splox-0.2.2 → splox-0.2.3}/tests/test_client.py +39 -156
- {splox-0.2.2 → splox-0.2.3}/tests/test_codemode_contract.py +29 -24
- {splox-0.2.2 → splox-0.2.3}/tests/test_models.py +0 -27
- {splox-0.2.2 → splox-0.2.3}/tests/test_runs.py +1 -1
- splox-0.2.2/src/splox/_resources.py +0 -1474
- splox-0.2.2/tests/integration_test_memory.py +0 -387
- {splox-0.2.2 → splox-0.2.3}/.github/workflows/publish.yml +0 -0
- {splox-0.2.2 → splox-0.2.3}/.github/workflows/test.yml +0 -0
- {splox-0.2.2 → splox-0.2.3}/.gitignore +0 -0
- {splox-0.2.2 → splox-0.2.3}/CHANGELOG.md +0 -0
- {splox-0.2.2 → splox-0.2.3}/LICENSE +0 -0
- {splox-0.2.2 → splox-0.2.3}/README.md +0 -0
- {splox-0.2.2 → splox-0.2.3}/src/splox/_ids.py +0 -0
- {splox-0.2.2 → splox-0.2.3}/src/splox/_interactions.py +0 -0
- {splox-0.2.2 → splox-0.2.3}/src/splox/_runs.py +0 -0
- {splox-0.2.2 → splox-0.2.3}/src/splox/exceptions.py +0 -0
- {splox-0.2.2 → splox-0.2.3}/src/splox/py.typed +0 -0
- {splox-0.2.2 → splox-0.2.3}/tests/__init__.py +0 -0
- {splox-0.2.2 → splox-0.2.3}/tests/integration_test_v2.py +0 -0
- {splox-0.2.2 → splox-0.2.3}/tests/test_exceptions.py +0 -0
- {splox-0.2.2 → splox-0.2.3}/tests/test_ids.py +0 -0
- {splox-0.2.2 → splox-0.2.3}/tests/test_sse.py +0 -0
|
@@ -3,25 +3,9 @@
|
|
|
3
3
|
from splox._client import AsyncSploxClient, SploxClient
|
|
4
4
|
from splox._ids import decode_id, encode_id
|
|
5
5
|
from splox._models import (
|
|
6
|
-
ActivityStats,
|
|
7
|
-
BalanceTransaction,
|
|
8
|
-
Chat,
|
|
9
|
-
ChatCompletion,
|
|
10
|
-
ChatCompletionChoice,
|
|
11
|
-
ChatCompletionMessage,
|
|
12
|
-
ChatCompletionUsage,
|
|
13
|
-
ChatHistoryResponse,
|
|
14
|
-
ChatListResponse,
|
|
15
|
-
ChatMessage,
|
|
16
|
-
ChatMessageContent,
|
|
17
6
|
ContentPart,
|
|
18
|
-
DailyActivity,
|
|
19
|
-
DailyActivityResponse,
|
|
20
7
|
Edge,
|
|
21
|
-
EndUserSecretsSummary,
|
|
22
8
|
EntryNodesResponse,
|
|
23
|
-
EventResponse,
|
|
24
|
-
GenerateSecretsLinkResponse,
|
|
25
9
|
Interaction,
|
|
26
10
|
InteractionPage,
|
|
27
11
|
InteractionResponse,
|
|
@@ -31,11 +15,6 @@ from splox._models import (
|
|
|
31
15
|
MCPConnectionListResponse,
|
|
32
16
|
MCPServerToolOption,
|
|
33
17
|
MCPServerToolsResponse,
|
|
34
|
-
MemoryActionResponse,
|
|
35
|
-
MemoryGetResponse,
|
|
36
|
-
MemoryInstance,
|
|
37
|
-
MemoryListResponse,
|
|
38
|
-
MemoryMessage,
|
|
39
18
|
Message,
|
|
40
19
|
MessagePage,
|
|
41
20
|
Node,
|
|
@@ -52,16 +31,11 @@ from splox._models import (
|
|
|
52
31
|
RunTreeNode,
|
|
53
32
|
RunUsage,
|
|
54
33
|
SSEEvent,
|
|
55
|
-
SecretActionResponse,
|
|
56
|
-
TransactionHistoryResponse,
|
|
57
|
-
TransactionPagination,
|
|
58
|
-
UserBalance,
|
|
59
34
|
Workflow,
|
|
60
35
|
WorkflowFull,
|
|
61
36
|
WorkflowListResponse,
|
|
62
37
|
WorkflowRequest,
|
|
63
38
|
WorkflowRequestFile,
|
|
64
|
-
WorkflowSecretMetadata,
|
|
65
39
|
WorkflowVersion,
|
|
66
40
|
WorkflowVersionListResponse,
|
|
67
41
|
TERMINAL_RUN_STATUSES,
|
|
@@ -96,24 +70,13 @@ __all__ = [
|
|
|
96
70
|
"encode_id",
|
|
97
71
|
"decode_id",
|
|
98
72
|
# v1 resources (workflows CRUD, chats, billing, memory, MCP, LLM)
|
|
99
|
-
"Chat",
|
|
100
|
-
"ChatHistoryResponse",
|
|
101
|
-
"ChatListResponse",
|
|
102
|
-
"ChatMessage",
|
|
103
|
-
"ChatMessageContent",
|
|
104
73
|
"Edge",
|
|
105
|
-
"EventResponse",
|
|
106
74
|
"MCPCatalogItem",
|
|
107
75
|
"MCPCatalogListResponse",
|
|
108
76
|
"MCPConnection",
|
|
109
77
|
"MCPConnectionListResponse",
|
|
110
78
|
"MCPServerToolOption",
|
|
111
79
|
"MCPServerToolsResponse",
|
|
112
|
-
"MemoryActionResponse",
|
|
113
|
-
"MemoryGetResponse",
|
|
114
|
-
"MemoryInstance",
|
|
115
|
-
"MemoryListResponse",
|
|
116
|
-
"MemoryMessage",
|
|
117
80
|
"Node",
|
|
118
81
|
"NodeExecution",
|
|
119
82
|
"Pagination",
|
|
@@ -126,25 +89,10 @@ __all__ = [
|
|
|
126
89
|
"WorkflowRequestFile",
|
|
127
90
|
"WorkflowVersion",
|
|
128
91
|
"WorkflowVersionListResponse",
|
|
129
|
-
"UserBalance",
|
|
130
|
-
"BalanceTransaction",
|
|
131
|
-
"TransactionPagination",
|
|
132
|
-
"TransactionHistoryResponse",
|
|
133
|
-
"ActivityStats",
|
|
134
|
-
"DailyActivity",
|
|
135
|
-
"DailyActivityResponse",
|
|
136
|
-
"EndUserSecretsSummary",
|
|
137
|
-
"GenerateSecretsLinkResponse",
|
|
138
|
-
"SecretActionResponse",
|
|
139
|
-
"WorkflowSecretMetadata",
|
|
140
92
|
"generate_connection_token",
|
|
141
93
|
"generate_connection_link",
|
|
142
|
-
"ChatCompletion",
|
|
143
|
-
"ChatCompletionChoice",
|
|
144
|
-
"ChatCompletionMessage",
|
|
145
|
-
"ChatCompletionUsage",
|
|
146
94
|
"notify",
|
|
147
95
|
"async_notify",
|
|
148
96
|
]
|
|
149
97
|
|
|
150
|
-
__version__ = "0.2.
|
|
98
|
+
__version__ = "0.2.3"
|
|
@@ -6,20 +6,8 @@ import os
|
|
|
6
6
|
from typing import Optional, Any
|
|
7
7
|
|
|
8
8
|
from splox._resources import (
|
|
9
|
-
AsyncChats,
|
|
10
|
-
AsyncEvents,
|
|
11
|
-
AsyncMemory,
|
|
12
9
|
AsyncWorkflows,
|
|
13
|
-
AsyncBilling,
|
|
14
|
-
AsyncLLM,
|
|
15
|
-
Billing,
|
|
16
|
-
Chats,
|
|
17
|
-
Events,
|
|
18
|
-
Memory,
|
|
19
10
|
Workflows,
|
|
20
|
-
LLM,
|
|
21
|
-
notify,
|
|
22
|
-
async_notify,
|
|
23
11
|
)
|
|
24
12
|
from splox._interactions import AsyncInteractions, Interactions
|
|
25
13
|
from splox._mcp import AsyncMCP, MCP
|
|
@@ -51,7 +39,7 @@ class SploxClient:
|
|
|
51
39
|
|
|
52
40
|
Args:
|
|
53
41
|
api_key: API token. Falls back to ``SPLOX_API_KEY`` env var.
|
|
54
|
-
base_url: API base URL. Falls back to ``SPLOX_BASE_URL`` env var, then ``https://splox.io/api
|
|
42
|
+
base_url: API base URL. Falls back to ``SPLOX_BASE_URL`` env var, then ``https://splox.io/api`` (the server API root; paths are versioned).
|
|
55
43
|
v2 endpoints (``/v2/...``) are resolved against the server origin.
|
|
56
44
|
timeout: Request timeout in seconds (default: 30).
|
|
57
45
|
"""
|
|
@@ -64,12 +52,7 @@ class SploxClient:
|
|
|
64
52
|
self.runs = Runs(self._transport)
|
|
65
53
|
self.interactions = Interactions(self._transport)
|
|
66
54
|
self.workflows = Workflows(self._transport)
|
|
67
|
-
self.chats = Chats(self._transport)
|
|
68
|
-
self.events = Events(self._transport)
|
|
69
|
-
self.billing = Billing(self._transport)
|
|
70
|
-
self.memory = Memory(self._transport)
|
|
71
55
|
self.mcp = MCP(self._transport)
|
|
72
|
-
self.llm = LLM(self._transport)
|
|
73
56
|
|
|
74
57
|
@staticmethod
|
|
75
58
|
def notify(webhook_url: str, data: Any) -> None:
|
|
@@ -111,7 +94,7 @@ class AsyncSploxClient:
|
|
|
111
94
|
|
|
112
95
|
Args:
|
|
113
96
|
api_key: API token. Falls back to ``SPLOX_API_KEY`` env var.
|
|
114
|
-
base_url: API base URL. Falls back to ``SPLOX_BASE_URL`` env var, then ``https://splox.io/api
|
|
97
|
+
base_url: API base URL. Falls back to ``SPLOX_BASE_URL`` env var, then ``https://splox.io/api`` (the server API root; paths are versioned).
|
|
115
98
|
v2 endpoints (``/v2/...``) are resolved against the server origin.
|
|
116
99
|
timeout: Request timeout in seconds (default: 30).
|
|
117
100
|
"""
|
|
@@ -124,12 +107,7 @@ class AsyncSploxClient:
|
|
|
124
107
|
self.runs = AsyncRuns(self._transport)
|
|
125
108
|
self.interactions = AsyncInteractions(self._transport)
|
|
126
109
|
self.workflows = AsyncWorkflows(self._transport)
|
|
127
|
-
self.chats = AsyncChats(self._transport)
|
|
128
|
-
self.events = AsyncEvents(self._transport)
|
|
129
|
-
self.billing = AsyncBilling(self._transport)
|
|
130
|
-
self.memory = AsyncMemory(self._transport)
|
|
131
110
|
self.mcp = AsyncMCP(self._transport)
|
|
132
|
-
self.llm = AsyncLLM(self._transport)
|
|
133
111
|
|
|
134
112
|
@staticmethod
|
|
135
113
|
async def notify(webhook_url: str, data: Any) -> None:
|
|
@@ -154,7 +154,7 @@ class MCP:
|
|
|
154
154
|
if featured:
|
|
155
155
|
params["featured"] = "true"
|
|
156
156
|
|
|
157
|
-
data = self._t.request("GET", "/mcp-catalog", params=params)
|
|
157
|
+
data = self._t.request("GET", "/v1/mcp-catalog", params=params)
|
|
158
158
|
return MCPCatalogListResponse.from_dict(data)
|
|
159
159
|
|
|
160
160
|
def get_catalog_item(self, item_id: str) -> MCPCatalogItem:
|
|
@@ -166,7 +166,7 @@ class MCP:
|
|
|
166
166
|
Returns:
|
|
167
167
|
MCPCatalogItem.
|
|
168
168
|
"""
|
|
169
|
-
data = self._t.request("GET", f"/mcp-catalog/{item_id}")
|
|
169
|
+
data = self._t.request("GET", f"/v1/mcp-catalog/{item_id}")
|
|
170
170
|
return MCPCatalogItem.from_dict(data.get("mcp_server", data))
|
|
171
171
|
|
|
172
172
|
# -- Connections --------------------------------------------------------
|
|
@@ -196,7 +196,7 @@ class MCP:
|
|
|
196
196
|
if end_user_id is not None:
|
|
197
197
|
params["end_user_id"] = end_user_id
|
|
198
198
|
|
|
199
|
-
data = self._t.request("GET", "/mcp-connections", params=params)
|
|
199
|
+
data = self._t.request("GET", "/v1/mcp-connections", params=params)
|
|
200
200
|
return MCPConnectionListResponse.from_dict(data)
|
|
201
201
|
|
|
202
202
|
def delete_connection(self, connection_id: str) -> None:
|
|
@@ -205,7 +205,7 @@ class MCP:
|
|
|
205
205
|
Args:
|
|
206
206
|
connection_id: UUID of the connection to delete.
|
|
207
207
|
"""
|
|
208
|
-
self._t.request("DELETE", f"/mcp-connections/{connection_id}")
|
|
208
|
+
self._t.request("DELETE", f"/v1/mcp-connections/{connection_id}")
|
|
209
209
|
|
|
210
210
|
def execute_tool(
|
|
211
211
|
self,
|
|
@@ -229,12 +229,12 @@ class MCP:
|
|
|
229
229
|
"tool_slug": tool_slug,
|
|
230
230
|
"args": args or {},
|
|
231
231
|
}
|
|
232
|
-
data = self._t.request("POST", "/mcp-tools/execute", json_body=payload)
|
|
232
|
+
data = self._t.request("POST", "/v1/runtime/mcp-tools/execute", json_body=payload)
|
|
233
233
|
return MCPExecuteToolResponse.from_dict(data)
|
|
234
234
|
|
|
235
235
|
def get_server_tools(self, mcp_server_id: str) -> MCPServerToolsResponse:
|
|
236
236
|
"""List tools for a caller-owned MCP server."""
|
|
237
|
-
data = self._t.request("GET", f"/user-mcp-servers/{mcp_server_id}/tools")
|
|
237
|
+
data = self._t.request("GET", f"/v1/user-mcp-servers/{mcp_server_id}/tools")
|
|
238
238
|
return MCPServerToolsResponse.from_dict(data)
|
|
239
239
|
|
|
240
240
|
# -- Token helpers (convenience wrappers) --------------------------------
|
|
@@ -309,7 +309,7 @@ class AsyncMCP:
|
|
|
309
309
|
if featured:
|
|
310
310
|
params["featured"] = "true"
|
|
311
311
|
|
|
312
|
-
data = await self._t.request("GET", "/mcp-catalog", params=params)
|
|
312
|
+
data = await self._t.request("GET", "/v1/mcp-catalog", params=params)
|
|
313
313
|
return MCPCatalogListResponse.from_dict(data)
|
|
314
314
|
|
|
315
315
|
async def get_catalog_item(self, item_id: str) -> MCPCatalogItem:
|
|
@@ -321,7 +321,7 @@ class AsyncMCP:
|
|
|
321
321
|
Returns:
|
|
322
322
|
MCPCatalogItem.
|
|
323
323
|
"""
|
|
324
|
-
data = await self._t.request("GET", f"/mcp-catalog/{item_id}")
|
|
324
|
+
data = await self._t.request("GET", f"/v1/mcp-catalog/{item_id}")
|
|
325
325
|
return MCPCatalogItem.from_dict(data.get("mcp_server", data))
|
|
326
326
|
|
|
327
327
|
# -- Connections --------------------------------------------------------
|
|
@@ -351,7 +351,7 @@ class AsyncMCP:
|
|
|
351
351
|
if end_user_id is not None:
|
|
352
352
|
params["end_user_id"] = end_user_id
|
|
353
353
|
|
|
354
|
-
data = await self._t.request("GET", "/mcp-connections", params=params)
|
|
354
|
+
data = await self._t.request("GET", "/v1/mcp-connections", params=params)
|
|
355
355
|
return MCPConnectionListResponse.from_dict(data)
|
|
356
356
|
|
|
357
357
|
async def delete_connection(self, connection_id: str) -> None:
|
|
@@ -360,7 +360,7 @@ class AsyncMCP:
|
|
|
360
360
|
Args:
|
|
361
361
|
connection_id: UUID of the connection to delete.
|
|
362
362
|
"""
|
|
363
|
-
await self._t.request("DELETE", f"/mcp-connections/{connection_id}")
|
|
363
|
+
await self._t.request("DELETE", f"/v1/mcp-connections/{connection_id}")
|
|
364
364
|
|
|
365
365
|
async def execute_tool(
|
|
366
366
|
self,
|
|
@@ -384,12 +384,12 @@ class AsyncMCP:
|
|
|
384
384
|
"tool_slug": tool_slug,
|
|
385
385
|
"args": args or {},
|
|
386
386
|
}
|
|
387
|
-
data = await self._t.request("POST", "/mcp-tools/execute", json_body=payload)
|
|
387
|
+
data = await self._t.request("POST", "/v1/runtime/mcp-tools/execute", json_body=payload)
|
|
388
388
|
return MCPExecuteToolResponse.from_dict(data)
|
|
389
389
|
|
|
390
390
|
async def get_server_tools(self, mcp_server_id: str) -> MCPServerToolsResponse:
|
|
391
391
|
"""List tools for a caller-owned MCP server."""
|
|
392
|
-
data = await self._t.request("GET", f"/user-mcp-servers/{mcp_server_id}/tools")
|
|
392
|
+
data = await self._t.request("GET", f"/v1/user-mcp-servers/{mcp_server_id}/tools")
|
|
393
393
|
return MCPServerToolsResponse.from_dict(data)
|
|
394
394
|
|
|
395
395
|
# -- Token helpers (convenience wrappers) --------------------------------
|