pi-agent-python-sdk 0.2.3__py3-none-any.whl → 0.2.4__py3-none-any.whl

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/_launch.py CHANGED
@@ -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 = "0.87.0"
16
+ TESTED_PI_VERSION = "1.0.0"
17
17
 
18
18
  # The client owns these options. In particular --print consumes an initial prompt.
19
19
  _RESERVED = {
pi_agent/client.py CHANGED
@@ -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:
pi_agent/types.py CHANGED
@@ -1,4 +1,4 @@
1
- """Pi 0.87.0 wire annotations and small Python conveniences.
1
+ """Pi 1.0.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"
@@ -131,6 +133,7 @@ class AssistantMessage(TypedDict):
131
133
  model: str
132
134
  responseModel: NotRequired[str]
133
135
  responseId: NotRequired[str]
136
+ thinkingLevel: NotRequired[ThinkingLevel]
134
137
  providerThinkingLevel: NotRequired[str]
135
138
  diagnostics: NotRequired[list[AssistantMessageDiagnostic]]
136
139
  usage: Usage
@@ -142,6 +145,21 @@ class AssistantMessage(TypedDict):
142
145
  timestamp: float
143
146
 
144
147
 
148
+ class NestedToolCallRecord(TypedDict):
149
+ id: str
150
+ name: str
151
+ arguments: NotRequired[JSONObject]
152
+ argumentsBytes: NotRequired[float]
153
+ status: Literal["ok", "error", "unfinished"]
154
+ durationMs: NotRequired[float]
155
+ error: NotRequired[str]
156
+
157
+
158
+ class NestedToolCalls(TypedDict):
159
+ calls: list[NestedToolCallRecord]
160
+ complete: bool
161
+
162
+
145
163
  class ToolResultMessage(TypedDict):
146
164
  role: Literal["toolResult"]
147
165
  toolCallId: str
@@ -149,6 +167,7 @@ class ToolResultMessage(TypedDict):
149
167
  content: list[TextContent | ImageContent]
150
168
  details: NotRequired[JSONValue]
151
169
  usage: NotRequired[Usage]
170
+ nestedCalls: NotRequired[NestedToolCalls]
152
171
  addedToolNames: NotRequired[list[str]] # Legacy Pi 0.85.1 field.
153
172
  isError: bool
154
173
  timestamp: float
@@ -240,6 +259,7 @@ class ModelInputLimits(TypedDict, total=False):
240
259
 
241
260
 
242
261
  class Model(TypedDict):
262
+ type: NotRequired[Literal["chat"]]
243
263
  id: str
244
264
  name: str
245
265
  api: str
@@ -451,6 +471,14 @@ class QueueState(TypedDict):
451
471
  followUp: list[str]
452
472
 
453
473
 
474
+ class PromptDispositionData(TypedDict):
475
+ disposition: PromptDisposition
476
+
477
+
478
+ class QueuedInputDispositionData(TypedDict):
479
+ disposition: QueuedInputDisposition
480
+
481
+
454
482
  class SessionChangeResult(TypedDict):
455
483
  cancelled: bool
456
484
 
@@ -721,6 +749,7 @@ class ToolExecutionStartEvent(TypedDict):
721
749
  toolCallId: str
722
750
  toolName: str
723
751
  args: JSONValue
752
+ parentToolCallId: NotRequired[str]
724
753
 
725
754
 
726
755
  class ToolExecutionUpdateEvent(TypedDict):
@@ -729,6 +758,7 @@ class ToolExecutionUpdateEvent(TypedDict):
729
758
  toolName: str
730
759
  args: JSONValue
731
760
  partialResult: JSONValue
761
+ parentToolCallId: NotRequired[str]
732
762
 
733
763
 
734
764
  class ToolExecutionEndEvent(TypedDict):
@@ -737,6 +767,7 @@ class ToolExecutionEndEvent(TypedDict):
737
767
  toolName: str
738
768
  result: JSONValue
739
769
  isError: bool
770
+ parentToolCallId: NotRequired[str]
740
771
 
741
772
 
742
773
  class QueueUpdateEvent(QueueState):
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pi-agent-python-sdk
3
- Version: 0.2.3
3
+ Version: 0.2.4
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.3/docs
6
+ Project-URL: Documentation, https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.4/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.3/CHANGELOG.md
8
+ Project-URL: Changelog, https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/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.3/docs/logo.svg" width="160">
32
+ <img alt="Pi Agent Python SDK" src="https://raw.githubusercontent.com/cheenulabs/pi-agent-python-sdk/v0.2.4/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 0.87.0 |
81
- | Pi **0.85.1+** | Minimum accepted version; **0.87.0** is the tested baseline |
81
+ | Node.js **22.19.0+** | Required by Pi 1.0.0 |
82
+ | Pi **0.85.1+** | Minimum accepted version; **1.0.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@0.87.0
90
+ npm install -g @earendil-works/pi-coding-agent@1.0.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.3 |
319
+ | [Release notes][release] | Changes included in 0.2.4 |
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 **0.87.0** |
335
+ | Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **1.0.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.3
345
- [metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/pyproject.toml
346
- [license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/LICENSE
347
- [compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/compatibility.md
348
- [errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/errors.md
349
- [stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/examples/stream.py
350
- [constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/api.md#constructor-options
351
- [extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/usage.md#using-your-own-extensions
352
- [ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/examples/ui.py
353
- [rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/rpc.md
354
- [commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/api.md#all-33-rpc-commands
355
- [usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/usage.md
356
- [api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/api.md
357
- [examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.3/examples
358
- [contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/CONTRIBUTING.md
350
+ [release]: https://github.com/cheenulabs/pi-agent-python-sdk/releases/tag/v0.2.4
351
+ [metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/pyproject.toml
352
+ [license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/LICENSE
353
+ [compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/docs/compatibility.md
354
+ [errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/docs/errors.md
355
+ [stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/examples/stream.py
356
+ [constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/docs/api.md#constructor-options
357
+ [extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/docs/usage.md#using-your-own-extensions
358
+ [ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/examples/ui.py
359
+ [rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/docs/rpc.md
360
+ [commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/docs/api.md#all-33-rpc-commands
361
+ [usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/docs/usage.md
362
+ [api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/docs/api.md
363
+ [examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.4/examples
364
+ [contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.4/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
@@ -1,17 +1,17 @@
1
1
  pi_agent/__init__.py,sha256=Tb-KJ6Ur9H0WfwGdk5DkPQtTNKsLPeqcJx3lEh67gJI,1117
2
2
  pi_agent/_collections.py,sha256=1oSSh9u2OAXlVCu5t392go3wTQ2AruYm74prVfKBbgc,2174
3
3
  pi_agent/_events.py,sha256=fkt5KAM5esgdYHxzGX6fLXrTDv4jhzhcypPYy9z3HvM,5068
4
- pi_agent/_launch.py,sha256=4wzgrWdkKLWdnhIbZoTaVCP_XJM_1TbU0_iuu_esxRg,6965
4
+ pi_agent/_launch.py,sha256=c1MYnRsOG0ynrpADhUldTG7pgr4K3ytiqTbSFoFKBg8,6964
5
5
  pi_agent/_observation.py,sha256=GUe5VkoB5dFx1NY9VwAILjSRFa-th8O17OHMmcQ8q9Y,3297
6
6
  pi_agent/_runs.py,sha256=hxKhs5Oi8NLMdufJ72cdXy8tffdZ04XEb2xJzWfOiaQ,14219
7
7
  pi_agent/_transport.py,sha256=7mFkVjNSWBzvZw4zGwjtDNTe_FxF0Vxl0SD2z-58QuM,20040
8
8
  pi_agent/_usage.py,sha256=PxK0WPrnd0RKoH_J8psoTGNYaNg71gmOqQiaY6hH0aA,3051
9
- pi_agent/client.py,sha256=gsCV9CyDmjrUf21DpqX3TVKyHXMu5e_CXUzY4D1pcOE,43867
9
+ pi_agent/client.py,sha256=_Rw595kc0fu6cSFq7vEzfrIOF3U17vSgANuW8OtJKaM,43923
10
10
  pi_agent/errors.py,sha256=FJtF8jwfGITMp_MzNHbUKutYRrdx_BH8kJI7-17WbJk,2573
11
11
  pi_agent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  pi_agent/sync.py,sha256=dPyGHpJGmhg09u3QFrYdSJYGUB7_8_kupBxXCm8gu6o,33658
13
- pi_agent/types.py,sha256=WWwrAdb3zxaK8K91R1cx50Ub8x5n7AaIKi55WYod6gg,24289
14
- pi_agent_python_sdk-0.2.3.dist-info/METADATA,sha256=truhh5EMadGiGnfKGAyG3_7VBLkaFILAlufVV1bv2BU,13077
15
- pi_agent_python_sdk-0.2.3.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
16
- pi_agent_python_sdk-0.2.3.dist-info/licenses/LICENSE,sha256=VVC0d0PIT1GtbRUJluzmcIv-UYtsqsBfvWLFu5Qrbco,1067
17
- pi_agent_python_sdk-0.2.3.dist-info/RECORD,,
13
+ pi_agent/types.py,sha256=o50d-8kAQBhXYwK1zZgnRepZeP2g6i3u3rqgGW-FfV0,25186
14
+ pi_agent_python_sdk-0.2.4.dist-info/METADATA,sha256=LvORz9bYZSeWGo_dRCi1krLCMaxXu32cAZWGKjOLGEE,13257
15
+ pi_agent_python_sdk-0.2.4.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
16
+ pi_agent_python_sdk-0.2.4.dist-info/licenses/LICENSE,sha256=VVC0d0PIT1GtbRUJluzmcIv-UYtsqsBfvWLFu5Qrbco,1067
17
+ pi_agent_python_sdk-0.2.4.dist-info/RECORD,,