pi-agent-python-sdk 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.
Files changed (19) hide show
  1. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/CHANGELOG.md +13 -0
  2. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/PKG-INFO +40 -29
  3. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/README.md +37 -26
  4. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/pyproject.toml +3 -3
  5. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/_launch.py +1 -1
  6. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/types.py +37 -1
  7. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/.gitignore +0 -0
  8. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/LICENSE +0 -0
  9. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/__init__.py +0 -0
  10. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/_collections.py +0 -0
  11. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/_events.py +0 -0
  12. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/_observation.py +0 -0
  13. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/_runs.py +0 -0
  14. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/_transport.py +0 -0
  15. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/_usage.py +0 -0
  16. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/client.py +0 -0
  17. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/errors.py +0 -0
  18. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/py.typed +0 -0
  19. {pi_agent_python_sdk-0.2.2 → pi_agent_python_sdk-0.2.3}/src/pi_agent/sync.py +0 -0
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.2.3
6
+
7
+ ### Added
8
+
9
+ - Describe Pi 0.87.0 context-edit session entries and optional model image input
10
+ limits in the typed wire annotations. Both remain Pi-owned behavior; unknown
11
+ fields continue to pass through unchanged.
12
+
13
+ ### Changed
14
+
15
+ - Update the tested Pi runtime to 0.87.0, retaining 0.85.1 as the minimum.
16
+ - Refresh the README's quick start, branding, and demonstration video.
17
+
5
18
  ## 0.2.2
6
19
 
7
20
  ### Changed
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pi-agent-python-sdk
3
- Version: 0.2.2
3
+ Version: 0.2.3
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.2/docs
6
+ Project-URL: Documentation, https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.3/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.2/CHANGELOG.md
8
+ Project-URL: Changelog, https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/CHANGELOG.md
9
9
  Author: cheenulabs
10
10
  License-Expression: MIT
11
11
  License-File: LICENSE
@@ -23,17 +23,28 @@ Description-Content-Type: text/markdown
23
23
 
24
24
  # Pi Agent Python SDK
25
25
 
26
+ <p align="center">
27
+ <strong>Your terminal agent. Your Python API.</strong>
28
+ </p>
29
+
30
+ <p align="center">
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">
33
+ </a>
34
+ </p>
35
+
26
36
  [![PyPI](https://img.shields.io/pypi/v/pi-agent-python-sdk.svg?style=flat-square)][pypi]
27
37
  [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square)][metadata]
28
38
  [![MIT license](https://img.shields.io/badge/license-MIT-blue?style=flat-square)][license]
29
39
 
30
- **Use your installed Pi coding agent as a Python API. Stream responses,
31
- continue conversations, and control sessions from Python.**
40
+ [Pi](https://github.com/earendil-works/pi) is the coding agent that runs in your
41
+ terminal. This unofficial community SDK puts *your* Pi behind a typed sync and
42
+ async Python API — run prompts, stream events, and keep sessions going without
43
+ leaving Python.
32
44
 
33
- [Pi](https://github.com/earendil-works/pi) is an open-source coding agent that
34
- runs in your terminal. This unofficial community SDK launches the Pi CLI in RPC
35
- mode and exposes prompts, streaming events, and sessions through typed
36
- synchronous and asynchronous Python APIs.
45
+ <!-- Inline player: GitHub only auto-embeds bare user-attachments URLs
46
+ (repo-relative / raw / release URLs are stripped or become download links). -->
47
+ https://github.com/user-attachments/assets/c64dde3a-e812-42d4-a005-aa60df861e92
37
48
 
38
49
  ```python
39
50
  from pi_agent import PiClient
@@ -66,8 +77,8 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
66
77
  | Requirement | Notes |
67
78
  | --- | --- |
68
79
  | Python **3.11+** | Package metadata requires 3.11 or newer |
69
- | Node.js **22.19.0+** | Required by Pi 0.86.1 |
70
- | Pi **0.85.1+** | Minimum accepted version; **0.86.1** is the tested baseline |
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 |
71
82
  | Model provider | Required; configure with the Pi CLI (see Quick start) |
72
83
 
73
84
  ## Quick start
@@ -75,7 +86,7 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
75
86
  Install Pi with Node.js **22.19.0 or newer** (pin matches the tested baseline):
76
87
 
77
88
  ```sh
78
- npm install -g @earendil-works/pi-coding-agent@0.86.1
89
+ npm install -g @earendil-works/pi-coding-agent@0.87.0
79
90
  pi --version
80
91
  ```
81
92
 
@@ -304,7 +315,7 @@ the [command reference][commands] for every method.
304
315
  | [RPC structure][rpc] | How the Python client maps to Pi's protocol |
305
316
  | [Compatibility][compatibility] | Runtime versions and platform validation |
306
317
  | [Examples][examples] | Runnable sync, async, streaming, sessions, steering, and UI examples |
307
- | [Release notes][release] | Changes included in 0.2.2 |
318
+ | [Release notes][release] | Changes included in 0.2.3 |
308
319
 
309
320
  Examples use your configured Pi and may make provider calls. Development checks
310
321
  use an isolated local test provider; see [CONTRIBUTING.md][contributing] for
@@ -315,7 +326,7 @@ setup and validation commands.
315
326
  | Symptom | What to check |
316
327
  | --- | --- |
317
328
  | `pi` not found / launch fails | Ensure the Pi CLI is on `PATH`, or pass `executable=` to the client |
318
- | Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **0.86.1** |
329
+ | Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **0.87.0** |
319
330
  | No model / auth errors | Run `pi` once and complete provider setup |
320
331
  | Unexpected file or command changes | Review Pi tool/extension settings before automation |
321
332
 
@@ -330,20 +341,20 @@ setup and validation commands.
330
341
  [MIT][license]
331
342
 
332
343
  [pypi]: https://pypi.org/project/pi-agent-python-sdk/
333
- [release]: https://github.com/cheenulabs/pi-agent-python-sdk/releases/tag/v0.2.2
334
- [metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/pyproject.toml
335
- [license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/LICENSE
336
- [compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/compatibility.md
337
- [errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/errors.md
338
- [stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/examples/stream.py
339
- [constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/api.md#constructor-options
340
- [extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/usage.md#using-your-own-extensions
341
- [ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/examples/ui.py
342
- [rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/rpc.md
343
- [commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/api.md#all-33-rpc-commands
344
- [usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/usage.md
345
- [api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/api.md
346
- [examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.2/examples
347
- [contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/CONTRIBUTING.md
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
348
359
  [issues]: https://github.com/cheenulabs/pi-agent-python-sdk/issues
349
360
  [security]: https://github.com/cheenulabs/pi-agent-python-sdk/security/advisories/new
@@ -1,16 +1,27 @@
1
1
  # Pi Agent Python SDK
2
2
 
3
+ <p align="center">
4
+ <strong>Your terminal agent. Your Python API.</strong>
5
+ </p>
6
+
7
+ <p align="center">
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.3/docs/logo.svg" width="160">
10
+ </a>
11
+ </p>
12
+
3
13
  [![PyPI](https://img.shields.io/pypi/v/pi-agent-python-sdk.svg?style=flat-square)][pypi]
4
14
  [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square)][metadata]
5
15
  [![MIT license](https://img.shields.io/badge/license-MIT-blue?style=flat-square)][license]
6
16
 
7
- **Use your installed Pi coding agent as a Python API. Stream responses,
8
- continue conversations, and control sessions from Python.**
17
+ [Pi](https://github.com/earendil-works/pi) is the coding agent that runs in your
18
+ terminal. This unofficial community SDK puts *your* Pi behind a typed sync and
19
+ async Python API — run prompts, stream events, and keep sessions going without
20
+ leaving Python.
9
21
 
10
- [Pi](https://github.com/earendil-works/pi) is an open-source coding agent that
11
- runs in your terminal. This unofficial community SDK launches the Pi CLI in RPC
12
- mode and exposes prompts, streaming events, and sessions through typed
13
- synchronous and asynchronous Python APIs.
22
+ <!-- Inline player: GitHub only auto-embeds bare user-attachments URLs
23
+ (repo-relative / raw / release URLs are stripped or become download links). -->
24
+ https://github.com/user-attachments/assets/c64dde3a-e812-42d4-a005-aa60df861e92
14
25
 
15
26
  ```python
16
27
  from pi_agent import PiClient
@@ -43,8 +54,8 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
43
54
  | Requirement | Notes |
44
55
  | --- | --- |
45
56
  | Python **3.11+** | Package metadata requires 3.11 or newer |
46
- | Node.js **22.19.0+** | Required by Pi 0.86.1 |
47
- | Pi **0.85.1+** | Minimum accepted version; **0.86.1** is the tested baseline |
57
+ | Node.js **22.19.0+** | Required by Pi 0.87.0 |
58
+ | Pi **0.85.1+** | Minimum accepted version; **0.87.0** is the tested baseline |
48
59
  | Model provider | Required; configure with the Pi CLI (see Quick start) |
49
60
 
50
61
  ## Quick start
@@ -52,7 +63,7 @@ Requires an installed, configured Pi CLI — see [Prerequisites](#prerequisites)
52
63
  Install Pi with Node.js **22.19.0 or newer** (pin matches the tested baseline):
53
64
 
54
65
  ```sh
55
- npm install -g @earendil-works/pi-coding-agent@0.86.1
66
+ npm install -g @earendil-works/pi-coding-agent@0.87.0
56
67
  pi --version
57
68
  ```
58
69
 
@@ -281,7 +292,7 @@ the [command reference][commands] for every method.
281
292
  | [RPC structure][rpc] | How the Python client maps to Pi's protocol |
282
293
  | [Compatibility][compatibility] | Runtime versions and platform validation |
283
294
  | [Examples][examples] | Runnable sync, async, streaming, sessions, steering, and UI examples |
284
- | [Release notes][release] | Changes included in 0.2.2 |
295
+ | [Release notes][release] | Changes included in 0.2.3 |
285
296
 
286
297
  Examples use your configured Pi and may make provider calls. Development checks
287
298
  use an isolated local test provider; see [CONTRIBUTING.md][contributing] for
@@ -292,7 +303,7 @@ setup and validation commands.
292
303
  | Symptom | What to check |
293
304
  | --- | --- |
294
305
  | `pi` not found / launch fails | Ensure the Pi CLI is on `PATH`, or pass `executable=` to the client |
295
- | Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **0.86.1** |
306
+ | Version rejected | Upgrade to Pi **0.85.1+**; prefer the tested baseline **0.87.0** |
296
307
  | No model / auth errors | Run `pi` once and complete provider setup |
297
308
  | Unexpected file or command changes | Review Pi tool/extension settings before automation |
298
309
 
@@ -307,20 +318,20 @@ setup and validation commands.
307
318
  [MIT][license]
308
319
 
309
320
  [pypi]: https://pypi.org/project/pi-agent-python-sdk/
310
- [release]: https://github.com/cheenulabs/pi-agent-python-sdk/releases/tag/v0.2.2
311
- [metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/pyproject.toml
312
- [license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/LICENSE
313
- [compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/compatibility.md
314
- [errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/errors.md
315
- [stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/examples/stream.py
316
- [constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/api.md#constructor-options
317
- [extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/usage.md#using-your-own-extensions
318
- [ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/examples/ui.py
319
- [rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/rpc.md
320
- [commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/api.md#all-33-rpc-commands
321
- [usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/usage.md
322
- [api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/docs/api.md
323
- [examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.2/examples
324
- [contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.2/CONTRIBUTING.md
321
+ [release]: https://github.com/cheenulabs/pi-agent-python-sdk/releases/tag/v0.2.3
322
+ [metadata]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/pyproject.toml
323
+ [license]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/LICENSE
324
+ [compatibility]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/compatibility.md
325
+ [errors]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/errors.md
326
+ [stream-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/examples/stream.py
327
+ [constructor-options]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/api.md#constructor-options
328
+ [extensions]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/usage.md#using-your-own-extensions
329
+ [ui-example]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/examples/ui.py
330
+ [rpc]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/rpc.md
331
+ [commands]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/api.md#all-33-rpc-commands
332
+ [usage]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/usage.md
333
+ [api]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/docs/api.md
334
+ [examples]: https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.3/examples
335
+ [contributing]: https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/CONTRIBUTING.md
325
336
  [issues]: https://github.com/cheenulabs/pi-agent-python-sdk/issues
326
337
  [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.2"
7
+ version = "0.2.3"
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.2/docs"
29
+ Documentation = "https://github.com/cheenulabs/pi-agent-python-sdk/tree/v0.2.3/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.2/CHANGELOG.md"
31
+ Changelog = "https://github.com/cheenulabs/pi-agent-python-sdk/blob/v0.2.3/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 = "0.86.1"
16
+ TESTED_PI_VERSION = "0.87.0"
17
17
 
18
18
  # The client owns these options. In particular --print consumes an initial prompt.
19
19
  _RESERVED = {
@@ -1,4 +1,4 @@
1
- """Pi 0.86.1 wire annotations and small Python conveniences.
1
+ """Pi 0.87.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
@@ -221,6 +221,24 @@ class ModelPromptCache(TypedDict, total=False):
221
221
  long: float
222
222
 
223
223
 
224
+ class ModelImageResizeOptions(TypedDict, total=False):
225
+ maxWidth: float
226
+ maxHeight: float
227
+ maxBytes: float
228
+ jpegQuality: float
229
+
230
+
231
+ class ModelImageInputLimits(TypedDict, total=False):
232
+ resize: ModelImageResizeOptions
233
+ maxPerMessage: float
234
+ maxPerRequest: float
235
+
236
+
237
+ class ModelInputLimits(TypedDict, total=False):
238
+ maxRequestBytes: float
239
+ images: ModelImageInputLimits
240
+
241
+
224
242
  class Model(TypedDict):
225
243
  id: str
226
244
  name: str
@@ -230,6 +248,7 @@ class Model(TypedDict):
230
248
  reasoning: bool
231
249
  thinkingLevelMap: NotRequired[dict[ThinkingLevel, str | None]]
232
250
  input: list[Literal["text", "image"]]
251
+ inputLimits: NotRequired[ModelInputLimits]
233
252
  cost: ModelCost
234
253
  contextWindow: float
235
254
  maxTokens: float
@@ -378,6 +397,22 @@ class CustomMessageEntry(_EntryBase):
378
397
  display: bool
379
398
 
380
399
 
400
+ # Keep the list arms separate so typing rejects mixed ToolCall and ImageContent lists.
401
+ ContextEditableContent: TypeAlias = (
402
+ str | list[TextContent | ImageContent] | list[TextContent | ThinkingContent | ToolCall]
403
+ )
404
+
405
+
406
+ class ContextEditReplacement(TypedDict):
407
+ content: ContextEditableContent
408
+
409
+
410
+ class ContextEditEntry(_EntryBase):
411
+ type: Literal["context_edit"]
412
+ targetId: str
413
+ replacement: ContextEditReplacement | None
414
+
415
+
381
416
  class LabelEntry(_EntryBase):
382
417
  type: Literal["label"]
383
418
  targetId: str
@@ -398,6 +433,7 @@ SessionEntry: TypeAlias = (
398
433
  | BranchSummaryEntry
399
434
  | CustomEntry
400
435
  | CustomMessageEntry
436
+ | ContextEditEntry
401
437
  | LabelEntry
402
438
  | SessionInfoEntry
403
439
  )