splox 0.2.2__tar.gz → 0.2.4__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.
Files changed (35) hide show
  1. {splox-0.2.2 → splox-0.2.4}/PKG-INFO +1 -1
  2. {splox-0.2.2 → splox-0.2.4}/pyproject.toml +1 -1
  3. {splox-0.2.2 → splox-0.2.4}/src/splox/__init__.py +20 -71
  4. {splox-0.2.2 → splox-0.2.4}/src/splox/_client.py +4 -28
  5. {splox-0.2.2 → splox-0.2.4}/src/splox/_mcp.py +12 -12
  6. {splox-0.2.2 → splox-0.2.4}/src/splox/_models.py +236 -796
  7. splox-0.2.4/src/splox/_resources.py +42 -0
  8. {splox-0.2.2 → splox-0.2.4}/src/splox/_transport.py +6 -29
  9. splox-0.2.4/src/splox/_workflows.py +222 -0
  10. splox-0.2.4/tests/integration_test.py +126 -0
  11. {splox-0.2.2 → splox-0.2.4}/tests/integration_test_mcp.py +3 -3
  12. {splox-0.2.2 → splox-0.2.4}/tests/test_client.py +39 -156
  13. {splox-0.2.2 → splox-0.2.4}/tests/test_codemode_contract.py +29 -24
  14. {splox-0.2.2 → splox-0.2.4}/tests/test_models.py +0 -27
  15. {splox-0.2.2 → splox-0.2.4}/tests/test_runs.py +1 -1
  16. splox-0.2.4/tests/test_workflows.py +388 -0
  17. splox-0.2.2/src/splox/_resources.py +0 -1474
  18. splox-0.2.2/tests/integration_test.py +0 -168
  19. splox-0.2.2/tests/integration_test_memory.py +0 -387
  20. {splox-0.2.2 → splox-0.2.4}/.github/workflows/publish.yml +0 -0
  21. {splox-0.2.2 → splox-0.2.4}/.github/workflows/test.yml +0 -0
  22. {splox-0.2.2 → splox-0.2.4}/.gitignore +0 -0
  23. {splox-0.2.2 → splox-0.2.4}/CHANGELOG.md +0 -0
  24. {splox-0.2.2 → splox-0.2.4}/LICENSE +0 -0
  25. {splox-0.2.2 → splox-0.2.4}/README.md +0 -0
  26. {splox-0.2.2 → splox-0.2.4}/src/splox/_ids.py +0 -0
  27. {splox-0.2.2 → splox-0.2.4}/src/splox/_interactions.py +0 -0
  28. {splox-0.2.2 → splox-0.2.4}/src/splox/_runs.py +0 -0
  29. {splox-0.2.2 → splox-0.2.4}/src/splox/exceptions.py +0 -0
  30. {splox-0.2.2 → splox-0.2.4}/src/splox/py.typed +0 -0
  31. {splox-0.2.2 → splox-0.2.4}/tests/__init__.py +0 -0
  32. {splox-0.2.2 → splox-0.2.4}/tests/integration_test_v2.py +0 -0
  33. {splox-0.2.2 → splox-0.2.4}/tests/test_exceptions.py +0 -0
  34. {splox-0.2.2 → splox-0.2.4}/tests/test_ids.py +0 -0
  35. {splox-0.2.2 → splox-0.2.4}/tests/test_sse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splox
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Official Python SDK for the Splox API — run workflows, manage chats, and monitor execution
5
5
  Project-URL: Homepage, https://splox.io
6
6
  Project-URL: Documentation, https://docs.splox.io
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "splox"
7
- version = "0.2.2"
7
+ version = "0.2.4"
8
8
  description = "Official Python SDK for the Splox API — run workflows, manage chats, and monitor execution"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -3,25 +3,12 @@
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
- Edge,
21
- EndUserSecretsSummary,
22
- EntryNodesResponse,
23
- EventResponse,
24
- GenerateSecretsLinkResponse,
7
+ GraphEdge,
8
+ GraphEdgeInput,
9
+ GraphNode,
10
+ GraphNodeInput,
11
+ GraphPosition,
25
12
  Interaction,
26
13
  InteractionPage,
27
14
  InteractionResponse,
@@ -31,19 +18,12 @@ from splox._models import (
31
18
  MCPConnectionListResponse,
32
19
  MCPServerToolOption,
33
20
  MCPServerToolsResponse,
34
- MemoryActionResponse,
35
- MemoryGetResponse,
36
- MemoryInstance,
37
- MemoryListResponse,
38
- MemoryMessage,
39
21
  Message,
40
22
  MessagePage,
41
- Node,
42
23
  NodeExecution,
43
24
  Output,
44
25
  OutputPage,
45
26
  PageInfo,
46
- Pagination,
47
27
  RunEvent,
48
28
  RunEventPage,
49
29
  RunFailure,
@@ -52,18 +32,12 @@ from splox._models import (
52
32
  RunTreeNode,
53
33
  RunUsage,
54
34
  SSEEvent,
55
- SecretActionResponse,
56
- TransactionHistoryResponse,
57
- TransactionPagination,
58
- UserBalance,
59
35
  Workflow,
60
- WorkflowFull,
61
- WorkflowListResponse,
36
+ WorkflowGraph,
37
+ WorkflowGraphUpdate,
38
+ WorkflowPage,
62
39
  WorkflowRequest,
63
40
  WorkflowRequestFile,
64
- WorkflowSecretMetadata,
65
- WorkflowVersion,
66
- WorkflowVersionListResponse,
67
41
  TERMINAL_RUN_STATUSES,
68
42
  )
69
43
  from splox._mcp import generate_connection_token, generate_connection_link
@@ -95,56 +69,31 @@ __all__ = [
95
69
  "TERMINAL_RUN_STATUSES",
96
70
  "encode_id",
97
71
  "decode_id",
98
- # v1 resources (workflows CRUD, chats, billing, memory, MCP, LLM)
99
- "Chat",
100
- "ChatHistoryResponse",
101
- "ChatListResponse",
102
- "ChatMessage",
103
- "ChatMessageContent",
104
- "Edge",
105
- "EventResponse",
72
+ # v2 workflows (graph API)
73
+ "Workflow",
74
+ "WorkflowPage",
75
+ "WorkflowGraph",
76
+ "WorkflowGraphUpdate",
77
+ "GraphPosition",
78
+ "GraphNode",
79
+ "GraphEdge",
80
+ "GraphNodeInput",
81
+ "GraphEdgeInput",
82
+ # v1 resources (MCP, legacy stream events)
106
83
  "MCPCatalogItem",
107
84
  "MCPCatalogListResponse",
108
85
  "MCPConnection",
109
86
  "MCPConnectionListResponse",
110
87
  "MCPServerToolOption",
111
88
  "MCPServerToolsResponse",
112
- "MemoryActionResponse",
113
- "MemoryGetResponse",
114
- "MemoryInstance",
115
- "MemoryListResponse",
116
- "MemoryMessage",
117
- "Node",
118
89
  "NodeExecution",
119
- "Pagination",
120
90
  "SSEEvent",
121
- "EntryNodesResponse",
122
- "Workflow",
123
- "WorkflowFull",
124
- "WorkflowListResponse",
125
91
  "WorkflowRequest",
126
92
  "WorkflowRequestFile",
127
- "WorkflowVersion",
128
- "WorkflowVersionListResponse",
129
- "UserBalance",
130
- "BalanceTransaction",
131
- "TransactionPagination",
132
- "TransactionHistoryResponse",
133
- "ActivityStats",
134
- "DailyActivity",
135
- "DailyActivityResponse",
136
- "EndUserSecretsSummary",
137
- "GenerateSecretsLinkResponse",
138
- "SecretActionResponse",
139
- "WorkflowSecretMetadata",
140
93
  "generate_connection_token",
141
94
  "generate_connection_link",
142
- "ChatCompletion",
143
- "ChatCompletionChoice",
144
- "ChatCompletionMessage",
145
- "ChatCompletionUsage",
146
95
  "notify",
147
96
  "async_notify",
148
97
  ]
149
98
 
150
- __version__ = "0.2.2"
99
+ __version__ = "0.2.4"
@@ -5,26 +5,12 @@ from __future__ import annotations
5
5
  import os
6
6
  from typing import Optional, Any
7
7
 
8
- from splox._resources import (
9
- AsyncChats,
10
- AsyncEvents,
11
- AsyncMemory,
12
- AsyncWorkflows,
13
- AsyncBilling,
14
- AsyncLLM,
15
- Billing,
16
- Chats,
17
- Events,
18
- Memory,
19
- Workflows,
20
- LLM,
21
- notify,
22
- async_notify,
23
- )
8
+ from splox._resources import async_notify, notify
24
9
  from splox._interactions import AsyncInteractions, Interactions
25
10
  from splox._mcp import AsyncMCP, MCP
26
11
  from splox._runs import AsyncRuns, Runs
27
12
  from splox._transport import DEFAULT_TIMEOUT, AsyncTransport, SyncTransport
13
+ from splox._workflows import AsyncWorkflows, Workflows
28
14
 
29
15
 
30
16
  class SploxClient:
@@ -51,7 +37,7 @@ class SploxClient:
51
37
 
52
38
  Args:
53
39
  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/v1``.
40
+ 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
41
  v2 endpoints (``/v2/...``) are resolved against the server origin.
56
42
  timeout: Request timeout in seconds (default: 30).
57
43
  """
@@ -64,12 +50,7 @@ class SploxClient:
64
50
  self.runs = Runs(self._transport)
65
51
  self.interactions = Interactions(self._transport)
66
52
  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
53
  self.mcp = MCP(self._transport)
72
- self.llm = LLM(self._transport)
73
54
 
74
55
  @staticmethod
75
56
  def notify(webhook_url: str, data: Any) -> None:
@@ -111,7 +92,7 @@ class AsyncSploxClient:
111
92
 
112
93
  Args:
113
94
  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/v1``.
95
+ 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
96
  v2 endpoints (``/v2/...``) are resolved against the server origin.
116
97
  timeout: Request timeout in seconds (default: 30).
117
98
  """
@@ -124,12 +105,7 @@ class AsyncSploxClient:
124
105
  self.runs = AsyncRuns(self._transport)
125
106
  self.interactions = AsyncInteractions(self._transport)
126
107
  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
108
  self.mcp = AsyncMCP(self._transport)
132
- self.llm = AsyncLLM(self._transport)
133
109
 
134
110
  @staticmethod
135
111
  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) --------------------------------