pi-agent-python-sdk 0.2.3__tar.gz → 0.2.5__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.
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/CHANGELOG.md +31 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/PKG-INFO +30 -24
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/README.md +27 -21
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/pyproject.toml +3 -3
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/_launch.py +2 -1
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/client.py +2 -1
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/types.py +44 -2
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/.gitignore +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/LICENSE +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/__init__.py +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/_collections.py +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/_events.py +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/_observation.py +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/_runs.py +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/_transport.py +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/_usage.py +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/errors.py +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/py.typed +0 -0
- {pi_agent_python_sdk-0.2.3 → pi_agent_python_sdk-0.2.5}/src/pi_agent/sync.py +0 -0
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.2.5
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Advance the reviewed Pi baseline from 1.0.0 to 1.3.0; keep the 0.85.1 minimum.
|
|
10
|
+
Strict-version users must align their separately installed runtime with 1.3.0.
|
|
11
|
+
- Annotate Pi timing, malformed tool arguments, per-thinking-level sampling,
|
|
12
|
+
and settlement abort metadata. `AgentSettledEvent` now represents settlement
|
|
13
|
+
separately from `EmptySessionEvent`.
|
|
14
|
+
- Resolve and validate the upstream version tag when npm omits `gitHead`, and
|
|
15
|
+
fingerprint the extracted model/provider schemas without approving source drift.
|
|
16
|
+
- Recognize Pi's `--no-mcp` flag and document its changed tool-filtering and
|
|
17
|
+
Azure provider behavior.
|
|
18
|
+
|
|
19
|
+
## 0.2.4
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Describe Pi 1.0.0 input dispositions, assistant thinking levels, nested tool
|
|
24
|
+
call records, parent tool-call IDs and model type in the typed wire annotations.
|
|
25
|
+
New fields remain optional where older supported runtimes omit them.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Update the tested Pi runtime from 0.87.0 to 1.0.0, retaining 0.85.1 as the minimum.
|
|
30
|
+
Python `prompt`, `steer` and `follow_up` still return `None`; use `request()`
|
|
31
|
+
for the response envelope and `data.disposition`.
|
|
32
|
+
- Refresh the TypeScript behavior contract and extend parity coverage for
|
|
33
|
+
prompt streaming behavior and Pi 1.0.0 metadata.
|
|
34
|
+
- Update development tools and pinned CI actions.
|
|
35
|
+
|
|
5
36
|
## 0.2.3
|
|
6
37
|
|
|
7
38
|
### Added
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pi-agent-python-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: Typed async and synchronous Python clients for Pi's agent RPC runtime
|
|
5
5
|
Project-URL: Homepage, https://github.com/cheenulabs/pi-agent-python-sdk
|
|
6
|
-
Project-URL: Documentation, https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.
|
|
6
|
+
Project-URL: Documentation, https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.5/docs
|
|
7
7
|
Project-URL: Issues, https://github.com/cheenulabs/pi-agent-python-sdk/issues
|
|
8
|
-
Project-URL: Changelog, https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
8
|
+
Project-URL: Changelog, https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/CHANGELOG.md
|
|
9
9
|
Author: cheenulabs
|
|
10
10
|
License-Expression: MIT
|
|
11
11
|
License-File: LICENSE
|
|
@@ -29,7 +29,7 @@ Description-Content-Type: text/markdown
|
|
|
29
29
|
|
|
30
30
|
<p align="center">
|
|
31
31
|
<a href="https://github.com/cheenulabs/pi-agent-python-sdk">
|
|
32
|
-
<img alt="Pi Agent Python SDK" src="https://raw.githubusercontent.com/cheenulabs/pi-agent-python-sdk/v0.2.
|
|
32
|
+
<img alt="Pi Agent Python SDK" src="https://raw.githubusercontent.com/cheenulabs/pi-agent-python-sdk/v0.2.5/docs/logo.svg" width="160">
|
|
33
33
|
</a>
|
|
34
34
|
</p>
|
|
35
35
|
|
|
@@ -59,6 +59,7 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
|
|
|
59
59
|
[Streaming](#streaming) · [Async](#async-usage) ·
|
|
60
60
|
[Configuration](#configuration) · [Thinking](#models-and-thinking) ·
|
|
61
61
|
[RPC](#rpc-access) · [Documentation](#documentation) ·
|
|
62
|
+
[Further reading](#further-reading) ·
|
|
62
63
|
[Troubleshooting](#troubleshooting) · [Support](#support)
|
|
63
64
|
|
|
64
65
|
## What you can do
|
|
@@ -77,8 +78,8 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
|
|
|
77
78
|
| Requirement | Notes |
|
|
78
79
|
| --- | --- |
|
|
79
80
|
| Python **3.11+** | Package metadata requires 3.11 or newer |
|
|
80
|
-
| Node.js **22.19.0+** | Required by Pi
|
|
81
|
-
| Pi **0.85.1+** | Minimum accepted version; **
|
|
81
|
+
| Node.js **22.19.0+** | Required by Pi 1.3.0 |
|
|
82
|
+
| Pi **0.85.1+** | Minimum accepted version; **1.3.0** is the tested baseline |
|
|
82
83
|
| Model provider | Required; configure with the Pi CLI (see Quick start) |
|
|
83
84
|
|
|
84
85
|
## Quick start
|
|
@@ -86,7 +87,7 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
|
|
|
86
87
|
Install Pi with Node.js **22.19.0 or newer** (pin matches the tested baseline):
|
|
87
88
|
|
|
88
89
|
```sh
|
|
89
|
-
npm install -g @earendil-works/pi-coding-agent@
|
|
90
|
+
npm install -g @earendil-works/pi-coding-agent@1.3.0
|
|
90
91
|
pi --version
|
|
91
92
|
```
|
|
92
93
|
|
|
@@ -315,18 +316,23 @@ the [command reference][commands] for every method.
|
|
|
315
316
|
| [RPC structure][rpc] | How the Python client maps to Pi's protocol |
|
|
316
317
|
| [Compatibility][compatibility] | Runtime versions and platform validation |
|
|
317
318
|
| [Examples][examples] | Runnable sync, async, streaming, sessions, steering, and UI examples |
|
|
318
|
-
| [Release notes][release] | Changes included in 0.2.
|
|
319
|
+
| [Release notes][release] | Changes included in 0.2.5 |
|
|
319
320
|
|
|
320
321
|
Examples use your configured Pi and may make provider calls. Development checks
|
|
321
322
|
use an isolated local test provider; see [CONTRIBUTING.md][contributing] for
|
|
322
323
|
setup and validation commands.
|
|
323
324
|
|
|
325
|
+
## Further reading
|
|
326
|
+
|
|
327
|
+
- [Pi Unchained](https://hasc.substack.com/p/pi-unchained) — why this SDK exists
|
|
328
|
+
and how Pi fits into Python workflows.
|
|
329
|
+
|
|
324
330
|
## Troubleshooting
|
|
325
331
|
|
|
326
332
|
| Symptom | What to check |
|
|
327
333
|
| --- | --- |
|
|
328
334
|
| `pi` not found / launch fails | Ensure the Pi CLI is on `PATH`, or pass `executable=` to the client |
|
|
329
|
-
| Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **
|
|
335
|
+
| Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **1.3.0** |
|
|
330
336
|
| No model / auth errors | Run `pi` once and complete provider setup |
|
|
331
337
|
| Unexpected file or command changes | Review Pi tool/extension settings before automation |
|
|
332
338
|
|
|
@@ -341,20 +347,20 @@ setup and validation commands.
|
|
|
341
347
|
[MIT][license]
|
|
342
348
|
|
|
343
349
|
[pypi]: https://pypi.org/project/pi-agent-python-sdk/
|
|
344
|
-
[release]: https://github.com/cheenulabs/pi-agent-python-sdk/releases/tag/v0.2.
|
|
345
|
-
[metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
346
|
-
[license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
347
|
-
[compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
348
|
-
[errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
349
|
-
[stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
350
|
-
[constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
351
|
-
[extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
352
|
-
[ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
353
|
-
[rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
354
|
-
[commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
355
|
-
[usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
356
|
-
[api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
357
|
-
[examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.
|
|
358
|
-
[contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
350
|
+
[release]: https://github.com/cheenulabs/pi-agent-python-sdk/releases/tag/v0.2.5
|
|
351
|
+
[metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/pyproject.toml
|
|
352
|
+
[license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/LICENSE
|
|
353
|
+
[compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/compatibility.md
|
|
354
|
+
[errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/errors.md
|
|
355
|
+
[stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/examples/stream.py
|
|
356
|
+
[constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/api.md#constructor-options
|
|
357
|
+
[extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/usage.md#using-your-own-extensions
|
|
358
|
+
[ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/examples/ui.py
|
|
359
|
+
[rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/rpc.md
|
|
360
|
+
[commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/api.md#all-33-rpc-commands
|
|
361
|
+
[usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/usage.md
|
|
362
|
+
[api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/api.md
|
|
363
|
+
[examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.5/examples
|
|
364
|
+
[contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/CONTRIBUTING.md
|
|
359
365
|
[issues]: https://github.com/cheenulabs/pi-agent-python-sdk/issues
|
|
360
366
|
[security]: https://github.com/cheenulabs/pi-agent-python-sdk/security/advisories/new
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://github.com/cheenulabs/pi-agent-python-sdk">
|
|
9
|
-
<img alt="Pi Agent Python SDK" src="https://raw.githubusercontent.com/cheenulabs/pi-agent-python-sdk/v0.2.
|
|
9
|
+
<img alt="Pi Agent Python SDK" src="https://raw.githubusercontent.com/cheenulabs/pi-agent-python-sdk/v0.2.5/docs/logo.svg" width="160">
|
|
10
10
|
</a>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
@@ -36,6 +36,7 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
|
|
|
36
36
|
[Streaming](#streaming) · [Async](#async-usage) ·
|
|
37
37
|
[Configuration](#configuration) · [Thinking](#models-and-thinking) ·
|
|
38
38
|
[RPC](#rpc-access) · [Documentation](#documentation) ·
|
|
39
|
+
[Further reading](#further-reading) ·
|
|
39
40
|
[Troubleshooting](#troubleshooting) · [Support](#support)
|
|
40
41
|
|
|
41
42
|
## What you can do
|
|
@@ -54,8 +55,8 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
|
|
|
54
55
|
| Requirement | Notes |
|
|
55
56
|
| --- | --- |
|
|
56
57
|
| Python **3.11+** | Package metadata requires 3.11 or newer |
|
|
57
|
-
| Node.js **22.19.0+** | Required by Pi
|
|
58
|
-
| Pi **0.85.1+** | Minimum accepted version; **
|
|
58
|
+
| Node.js **22.19.0+** | Required by Pi 1.3.0 |
|
|
59
|
+
| Pi **0.85.1+** | Minimum accepted version; **1.3.0** is the tested baseline |
|
|
59
60
|
| Model provider | Required; configure with the Pi CLI (see Quick start) |
|
|
60
61
|
|
|
61
62
|
## Quick start
|
|
@@ -63,7 +64,7 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
|
|
|
63
64
|
Install Pi with Node.js **22.19.0 or newer** (pin matches the tested baseline):
|
|
64
65
|
|
|
65
66
|
```sh
|
|
66
|
-
npm install -g @earendil-works/pi-coding-agent@
|
|
67
|
+
npm install -g @earendil-works/pi-coding-agent@1.3.0
|
|
67
68
|
pi --version
|
|
68
69
|
```
|
|
69
70
|
|
|
@@ -292,18 +293,23 @@ the [command reference][commands] for every method.
|
|
|
292
293
|
| [RPC structure][rpc] | How the Python client maps to Pi's protocol |
|
|
293
294
|
| [Compatibility][compatibility] | Runtime versions and platform validation |
|
|
294
295
|
| [Examples][examples] | Runnable sync, async, streaming, sessions, steering, and UI examples |
|
|
295
|
-
| [Release notes][release] | Changes included in 0.2.
|
|
296
|
+
| [Release notes][release] | Changes included in 0.2.5 |
|
|
296
297
|
|
|
297
298
|
Examples use your configured Pi and may make provider calls. Development checks
|
|
298
299
|
use an isolated local test provider; see [CONTRIBUTING.md][contributing] for
|
|
299
300
|
setup and validation commands.
|
|
300
301
|
|
|
302
|
+
## Further reading
|
|
303
|
+
|
|
304
|
+
- [Pi Unchained](https://hasc.substack.com/p/pi-unchained) — why this SDK exists
|
|
305
|
+
and how Pi fits into Python workflows.
|
|
306
|
+
|
|
301
307
|
## Troubleshooting
|
|
302
308
|
|
|
303
309
|
| Symptom | What to check |
|
|
304
310
|
| --- | --- |
|
|
305
311
|
| `pi` not found / launch fails | Ensure the Pi CLI is on `PATH`, or pass `executable=` to the client |
|
|
306
|
-
| Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **
|
|
312
|
+
| Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **1.3.0** |
|
|
307
313
|
| No model / auth errors | Run `pi` once and complete provider setup |
|
|
308
314
|
| Unexpected file or command changes | Review Pi tool/extension settings before automation |
|
|
309
315
|
|
|
@@ -318,20 +324,20 @@ setup and validation commands.
|
|
|
318
324
|
[MIT][license]
|
|
319
325
|
|
|
320
326
|
[pypi]: https://pypi.org/project/pi-agent-python-sdk/
|
|
321
|
-
[release]: https://github.com/cheenulabs/pi-agent-python-sdk/releases/tag/v0.2.
|
|
322
|
-
[metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
323
|
-
[license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
324
|
-
[compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
325
|
-
[errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
326
|
-
[stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
327
|
-
[constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
328
|
-
[extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
329
|
-
[ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
330
|
-
[rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
331
|
-
[commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
332
|
-
[usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
333
|
-
[api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
334
|
-
[examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.
|
|
335
|
-
[contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
327
|
+
[release]: https://github.com/cheenulabs/pi-agent-python-sdk/releases/tag/v0.2.5
|
|
328
|
+
[metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/pyproject.toml
|
|
329
|
+
[license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/LICENSE
|
|
330
|
+
[compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/compatibility.md
|
|
331
|
+
[errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/errors.md
|
|
332
|
+
[stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/examples/stream.py
|
|
333
|
+
[constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/api.md#constructor-options
|
|
334
|
+
[extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/usage.md#using-your-own-extensions
|
|
335
|
+
[ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/examples/ui.py
|
|
336
|
+
[rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/rpc.md
|
|
337
|
+
[commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/api.md#all-33-rpc-commands
|
|
338
|
+
[usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/usage.md
|
|
339
|
+
[api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/docs/api.md
|
|
340
|
+
[examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.5/examples
|
|
341
|
+
[contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/CONTRIBUTING.md
|
|
336
342
|
[issues]: https://github.com/cheenulabs/pi-agent-python-sdk/issues
|
|
337
343
|
[security]: https://github.com/cheenulabs/pi-agent-python-sdk/security/advisories/new
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pi-agent-python-sdk"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.5"
|
|
8
8
|
description = "Typed async and synchronous Python clients for Pi's agent RPC runtime"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -26,9 +26,9 @@ dependencies = []
|
|
|
26
26
|
|
|
27
27
|
[project.urls]
|
|
28
28
|
Homepage = "https://github.com/cheenulabs/pi-agent-python-sdk"
|
|
29
|
-
Documentation = "https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.
|
|
29
|
+
Documentation = "https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.5/docs"
|
|
30
30
|
Issues = "https://github.com/cheenulabs/pi-agent-python-sdk/issues"
|
|
31
|
-
Changelog = "https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.
|
|
31
|
+
Changelog = "https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.5/CHANGELOG.md"
|
|
32
32
|
|
|
33
33
|
[dependency-groups]
|
|
34
34
|
dev = [
|
|
@@ -13,7 +13,7 @@ from ._transport import _close_process_pipes, _wait_for_exit
|
|
|
13
13
|
from .errors import PiProcessError, PiVersionError
|
|
14
14
|
|
|
15
15
|
MINIMUM_PI_VERSION = "0.85.1"
|
|
16
|
-
TESTED_PI_VERSION = "
|
|
16
|
+
TESTED_PI_VERSION = "1.3.0"
|
|
17
17
|
|
|
18
18
|
# The client owns these options. In particular --print consumes an initial prompt.
|
|
19
19
|
_RESERVED = {
|
|
@@ -59,6 +59,7 @@ _VALUES = {
|
|
|
59
59
|
"--tui-mode",
|
|
60
60
|
}
|
|
61
61
|
_FLAGS = {
|
|
62
|
+
"--no-mcp",
|
|
62
63
|
"--no-tools",
|
|
63
64
|
"-nt",
|
|
64
65
|
"--no-builtin-tools",
|
|
@@ -759,7 +759,8 @@ class AsyncPiClient:
|
|
|
759
759
|
) -> None:
|
|
760
760
|
"""Return None after checked acceptance; handled commands may never start a run.
|
|
761
761
|
|
|
762
|
-
Raises PiCommandError on rejection. Use request() for the raw envelope
|
|
762
|
+
Raises PiCommandError on rejection. Use request() for the raw envelope,
|
|
763
|
+
including data.disposition when Pi provides it.
|
|
763
764
|
"""
|
|
764
765
|
fields: dict[str, Any] = {"message": message}
|
|
765
766
|
if images is not None:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Pi
|
|
1
|
+
"""Pi 1.3.0 wire annotations and small Python conveniences.
|
|
2
2
|
|
|
3
3
|
Wire fields retain Pi's spelling and remain ordinary dictionaries. These
|
|
4
4
|
annotations describe known shapes, not a recursive runtime validator: extensions
|
|
@@ -20,6 +20,8 @@ RawRecord: TypeAlias = dict[str, Any]
|
|
|
20
20
|
ThinkingLevel: TypeAlias = Literal["off", "minimal", "low", "medium", "high", "xhigh", "max"]
|
|
21
21
|
QueueMode: TypeAlias = Literal["all", "one-at-a-time"]
|
|
22
22
|
StreamingBehavior: TypeAlias = Literal["steer", "followUp"]
|
|
23
|
+
QueuedInputDisposition: TypeAlias = Literal["handled", "queued"]
|
|
24
|
+
PromptDisposition: TypeAlias = Literal["handled", "queued", "started"]
|
|
23
25
|
CompactionReason: TypeAlias = Literal["manual", "threshold", "overflow"]
|
|
24
26
|
StopReason: TypeAlias = Literal[
|
|
25
27
|
"pending", "stop", "length", "toolUse", "error", "aborted", "deferred"
|
|
@@ -52,6 +54,7 @@ class ToolCall(TypedDict):
|
|
|
52
54
|
arguments: JSONObject
|
|
53
55
|
thoughtSignature: NotRequired[str]
|
|
54
56
|
namespace: NotRequired[str]
|
|
57
|
+
argumentsError: NotRequired[str]
|
|
55
58
|
|
|
56
59
|
|
|
57
60
|
class UsageCost(TypedDict):
|
|
@@ -131,6 +134,7 @@ class AssistantMessage(TypedDict):
|
|
|
131
134
|
model: str
|
|
132
135
|
responseModel: NotRequired[str]
|
|
133
136
|
responseId: NotRequired[str]
|
|
137
|
+
thinkingLevel: NotRequired[ThinkingLevel]
|
|
134
138
|
providerThinkingLevel: NotRequired[str]
|
|
135
139
|
diagnostics: NotRequired[list[AssistantMessageDiagnostic]]
|
|
136
140
|
usage: Usage
|
|
@@ -140,6 +144,22 @@ class AssistantMessage(TypedDict):
|
|
|
140
144
|
rawStopReason: NotRequired[str]
|
|
141
145
|
endTurn: NotRequired[bool]
|
|
142
146
|
timestamp: float
|
|
147
|
+
durationMs: NotRequired[float]
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class NestedToolCallRecord(TypedDict):
|
|
151
|
+
id: str
|
|
152
|
+
name: str
|
|
153
|
+
arguments: NotRequired[JSONObject]
|
|
154
|
+
argumentsBytes: NotRequired[float]
|
|
155
|
+
status: Literal["ok", "error", "unfinished"]
|
|
156
|
+
durationMs: NotRequired[float]
|
|
157
|
+
error: NotRequired[str]
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class NestedToolCalls(TypedDict):
|
|
161
|
+
calls: list[NestedToolCallRecord]
|
|
162
|
+
complete: bool
|
|
143
163
|
|
|
144
164
|
|
|
145
165
|
class ToolResultMessage(TypedDict):
|
|
@@ -149,9 +169,11 @@ class ToolResultMessage(TypedDict):
|
|
|
149
169
|
content: list[TextContent | ImageContent]
|
|
150
170
|
details: NotRequired[JSONValue]
|
|
151
171
|
usage: NotRequired[Usage]
|
|
172
|
+
nestedCalls: NotRequired[NestedToolCalls]
|
|
152
173
|
addedToolNames: NotRequired[list[str]] # Legacy Pi 0.85.1 field.
|
|
153
174
|
isError: bool
|
|
154
175
|
timestamp: float
|
|
176
|
+
durationMs: NotRequired[float]
|
|
155
177
|
|
|
156
178
|
|
|
157
179
|
class BashExecutionMessage(TypedDict):
|
|
@@ -240,6 +262,7 @@ class ModelInputLimits(TypedDict, total=False):
|
|
|
240
262
|
|
|
241
263
|
|
|
242
264
|
class Model(TypedDict):
|
|
265
|
+
type: NotRequired[Literal["chat"]]
|
|
243
266
|
id: str
|
|
244
267
|
name: str
|
|
245
268
|
api: str
|
|
@@ -253,6 +276,7 @@ class Model(TypedDict):
|
|
|
253
276
|
contextWindow: float
|
|
254
277
|
maxTokens: float
|
|
255
278
|
samplingParams: NotRequired[JSONObject]
|
|
279
|
+
samplingParamsByThinkingLevel: NotRequired[dict[ThinkingLevel, JSONObject]]
|
|
256
280
|
headers: NotRequired[dict[str, str]]
|
|
257
281
|
compat: NotRequired[JSONObject]
|
|
258
282
|
promptCache: NotRequired[ModelPromptCache]
|
|
@@ -451,6 +475,14 @@ class QueueState(TypedDict):
|
|
|
451
475
|
followUp: list[str]
|
|
452
476
|
|
|
453
477
|
|
|
478
|
+
class PromptDispositionData(TypedDict):
|
|
479
|
+
disposition: PromptDisposition
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
class QueuedInputDispositionData(TypedDict):
|
|
483
|
+
disposition: QueuedInputDisposition
|
|
484
|
+
|
|
485
|
+
|
|
454
486
|
class SessionChangeResult(TypedDict):
|
|
455
487
|
cancelled: bool
|
|
456
488
|
|
|
@@ -688,7 +720,12 @@ AssistantMessageEvent: TypeAlias = (
|
|
|
688
720
|
|
|
689
721
|
|
|
690
722
|
class EmptySessionEvent(TypedDict):
|
|
691
|
-
type: Literal["agent_start", "
|
|
723
|
+
type: Literal["agent_start", "turn_start", "summarization_retry_finished"]
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
class AgentSettledEvent(TypedDict):
|
|
727
|
+
type: Literal["agent_settled"]
|
|
728
|
+
aborted: NotRequired[bool] # Absent on older supported runtimes.
|
|
692
729
|
|
|
693
730
|
|
|
694
731
|
class AgentEndEvent(TypedDict):
|
|
@@ -721,6 +758,7 @@ class ToolExecutionStartEvent(TypedDict):
|
|
|
721
758
|
toolCallId: str
|
|
722
759
|
toolName: str
|
|
723
760
|
args: JSONValue
|
|
761
|
+
parentToolCallId: NotRequired[str]
|
|
724
762
|
|
|
725
763
|
|
|
726
764
|
class ToolExecutionUpdateEvent(TypedDict):
|
|
@@ -729,6 +767,7 @@ class ToolExecutionUpdateEvent(TypedDict):
|
|
|
729
767
|
toolName: str
|
|
730
768
|
args: JSONValue
|
|
731
769
|
partialResult: JSONValue
|
|
770
|
+
parentToolCallId: NotRequired[str]
|
|
732
771
|
|
|
733
772
|
|
|
734
773
|
class ToolExecutionEndEvent(TypedDict):
|
|
@@ -737,6 +776,8 @@ class ToolExecutionEndEvent(TypedDict):
|
|
|
737
776
|
toolName: str
|
|
738
777
|
result: JSONValue
|
|
739
778
|
isError: bool
|
|
779
|
+
durationMs: NotRequired[float]
|
|
780
|
+
parentToolCallId: NotRequired[str]
|
|
740
781
|
|
|
741
782
|
|
|
742
783
|
class QueueUpdateEvent(QueueState):
|
|
@@ -806,6 +847,7 @@ class BashExecutionUpdateEvent(TypedDict):
|
|
|
806
847
|
|
|
807
848
|
SessionEvent: TypeAlias = (
|
|
808
849
|
EmptySessionEvent
|
|
850
|
+
| AgentSettledEvent
|
|
809
851
|
| AgentEndEvent
|
|
810
852
|
| TurnEndEvent
|
|
811
853
|
| MessageBoundaryEvent
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|