paddockai 0.0.1__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 (29) hide show
  1. paddockai-0.0.1/PKG-INFO +43 -0
  2. paddockai-0.0.1/README.md +28 -0
  3. paddockai-0.0.1/pyproject.toml +40 -0
  4. paddockai-0.0.1/src/paddockai/__init__.py +40 -0
  5. paddockai-0.0.1/src/paddockai/_async_client.py +868 -0
  6. paddockai-0.0.1/src/paddockai/_client.py +854 -0
  7. paddockai-0.0.1/src/paddockai/_credentials.py +57 -0
  8. paddockai-0.0.1/src/paddockai/_errors.py +70 -0
  9. paddockai-0.0.1/src/paddockai/_gen/__init__.py +2 -0
  10. paddockai-0.0.1/src/paddockai/_gen/agent_schema.py +259 -0
  11. paddockai-0.0.1/src/paddockai/_gen/apikey_schema.py +117 -0
  12. paddockai-0.0.1/src/paddockai/_gen/common_schema.py +57 -0
  13. paddockai-0.0.1/src/paddockai/_gen/connector_schema.py +658 -0
  14. paddockai-0.0.1/src/paddockai/_gen/event_schema.py +873 -0
  15. paddockai-0.0.1/src/paddockai/_gen/message_schema.py +192 -0
  16. paddockai-0.0.1/src/paddockai/_gen/model_schema.py +154 -0
  17. paddockai-0.0.1/src/paddockai/_gen/session_schema.py +108 -0
  18. paddockai-0.0.1/src/paddockai/_gen/template_schema.py +195 -0
  19. paddockai-0.0.1/src/paddockai/_gen/tools_schema.py +337 -0
  20. paddockai-0.0.1/src/paddockai/_gen/turn_schema.py +144 -0
  21. paddockai-0.0.1/src/paddockai/_pagination.py +56 -0
  22. paddockai-0.0.1/src/paddockai/_requests.py +40 -0
  23. paddockai-0.0.1/src/paddockai/_sse.py +81 -0
  24. paddockai-0.0.1/src/paddockai/_stream.py +231 -0
  25. paddockai-0.0.1/src/paddockai/_timestamp.py +23 -0
  26. paddockai-0.0.1/src/paddockai/_transport.py +217 -0
  27. paddockai-0.0.1/src/paddockai/_version.py +1 -0
  28. paddockai-0.0.1/src/paddockai/py.typed +0 -0
  29. paddockai-0.0.1/src/paddockai/types.py +557 -0
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.3
2
+ Name: paddockai
3
+ Version: 0.0.1
4
+ Summary: The Python server SDK for paddock: agents, sessions, events, and streams.
5
+ Requires-Python: >=3.10
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.10
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Requires-Dist: httpx (>=0.27,<1)
12
+ Requires-Dist: pydantic (>=2.7,<3)
13
+ Description-Content-Type: text/markdown
14
+
15
+ # paddockai
16
+
17
+ The Python server SDK for paddock: templates, agents, sessions, events, and streams.
18
+
19
+ ```python
20
+ from paddockai import Paddock
21
+
22
+ client = Paddock() # PADDOCK_API_KEY, PADDOCK_BASE_URL
23
+ client.templates.create("./agents/code-maintainer/template.yaml")
24
+ agent = client.agents.create(template="code-maintainer@3", metadata={"teamId": "t_42"})
25
+ session = agent.sessions.create(cwd="repos/web")
26
+ session.send("CI failed on main; fix it.")
27
+ token = session.create_token(ttl=3600) # for the browser
28
+
29
+ with session.stream(after=0) as events:
30
+ for event in events:
31
+ if event.event == "message" and event.data.message.kind == "tool_call":
32
+ print(event.data.message.tool_call.tool)
33
+ ```
34
+
35
+ `AsyncPaddock` has the same methods as coroutines; its lists and streams are async iterators
36
+ (`async with session.stream() as events: async for event in events: ...`).
37
+
38
+ Idempotent requests are retried with capped backoff (`max_retries`, default 2); a `POST` is
39
+ never retried. The stream reconnects on its own and resumes after the highest `seq` it
40
+ yielded. A non-2xx response raises `paddockai.PaddockError` with `status`, `code`, `message`,
41
+ `details`, and `request_id`; no response raises `paddockai.ConnectionError` (or its subclass
42
+ `paddockai.TimeoutError`).
43
+
@@ -0,0 +1,28 @@
1
+ # paddockai
2
+
3
+ The Python server SDK for paddock: templates, agents, sessions, events, and streams.
4
+
5
+ ```python
6
+ from paddockai import Paddock
7
+
8
+ client = Paddock() # PADDOCK_API_KEY, PADDOCK_BASE_URL
9
+ client.templates.create("./agents/code-maintainer/template.yaml")
10
+ agent = client.agents.create(template="code-maintainer@3", metadata={"teamId": "t_42"})
11
+ session = agent.sessions.create(cwd="repos/web")
12
+ session.send("CI failed on main; fix it.")
13
+ token = session.create_token(ttl=3600) # for the browser
14
+
15
+ with session.stream(after=0) as events:
16
+ for event in events:
17
+ if event.event == "message" and event.data.message.kind == "tool_call":
18
+ print(event.data.message.tool_call.tool)
19
+ ```
20
+
21
+ `AsyncPaddock` has the same methods as coroutines; its lists and streams are async iterators
22
+ (`async with session.stream() as events: async for event in events: ...`).
23
+
24
+ Idempotent requests are retried with capped backoff (`max_retries`, default 2); a `POST` is
25
+ never retried. The stream reconnects on its own and resumes after the highest `seq` it
26
+ yielded. A non-2xx response raises `paddockai.PaddockError` with `status`, `code`, `message`,
27
+ `details`, and `request_id`; no response raises `paddockai.ConnectionError` (or its subclass
28
+ `paddockai.TimeoutError`).
@@ -0,0 +1,40 @@
1
+ [project]
2
+ name = "paddockai"
3
+ version = "0.0.1"
4
+ description = "The Python server SDK for paddock: agents, sessions, events, and streams."
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ dependencies = [
8
+ "httpx (>=0.27,<1)",
9
+ "pydantic (>=2.7,<3)",
10
+ ]
11
+
12
+ [tool.poetry]
13
+ packages = [{ include = "paddockai", from = "src" }]
14
+
15
+ [tool.poetry.group.dev.dependencies]
16
+ black = "^25.1"
17
+ mypy = "^1.15"
18
+ pytest = "^8.3"
19
+ anyio = "^4.4"
20
+ datamodel-code-generator = { version = "0.96.0", python = ">=3.11,<3.14" }
21
+
22
+ [build-system]
23
+ requires = ["poetry-core>=2.0,<3"]
24
+ build-backend = "poetry.core.masonry.api"
25
+
26
+ [tool.black]
27
+ line-length = 100
28
+ target-version = ["py310"]
29
+
30
+ [tool.pytest.ini_options]
31
+ testpaths = ["tests"]
32
+ markers = [
33
+ "integration: needs a running paddock stack; set PADDOCK_INTEGRATION_URL to run",
34
+ ]
35
+
36
+ [tool.mypy]
37
+ strict = true
38
+ python_version = "3.10"
39
+ plugins = ["pydantic.mypy"]
40
+ files = ["src/paddockai"]
@@ -0,0 +1,40 @@
1
+ """paddock: the Python server SDK (design 009#python-sdk).
2
+
3
+ from paddockai import Paddock
4
+
5
+ client = Paddock() # PADDOCK_API_KEY
6
+ agent = client.agents.create(template="code-maintainer@3")
7
+ session = agent.sessions.create(cwd="repos/web")
8
+ session.send("CI failed on main; fix it.")
9
+ with session.stream(after=0) as events:
10
+ for event in events:
11
+ ...
12
+ """
13
+
14
+ from . import types
15
+ from ._async_client import AsyncAgent, AsyncConnector, AsyncPaddock, AsyncSession
16
+ from ._client import Agent, Connector, Paddock, Session
17
+ from ._errors import ConnectionError, PaddockError, TimeoutError
18
+ from ._pagination import AsyncPage, SyncPage
19
+ from ._stream import AsyncStream, Stream
20
+ from ._version import __version__
21
+
22
+ __all__ = [
23
+ "Agent",
24
+ "AsyncAgent",
25
+ "AsyncConnector",
26
+ "AsyncPage",
27
+ "AsyncPaddock",
28
+ "AsyncSession",
29
+ "AsyncStream",
30
+ "ConnectionError",
31
+ "Connector",
32
+ "Paddock",
33
+ "PaddockError",
34
+ "Session",
35
+ "Stream",
36
+ "SyncPage",
37
+ "TimeoutError",
38
+ "__version__",
39
+ "types",
40
+ ]