codex-python 1.114.2__tar.gz → 1.131.0__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.
- {codex_python-1.114.2 → codex_python-1.131.0}/PKG-INFO +1 -1
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/__init__.py +1 -1
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_async_services.py +71 -9
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_async_threads.py +18 -8
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_protocol_helpers.py +9 -3
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_sync_services.py +90 -9
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_sync_threads.py +19 -4
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/models.py +33 -4
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/options.py +32 -0
- codex_python-1.131.0/codex/protocol/types.py +9513 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/crates/codex_native/Cargo.lock +7 -7
- {codex_python-1.114.2 → codex_python-1.131.0}/crates/codex_native/Cargo.toml +1 -1
- codex_python-1.114.2/codex/protocol/types.py +0 -6670
- {codex_python-1.114.2 → codex_python-1.131.0}/LICENSE +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/README.md +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/_binary.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/_config_types.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/_file_utils.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/_runtime.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/_turn_options.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/__init__.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_async_client.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_payloads.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_session.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_sync_client.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_sync_support.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/_types.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/errors.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/app_server/transports.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/codex.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/dynamic_tools.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/errors.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/options.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/output_schema.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/output_schema_file.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/protocol/__init__.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/py.typed +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/thread.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/codex/vendor/.gitkeep +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/crates/codex_native/codex/__init__.py +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/crates/codex_native/src/lib.rs +0 -0
- {codex_python-1.114.2 → codex_python-1.131.0}/pyproject.toml +0 -0
|
@@ -26,6 +26,7 @@ from codex.app_server.models import (
|
|
|
26
26
|
ModelInfo,
|
|
27
27
|
ModelListResult,
|
|
28
28
|
SkillsConfigWriteResult,
|
|
29
|
+
SkillsListEntry,
|
|
29
30
|
SkillsListResult,
|
|
30
31
|
WindowsSandboxSetupStartResult,
|
|
31
32
|
)
|
|
@@ -112,13 +113,11 @@ class AsyncSkillsClient(_AsyncServiceClient):
|
|
|
112
113
|
*,
|
|
113
114
|
cwds: Sequence[str] | None = None,
|
|
114
115
|
force_reload: bool | None = None,
|
|
115
|
-
|
|
116
|
-
) -> list[protocol.SkillsListEntry]:
|
|
116
|
+
) -> list[SkillsListEntry]:
|
|
117
117
|
return (
|
|
118
118
|
await self.list_page(
|
|
119
119
|
cwds=cwds,
|
|
120
120
|
force_reload=force_reload,
|
|
121
|
-
per_cwd_extra_user_roots=per_cwd_extra_user_roots,
|
|
122
121
|
)
|
|
123
122
|
).data
|
|
124
123
|
|
|
@@ -127,19 +126,18 @@ class AsyncSkillsClient(_AsyncServiceClient):
|
|
|
127
126
|
*,
|
|
128
127
|
cwds: Sequence[str] | None = None,
|
|
129
128
|
force_reload: bool | None = None,
|
|
130
|
-
per_cwd_extra_user_roots: Sequence[protocol.SkillsListExtraRootsForCwd] | None = None,
|
|
131
129
|
) -> SkillsListResult:
|
|
132
130
|
params = protocol.SkillsListParams(
|
|
133
131
|
cwds=list(cwds) if cwds is not None else None,
|
|
134
132
|
forceReload=force_reload,
|
|
135
|
-
perCwdExtraUserRoots=(
|
|
136
|
-
list(per_cwd_extra_user_roots) if per_cwd_extra_user_roots is not None else None
|
|
137
|
-
),
|
|
138
133
|
)
|
|
139
134
|
return await self._rpc.request_typed("skills/list", params, SkillsListResult)
|
|
140
135
|
|
|
141
136
|
async def write_config(self, *, path: str, enabled: bool) -> SkillsConfigWriteResult:
|
|
142
|
-
params = protocol.SkillsConfigWriteParams(
|
|
137
|
+
params = protocol.SkillsConfigWriteParams(
|
|
138
|
+
path=protocol.AbsolutePathBuf(path),
|
|
139
|
+
enabled=enabled,
|
|
140
|
+
)
|
|
143
141
|
return await self._rpc.request_typed("skills/config/write", params, SkillsConfigWriteResult)
|
|
144
142
|
|
|
145
143
|
|
|
@@ -322,19 +320,80 @@ class AsyncCommandClient(_AsyncServiceClient):
|
|
|
322
320
|
*,
|
|
323
321
|
command: Sequence[str],
|
|
324
322
|
cwd: str | None = None,
|
|
323
|
+
disable_output_cap: bool | None = None,
|
|
324
|
+
disable_timeout: bool | None = None,
|
|
325
|
+
env: Mapping[str, object | None] | None = None,
|
|
326
|
+
output_bytes_cap: int | None = None,
|
|
327
|
+
process_id: str | None = None,
|
|
325
328
|
sandbox_policy: protocol.SandboxPolicy | None = None,
|
|
329
|
+
size: protocol.CommandExecTerminalSize | None = None,
|
|
330
|
+
stream_stdin: bool | None = None,
|
|
331
|
+
stream_stdout_stderr: bool | None = None,
|
|
326
332
|
timeout_ms: int | None = None,
|
|
333
|
+
tty: bool | None = None,
|
|
327
334
|
) -> CommandExecResult:
|
|
328
335
|
params = protocol.CommandExecParams(
|
|
329
336
|
command=list(command),
|
|
330
337
|
cwd=cwd,
|
|
338
|
+
disableOutputCap=disable_output_cap,
|
|
339
|
+
disableTimeout=disable_timeout,
|
|
340
|
+
env=dict(env) if env is not None else None,
|
|
341
|
+
outputBytesCap=output_bytes_cap,
|
|
342
|
+
processId=process_id,
|
|
331
343
|
sandboxPolicy=sandbox_policy,
|
|
344
|
+
size=size,
|
|
345
|
+
streamStdin=stream_stdin,
|
|
346
|
+
streamStdoutStderr=stream_stdout_stderr,
|
|
332
347
|
timeoutMs=timeout_ms,
|
|
348
|
+
tty=tty,
|
|
333
349
|
)
|
|
334
350
|
return await self._rpc.request_typed("command/exec", params, CommandExecResult)
|
|
335
351
|
|
|
336
352
|
exec = execute
|
|
337
353
|
|
|
354
|
+
async def write_stdin(
|
|
355
|
+
self,
|
|
356
|
+
*,
|
|
357
|
+
process_id: str,
|
|
358
|
+
close_stdin: bool | None = None,
|
|
359
|
+
delta_base64: str | None = None,
|
|
360
|
+
) -> EmptyResult:
|
|
361
|
+
"""Write stdin bytes to a running `command/exec` process or close stdin.
|
|
362
|
+
|
|
363
|
+
This wraps the app-server `command/exec/write` request. `delta_base64`
|
|
364
|
+
is optional base64-encoded stdin data; `close_stdin` closes the
|
|
365
|
+
process stdin after the optional write.
|
|
366
|
+
"""
|
|
367
|
+
params = protocol.CommandExecWriteParams(
|
|
368
|
+
closeStdin=close_stdin,
|
|
369
|
+
deltaBase64=delta_base64,
|
|
370
|
+
processId=process_id,
|
|
371
|
+
)
|
|
372
|
+
return await self._rpc.request_typed("command/exec/write", params, EmptyResult)
|
|
373
|
+
|
|
374
|
+
async def resize_terminal(
|
|
375
|
+
self,
|
|
376
|
+
*,
|
|
377
|
+
process_id: str,
|
|
378
|
+
size: protocol.CommandExecTerminalSize,
|
|
379
|
+
) -> EmptyResult:
|
|
380
|
+
"""Resize the terminal attached to a running `command/exec` process.
|
|
381
|
+
|
|
382
|
+
This wraps the app-server `command/exec/resize` request and sends the
|
|
383
|
+
new terminal dimensions as `cols` and `rows`.
|
|
384
|
+
"""
|
|
385
|
+
params = protocol.CommandExecResizeParams(processId=process_id, size=size)
|
|
386
|
+
return await self._rpc.request_typed("command/exec/resize", params, EmptyResult)
|
|
387
|
+
|
|
388
|
+
async def terminate_process(self, *, process_id: str) -> EmptyResult:
|
|
389
|
+
"""Terminate a running `command/exec` process.
|
|
390
|
+
|
|
391
|
+
This wraps the app-server `command/exec/terminate` request for the
|
|
392
|
+
client-supplied process id.
|
|
393
|
+
"""
|
|
394
|
+
params = protocol.CommandExecTerminateParams(processId=process_id)
|
|
395
|
+
return await self._rpc.request_typed("command/exec/terminate", params, EmptyResult)
|
|
396
|
+
|
|
338
397
|
|
|
339
398
|
class AsyncExternalAgentConfigClient(_AsyncServiceClient):
|
|
340
399
|
async def detect(
|
|
@@ -369,7 +428,10 @@ class AsyncWindowsSandboxClient(_AsyncServiceClient):
|
|
|
369
428
|
mode: protocol.WindowsSandboxSetupMode,
|
|
370
429
|
cwd: str | None = None,
|
|
371
430
|
) -> WindowsSandboxSetupStartResult:
|
|
372
|
-
params = protocol.WindowsSandboxSetupStartParams(
|
|
431
|
+
params = protocol.WindowsSandboxSetupStartParams(
|
|
432
|
+
cwd=protocol.AbsolutePathBuf(cwd) if cwd is not None else None,
|
|
433
|
+
mode=mode,
|
|
434
|
+
)
|
|
373
435
|
return await self._rpc.request_typed(
|
|
374
436
|
"windowsSandbox/setupStart",
|
|
375
437
|
params,
|
|
@@ -41,9 +41,13 @@ _TURN_STREAM_NOTIFICATION_METHODS = {
|
|
|
41
41
|
"turn/completed",
|
|
42
42
|
"turn/diff/updated",
|
|
43
43
|
"turn/plan/updated",
|
|
44
|
+
"hook/started",
|
|
45
|
+
"hook/completed",
|
|
44
46
|
"thread/tokenUsage/updated",
|
|
45
47
|
"item/started",
|
|
46
48
|
"item/completed",
|
|
49
|
+
"item/autoApprovalReview/started",
|
|
50
|
+
"item/autoApprovalReview/completed",
|
|
47
51
|
"item/agentMessage/delta",
|
|
48
52
|
"item/plan/delta",
|
|
49
53
|
"item/reasoning/summaryTextDelta",
|
|
@@ -235,15 +239,21 @@ class AsyncTurnStream:
|
|
|
235
239
|
self._require_terminal_turn()
|
|
236
240
|
return self._final_message
|
|
237
241
|
|
|
238
|
-
async def steer(
|
|
242
|
+
async def steer(
|
|
243
|
+
self,
|
|
244
|
+
input: TurnInput,
|
|
245
|
+
*,
|
|
246
|
+
responsesapi_client_metadata: Mapping[str, object] | None = None,
|
|
247
|
+
) -> TurnIdResult:
|
|
239
248
|
"""Append additional user input to the in-flight turn."""
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
payload: dict[str, object] = {
|
|
250
|
+
"threadId": self.thread_id,
|
|
251
|
+
"expectedTurnId": self.turn_id,
|
|
252
|
+
"input": normalize_turn_input(input),
|
|
253
|
+
}
|
|
254
|
+
if responsesapi_client_metadata is not None:
|
|
255
|
+
payload["responsesapiClientMetadata"] = dict(responsesapi_client_metadata)
|
|
256
|
+
params = protocol.TurnSteerParams.model_validate(payload)
|
|
247
257
|
return await self._thread._client.rpc.request_typed("turn/steer", params, TurnIdResult)
|
|
248
258
|
|
|
249
259
|
async def interrupt(self) -> EmptyResult:
|
|
@@ -12,7 +12,8 @@ from codex.app_server.models import GenericNotification, GenericServerRequest
|
|
|
12
12
|
from codex.protocol import types as protocol
|
|
13
13
|
|
|
14
14
|
type RequestHandler[RequestT: BaseModel] = Callable[[RequestT], object | Awaitable[object]]
|
|
15
|
-
Notification =
|
|
15
|
+
type Notification = protocol.ServerNotificationValue | GenericNotification
|
|
16
|
+
type ServerRequest = protocol.ServerRequestValue | GenericServerRequest
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
def method_name(message: BaseModel) -> str:
|
|
@@ -123,7 +124,7 @@ def parse_notification(message: JsonObject, *, strict: bool) -> Notification:
|
|
|
123
124
|
raise AppServerProtocolError(_notification_error_message(message)) from exc
|
|
124
125
|
|
|
125
126
|
|
|
126
|
-
def parse_server_request(message: JsonObject, *, strict: bool) ->
|
|
127
|
+
def parse_server_request(message: JsonObject, *, strict: bool) -> ServerRequest:
|
|
127
128
|
method = message.get("method")
|
|
128
129
|
try:
|
|
129
130
|
return protocol.ServerRequest.model_validate(message).root
|
|
@@ -151,9 +152,10 @@ def _build_known_methods(*, root_model: type[BaseModel]) -> frozenset[str]:
|
|
|
151
152
|
root_field = getattr(root_model, "model_fields", {}).get("root")
|
|
152
153
|
if root_field is None:
|
|
153
154
|
return frozenset()
|
|
155
|
+
annotation = _unwrap_type_alias(root_field.annotation)
|
|
154
156
|
methods = {
|
|
155
157
|
method
|
|
156
|
-
for candidate in get_args(
|
|
158
|
+
for candidate in get_args(annotation)
|
|
157
159
|
if isinstance(candidate, type) and issubclass(candidate, BaseModel)
|
|
158
160
|
for method in [_candidate_method_literal(candidate)]
|
|
159
161
|
if method is not None
|
|
@@ -161,6 +163,10 @@ def _build_known_methods(*, root_model: type[BaseModel]) -> frozenset[str]:
|
|
|
161
163
|
return frozenset(methods)
|
|
162
164
|
|
|
163
165
|
|
|
166
|
+
def _unwrap_type_alias(annotation: object) -> object:
|
|
167
|
+
return getattr(annotation, "__value__", annotation)
|
|
168
|
+
|
|
169
|
+
|
|
164
170
|
def _candidate_method_literal(candidate: type[BaseModel]) -> str | None:
|
|
165
171
|
model_fields = getattr(candidate, "model_fields", None)
|
|
166
172
|
if not isinstance(model_fields, dict) or "method" not in model_fields:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from collections.abc import Callable, Coroutine, Sequence
|
|
3
|
+
from collections.abc import Callable, Coroutine, Mapping, Sequence
|
|
4
4
|
from typing import Any, Protocol
|
|
5
5
|
|
|
6
6
|
from codex.app_server._sync_support import _SyncRunner
|
|
@@ -25,6 +25,7 @@ from codex.app_server.models import (
|
|
|
25
25
|
ModelInfo,
|
|
26
26
|
ModelListResult,
|
|
27
27
|
SkillsConfigWriteResult,
|
|
28
|
+
SkillsListEntry,
|
|
28
29
|
SkillsListResult,
|
|
29
30
|
WindowsSandboxSetupStartResult,
|
|
30
31
|
)
|
|
@@ -75,15 +76,13 @@ class _AsyncSkillsClientLike(Protocol):
|
|
|
75
76
|
*,
|
|
76
77
|
cwds: Sequence[str] | None = None,
|
|
77
78
|
force_reload: bool | None = None,
|
|
78
|
-
|
|
79
|
-
) -> list[protocol.SkillsListEntry]: ...
|
|
79
|
+
) -> list[SkillsListEntry]: ...
|
|
80
80
|
|
|
81
81
|
async def list_page(
|
|
82
82
|
self,
|
|
83
83
|
*,
|
|
84
84
|
cwds: Sequence[str] | None = None,
|
|
85
85
|
force_reload: bool | None = None,
|
|
86
|
-
per_cwd_extra_user_roots: Sequence[protocol.SkillsListExtraRootsForCwd] | None = None,
|
|
87
86
|
) -> SkillsListResult: ...
|
|
88
87
|
|
|
89
88
|
async def write_config(self, *, path: str, enabled: bool) -> SkillsConfigWriteResult: ...
|
|
@@ -184,10 +183,36 @@ class _AsyncCommandClientLike(Protocol):
|
|
|
184
183
|
*,
|
|
185
184
|
command: Sequence[str],
|
|
186
185
|
cwd: str | None = None,
|
|
186
|
+
disable_output_cap: bool | None = None,
|
|
187
|
+
disable_timeout: bool | None = None,
|
|
188
|
+
env: Mapping[str, object | None] | None = None,
|
|
189
|
+
output_bytes_cap: int | None = None,
|
|
190
|
+
process_id: str | None = None,
|
|
187
191
|
sandbox_policy: protocol.SandboxPolicy | None = None,
|
|
192
|
+
size: protocol.CommandExecTerminalSize | None = None,
|
|
193
|
+
stream_stdin: bool | None = None,
|
|
194
|
+
stream_stdout_stderr: bool | None = None,
|
|
188
195
|
timeout_ms: int | None = None,
|
|
196
|
+
tty: bool | None = None,
|
|
189
197
|
) -> CommandExecResult: ...
|
|
190
198
|
|
|
199
|
+
async def write_stdin(
|
|
200
|
+
self,
|
|
201
|
+
*,
|
|
202
|
+
process_id: str,
|
|
203
|
+
close_stdin: bool | None = None,
|
|
204
|
+
delta_base64: str | None = None,
|
|
205
|
+
) -> EmptyResult: ...
|
|
206
|
+
|
|
207
|
+
async def resize_terminal(
|
|
208
|
+
self,
|
|
209
|
+
*,
|
|
210
|
+
process_id: str,
|
|
211
|
+
size: protocol.CommandExecTerminalSize,
|
|
212
|
+
) -> EmptyResult: ...
|
|
213
|
+
|
|
214
|
+
async def terminate_process(self, *, process_id: str) -> EmptyResult: ...
|
|
215
|
+
|
|
191
216
|
|
|
192
217
|
class _AsyncExternalAgentConfigClientLike(Protocol):
|
|
193
218
|
async def detect(
|
|
@@ -311,13 +336,11 @@ class _SkillsClient(_SyncRunner):
|
|
|
311
336
|
*,
|
|
312
337
|
cwds: Sequence[str] | None = None,
|
|
313
338
|
force_reload: bool | None = None,
|
|
314
|
-
|
|
315
|
-
) -> list[protocol.SkillsListEntry]:
|
|
339
|
+
) -> list[SkillsListEntry]:
|
|
316
340
|
return self._run(
|
|
317
341
|
self._async_client.list(
|
|
318
342
|
cwds=cwds,
|
|
319
343
|
force_reload=force_reload,
|
|
320
|
-
per_cwd_extra_user_roots=per_cwd_extra_user_roots,
|
|
321
344
|
)
|
|
322
345
|
)
|
|
323
346
|
|
|
@@ -326,13 +349,11 @@ class _SkillsClient(_SyncRunner):
|
|
|
326
349
|
*,
|
|
327
350
|
cwds: Sequence[str] | None = None,
|
|
328
351
|
force_reload: bool | None = None,
|
|
329
|
-
per_cwd_extra_user_roots: Sequence[protocol.SkillsListExtraRootsForCwd] | None = None,
|
|
330
352
|
) -> SkillsListResult:
|
|
331
353
|
return self._run(
|
|
332
354
|
self._async_client.list_page(
|
|
333
355
|
cwds=cwds,
|
|
334
356
|
force_reload=force_reload,
|
|
335
|
-
per_cwd_extra_user_roots=per_cwd_extra_user_roots,
|
|
336
357
|
)
|
|
337
358
|
)
|
|
338
359
|
|
|
@@ -529,20 +550,80 @@ class _CommandClient(_SyncRunner):
|
|
|
529
550
|
*,
|
|
530
551
|
command: Sequence[str],
|
|
531
552
|
cwd: str | None = None,
|
|
553
|
+
disable_output_cap: bool | None = None,
|
|
554
|
+
disable_timeout: bool | None = None,
|
|
555
|
+
env: Mapping[str, object | None] | None = None,
|
|
556
|
+
output_bytes_cap: int | None = None,
|
|
557
|
+
process_id: str | None = None,
|
|
532
558
|
sandbox_policy: protocol.SandboxPolicy | None = None,
|
|
559
|
+
size: protocol.CommandExecTerminalSize | None = None,
|
|
560
|
+
stream_stdin: bool | None = None,
|
|
561
|
+
stream_stdout_stderr: bool | None = None,
|
|
533
562
|
timeout_ms: int | None = None,
|
|
563
|
+
tty: bool | None = None,
|
|
534
564
|
) -> CommandExecResult:
|
|
535
565
|
return self._run(
|
|
536
566
|
self._async_client.execute(
|
|
537
567
|
command=command,
|
|
538
568
|
cwd=cwd,
|
|
569
|
+
disable_output_cap=disable_output_cap,
|
|
570
|
+
disable_timeout=disable_timeout,
|
|
571
|
+
env=env,
|
|
572
|
+
output_bytes_cap=output_bytes_cap,
|
|
573
|
+
process_id=process_id,
|
|
539
574
|
sandbox_policy=sandbox_policy,
|
|
575
|
+
size=size,
|
|
576
|
+
stream_stdin=stream_stdin,
|
|
577
|
+
stream_stdout_stderr=stream_stdout_stderr,
|
|
540
578
|
timeout_ms=timeout_ms,
|
|
579
|
+
tty=tty,
|
|
541
580
|
)
|
|
542
581
|
)
|
|
543
582
|
|
|
544
583
|
exec = execute
|
|
545
584
|
|
|
585
|
+
def write_stdin(
|
|
586
|
+
self,
|
|
587
|
+
*,
|
|
588
|
+
process_id: str,
|
|
589
|
+
close_stdin: bool | None = None,
|
|
590
|
+
delta_base64: str | None = None,
|
|
591
|
+
) -> EmptyResult:
|
|
592
|
+
"""Write stdin bytes to a running `command/exec` process or close stdin.
|
|
593
|
+
|
|
594
|
+
This wraps the app-server `command/exec/write` request. `delta_base64`
|
|
595
|
+
is optional base64-encoded stdin data; `close_stdin` closes the
|
|
596
|
+
process stdin after the optional write.
|
|
597
|
+
"""
|
|
598
|
+
return self._run(
|
|
599
|
+
self._async_client.write_stdin(
|
|
600
|
+
process_id=process_id,
|
|
601
|
+
close_stdin=close_stdin,
|
|
602
|
+
delta_base64=delta_base64,
|
|
603
|
+
)
|
|
604
|
+
)
|
|
605
|
+
|
|
606
|
+
def resize_terminal(
|
|
607
|
+
self,
|
|
608
|
+
*,
|
|
609
|
+
process_id: str,
|
|
610
|
+
size: protocol.CommandExecTerminalSize,
|
|
611
|
+
) -> EmptyResult:
|
|
612
|
+
"""Resize the terminal attached to a running `command/exec` process.
|
|
613
|
+
|
|
614
|
+
This wraps the app-server `command/exec/resize` request and sends the
|
|
615
|
+
new terminal dimensions as `cols` and `rows`.
|
|
616
|
+
"""
|
|
617
|
+
return self._run(self._async_client.resize_terminal(process_id=process_id, size=size))
|
|
618
|
+
|
|
619
|
+
def terminate_process(self, *, process_id: str) -> EmptyResult:
|
|
620
|
+
"""Terminate a running `command/exec` process.
|
|
621
|
+
|
|
622
|
+
This wraps the app-server `command/exec/terminate` request for the
|
|
623
|
+
client-supplied process id.
|
|
624
|
+
"""
|
|
625
|
+
return self._run(self._async_client.terminate_process(process_id=process_id))
|
|
626
|
+
|
|
546
627
|
|
|
547
628
|
class _ExternalAgentConfigClient(_SyncRunner):
|
|
548
629
|
def __init__(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from collections.abc import Callable, Collection, Coroutine
|
|
5
|
+
from collections.abc import Callable, Collection, Coroutine, Mapping
|
|
6
6
|
from typing import Any, Protocol, TypeVar
|
|
7
7
|
|
|
8
8
|
from pydantic import BaseModel
|
|
@@ -45,7 +45,12 @@ class _AsyncTurnStreamLike(Protocol):
|
|
|
45
45
|
|
|
46
46
|
def raise_for_terminal_status(self) -> None: ...
|
|
47
47
|
|
|
48
|
-
async def steer(
|
|
48
|
+
async def steer(
|
|
49
|
+
self,
|
|
50
|
+
input: TurnInput,
|
|
51
|
+
*,
|
|
52
|
+
responsesapi_client_metadata: Mapping[str, object] | None = None,
|
|
53
|
+
) -> TurnIdResult: ...
|
|
49
54
|
|
|
50
55
|
async def interrupt(self) -> EmptyResult: ...
|
|
51
56
|
|
|
@@ -217,8 +222,18 @@ class TurnStream(_SyncRunner):
|
|
|
217
222
|
def raise_for_terminal_status(self) -> None:
|
|
218
223
|
self._async_stream.raise_for_terminal_status()
|
|
219
224
|
|
|
220
|
-
def steer(
|
|
221
|
-
|
|
225
|
+
def steer(
|
|
226
|
+
self,
|
|
227
|
+
input: TurnInput,
|
|
228
|
+
*,
|
|
229
|
+
responsesapi_client_metadata: Mapping[str, object] | None = None,
|
|
230
|
+
) -> TurnIdResult:
|
|
231
|
+
return self._run(
|
|
232
|
+
self._async_stream.steer(
|
|
233
|
+
input,
|
|
234
|
+
responsesapi_client_metadata=responsesapi_client_metadata,
|
|
235
|
+
)
|
|
236
|
+
)
|
|
222
237
|
|
|
223
238
|
def interrupt(self) -> EmptyResult:
|
|
224
239
|
return self._run(self._async_stream.interrupt())
|
|
@@ -71,6 +71,7 @@ DEFAULT_INPUT_MODALITIES: tuple[Literal["text", "image"], Literal["text", "image
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
class ModelInfo(AppServerResultModel):
|
|
74
|
+
additional_speed_tiers: list[str] | None = Field(default_factory=list)
|
|
74
75
|
availability_nux: ModelAvailabilityNux | None = None
|
|
75
76
|
default_reasoning_effort: protocol.ReasoningEffort
|
|
76
77
|
description: str
|
|
@@ -98,8 +99,34 @@ class AppListResult(AppServerResultModel):
|
|
|
98
99
|
next_cursor: str | None = None
|
|
99
100
|
|
|
100
101
|
|
|
102
|
+
class SkillInterface(AppServerResultModel):
|
|
103
|
+
display_name: str | None = None
|
|
104
|
+
short_description: str | None = None
|
|
105
|
+
icon_small: str | None = None
|
|
106
|
+
icon_large: str | None = None
|
|
107
|
+
brand_color: str | None = None
|
|
108
|
+
default_prompt: str | None = None
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class SkillInfo(AppServerResultModel):
|
|
112
|
+
name: str
|
|
113
|
+
description: str
|
|
114
|
+
dependencies: protocol.SkillDependencies | None = None
|
|
115
|
+
enabled: bool
|
|
116
|
+
path: str
|
|
117
|
+
scope: str
|
|
118
|
+
interface: SkillInterface | None = None
|
|
119
|
+
short_description: str | None = None
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class SkillsListEntry(AppServerResultModel):
|
|
123
|
+
cwd: str
|
|
124
|
+
skills: list[SkillInfo]
|
|
125
|
+
errors: list[protocol.SkillErrorInfo] = Field(default_factory=list)
|
|
126
|
+
|
|
127
|
+
|
|
101
128
|
class SkillsListResult(AppServerResultModel):
|
|
102
|
-
data: list[
|
|
129
|
+
data: list[SkillsListEntry]
|
|
103
130
|
|
|
104
131
|
|
|
105
132
|
class SkillsConfigWriteResult(AppServerResultModel):
|
|
@@ -181,10 +208,12 @@ class ConfigWriteResult(AppServerResultModel):
|
|
|
181
208
|
|
|
182
209
|
class ConfigRequirements(AppServerResultModel):
|
|
183
210
|
allowed_approval_policies: list[protocol.AskForApproval] | None = None
|
|
211
|
+
allowed_approvals_reviewers: list[protocol.ApprovalsReviewer] | None = None
|
|
184
212
|
allowed_sandbox_modes: list[protocol.SandboxMode] | None = None
|
|
185
|
-
allowed_web_search_modes: list[
|
|
186
|
-
enforce_residency:
|
|
187
|
-
feature_requirements: dict[str,
|
|
213
|
+
allowed_web_search_modes: list[protocol.WebSearchMode] | None = None
|
|
214
|
+
enforce_residency: protocol.ResidencyRequirement | None = None
|
|
215
|
+
feature_requirements: dict[str, object] | None = None
|
|
216
|
+
network: protocol.NetworkRequirements | None = None
|
|
188
217
|
|
|
189
218
|
|
|
190
219
|
class ConfigRequirementsReadResult(AppServerResultModel):
|
|
@@ -189,6 +189,10 @@ class AppServerTurnOptions(_AppServerOptionsModel):
|
|
|
189
189
|
default=None,
|
|
190
190
|
description="Sent as turn/start approvalPolicy.",
|
|
191
191
|
)
|
|
192
|
+
approvals_reviewer: protocol.ApprovalsReviewer | None = Field(
|
|
193
|
+
default=None,
|
|
194
|
+
description="Sent as turn/start approvalsReviewer.",
|
|
195
|
+
)
|
|
192
196
|
collaboration_mode: protocol.CollaborationMode | None = Field(
|
|
193
197
|
default=None,
|
|
194
198
|
description="Sent as turn/start collaborationMode.",
|
|
@@ -216,6 +220,10 @@ class AppServerTurnOptions(_AppServerOptionsModel):
|
|
|
216
220
|
default=None,
|
|
217
221
|
description="Sent as turn/start personality.",
|
|
218
222
|
)
|
|
223
|
+
responsesapi_client_metadata: dict[str, object] | None = Field(
|
|
224
|
+
default=None,
|
|
225
|
+
description="Sent as turn/start responsesapiClientMetadata.",
|
|
226
|
+
)
|
|
219
227
|
sandbox_policy: protocol.SandboxPolicy | None = Field(
|
|
220
228
|
default=None,
|
|
221
229
|
description="Sent as turn/start sandboxPolicy.",
|
|
@@ -249,6 +257,10 @@ class AppServerThreadStartOptions(_AppServerOptionsModel):
|
|
|
249
257
|
default=None,
|
|
250
258
|
description="Sent as thread/start approvalPolicy.",
|
|
251
259
|
)
|
|
260
|
+
approvals_reviewer: protocol.ApprovalsReviewer | None = Field(
|
|
261
|
+
default=None,
|
|
262
|
+
description="Sent as thread/start approvalsReviewer.",
|
|
263
|
+
)
|
|
252
264
|
base_instructions: str | None = Field(
|
|
253
265
|
default=None,
|
|
254
266
|
description="Sent as thread/start baseInstructions.",
|
|
@@ -321,6 +333,10 @@ class AppServerThreadStartOptions(_AppServerOptionsModel):
|
|
|
321
333
|
default=None,
|
|
322
334
|
description="Sent as thread/start serviceTier.",
|
|
323
335
|
)
|
|
336
|
+
session_start_source: protocol.ThreadStartSource | None = Field(
|
|
337
|
+
default=None,
|
|
338
|
+
description="Sent as thread/start sessionStartSource.",
|
|
339
|
+
)
|
|
324
340
|
|
|
325
341
|
def to_params(self) -> protocol.ThreadStartParams:
|
|
326
342
|
return cast(
|
|
@@ -336,6 +352,10 @@ class AppServerThreadResumeOptions(_AppServerOptionsModel):
|
|
|
336
352
|
default=None,
|
|
337
353
|
description="Sent as thread/resume approvalPolicy.",
|
|
338
354
|
)
|
|
355
|
+
approvals_reviewer: protocol.ApprovalsReviewer | None = Field(
|
|
356
|
+
default=None,
|
|
357
|
+
description="Sent as thread/resume approvalsReviewer.",
|
|
358
|
+
)
|
|
339
359
|
base_instructions: str | None = Field(
|
|
340
360
|
default=None,
|
|
341
361
|
description="Sent as thread/resume baseInstructions.",
|
|
@@ -404,6 +424,10 @@ class AppServerThreadForkOptions(_AppServerOptionsModel):
|
|
|
404
424
|
default=None,
|
|
405
425
|
description="Sent as thread/fork approvalPolicy.",
|
|
406
426
|
)
|
|
427
|
+
approvals_reviewer: protocol.ApprovalsReviewer | None = Field(
|
|
428
|
+
default=None,
|
|
429
|
+
description="Sent as thread/fork approvalsReviewer.",
|
|
430
|
+
)
|
|
407
431
|
base_instructions: str | None = Field(
|
|
408
432
|
default=None,
|
|
409
433
|
description="Sent as thread/fork baseInstructions.",
|
|
@@ -420,6 +444,10 @@ class AppServerThreadForkOptions(_AppServerOptionsModel):
|
|
|
420
444
|
default=None,
|
|
421
445
|
description="Sent as thread/fork developerInstructions.",
|
|
422
446
|
)
|
|
447
|
+
ephemeral: bool | None = Field(
|
|
448
|
+
default=None,
|
|
449
|
+
description="Sent as thread/fork ephemeral.",
|
|
450
|
+
)
|
|
423
451
|
model: str | None = Field(
|
|
424
452
|
default=None,
|
|
425
453
|
description="Sent as thread/fork model.",
|
|
@@ -491,6 +519,10 @@ class AppServerThreadListOptions(_AppServerOptionsModel):
|
|
|
491
519
|
default=None,
|
|
492
520
|
description="Sent as thread/list sortKey.",
|
|
493
521
|
)
|
|
522
|
+
sort_direction: protocol.SortDirection | None = Field(
|
|
523
|
+
default=None,
|
|
524
|
+
description="Sent as thread/list sortDirection.",
|
|
525
|
+
)
|
|
494
526
|
source_kinds: list[protocol.ThreadSourceKind] | None = Field(
|
|
495
527
|
default=None,
|
|
496
528
|
description="Sent as thread/list sourceKinds.",
|