codex-backend-sdk 0.3.9__tar.gz → 0.4.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.
Files changed (79) hide show
  1. codex_backend_sdk-0.4.0/CHANGELOG.md +142 -0
  2. codex_backend_sdk-0.4.0/PKG-INFO +599 -0
  3. codex_backend_sdk-0.4.0/README.md +570 -0
  4. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/__init__.py +60 -2
  5. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/_client.py +288 -7
  6. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/_models.py +113 -3
  7. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/_streaming.py +30 -3
  8. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/codex_client.py +16 -0
  9. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/oauth.py +175 -2
  10. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/chatgpt.py +788 -0
  11. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/chatgpt_apps.py +315 -0
  12. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/chatgpt_connectors.py +349 -0
  13. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/chatgpt_plugin_bundles.py +332 -0
  14. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/chatgpt_plugin_shares.py +338 -0
  15. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/chatgpt_plugins.py +281 -0
  16. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/chatgpt_writing_blocks.py +82 -0
  17. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/codex.py +444 -0
  18. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/codex_web_search.py +104 -0
  19. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/resources/files.py +19 -1
  20. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/images.py +282 -0
  21. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/resources/models.py +17 -4
  22. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/resources/openai_oauth.py +4 -0
  23. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/resources/realtime.py +43 -4
  24. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/remote_control.py +504 -0
  25. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/resources/responses.py +67 -12
  26. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/responses_websocket.py +192 -0
  27. codex_backend_sdk-0.4.0/codex_backend_sdk/resources/worktree_snapshots.py +106 -0
  28. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/storage.py +11 -0
  29. codex_backend_sdk-0.4.0/docs/api-reference.md +720 -0
  30. codex_backend_sdk-0.4.0/docs/backend-api.md +1018 -0
  31. codex_backend_sdk-0.4.0/docs/desktop-endpoint-inventory.md +293 -0
  32. codex_backend_sdk-0.4.0/docs/endpoint-coverage.md +154 -0
  33. codex_backend_sdk-0.4.0/docs/openai-compatibility.md +86 -0
  34. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/pyproject.toml +11 -3
  35. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_account_info.py +50 -0
  36. codex_backend_sdk-0.4.0/tests/test_chatgpt_apps.py +135 -0
  37. codex_backend_sdk-0.4.0/tests/test_chatgpt_connectors.py +286 -0
  38. codex_backend_sdk-0.4.0/tests/test_chatgpt_plugin_bundles.py +253 -0
  39. codex_backend_sdk-0.4.0/tests/test_chatgpt_plugin_shares.py +231 -0
  40. codex_backend_sdk-0.4.0/tests/test_chatgpt_plugins.py +196 -0
  41. codex_backend_sdk-0.4.0/tests/test_chatgpt_projects_gizmos.py +197 -0
  42. codex_backend_sdk-0.4.0/tests/test_chatgpt_resources.py +247 -0
  43. codex_backend_sdk-0.4.0/tests/test_chatgpt_search_files.py +161 -0
  44. codex_backend_sdk-0.4.0/tests/test_chatgpt_writing_blocks.py +124 -0
  45. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_client_retry.py +45 -0
  46. codex_backend_sdk-0.4.0/tests/test_codex_resources.py +472 -0
  47. codex_backend_sdk-0.4.0/tests/test_codex_web_search.py +118 -0
  48. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_files_resource.py +14 -1
  49. codex_backend_sdk-0.4.0/tests/test_hosted_mcp.py +161 -0
  50. codex_backend_sdk-0.4.0/tests/test_images.py +216 -0
  51. codex_backend_sdk-0.4.0/tests/test_oauth.py +242 -0
  52. codex_backend_sdk-0.4.0/tests/test_openai_compatibility.py +79 -0
  53. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_realtime_resource.py +32 -0
  54. codex_backend_sdk-0.4.0/tests/test_remote_control_resource.py +292 -0
  55. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_responses_resource.py +63 -8
  56. codex_backend_sdk-0.4.0/tests/test_responses_websocket.py +180 -0
  57. codex_backend_sdk-0.4.0/tests/test_worktree_snapshots.py +131 -0
  58. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/uv.lock +52 -13
  59. codex_backend_sdk-0.3.9/CHANGELOG.md +0 -68
  60. codex_backend_sdk-0.3.9/PKG-INFO +0 -491
  61. codex_backend_sdk-0.3.9/README.md +0 -465
  62. codex_backend_sdk-0.3.9/codex_backend_sdk/resources/codex.py +0 -134
  63. codex_backend_sdk-0.3.9/docs/backend-api.md +0 -568
  64. codex_backend_sdk-0.3.9/tests/test_codex_resources.py +0 -177
  65. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/.gitignore +0 -0
  66. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/LICENSE +0 -0
  67. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/_transport.py +0 -0
  68. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/_utils.py +0 -0
  69. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/pkce.py +0 -0
  70. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/resources/__init__.py +0 -0
  71. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/codex_backend_sdk/resources/_responses_payloads.py +0 -0
  72. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/examples/agent.py +0 -0
  73. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/conftest.py +0 -0
  74. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_basic.py +0 -0
  75. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_conversation.py +0 -0
  76. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_openai_oauth_resources.py +0 -0
  77. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_reasoning.py +0 -0
  78. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_structured_output.py +0 -0
  79. {codex_backend_sdk-0.3.9 → codex_backend_sdk-0.4.0}/tests/test_tools.py +0 -0
@@ -0,0 +1,142 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## Unreleased
6
+
7
+ ## [0.4.0] - 2026-08-10
8
+
9
+ ### Added
10
+ - Added a dedicated `client.chatgpt` product namespace covering Desktop
11
+ conversations, projects, files, search, pins, shares, GPTs, account/session,
12
+ models, voice, Sentinel, writing blocks, Apps, connectors, and external
13
+ actions while keeping private schemas raw where appropriate.
14
+ - Added Codex cloud resources for detailed usage, tasks/turns/logs, environments,
15
+ machines, repositories/branches, profiles, managed preferences, workspace
16
+ messages, and worktree-snapshot uploads.
17
+ - Added the complete independent-server and account-authorized discovery sides
18
+ of Remote Control, including enrollment, pairing, client management, and the
19
+ cursor-aware protocol-v3 WebSocket transport.
20
+ - Added hosted Apps MCP, remote plugin catalogs, installation and workspace
21
+ sharing contracts, skill detail, and bounded safe materialization of signed
22
+ plugin, skill, and curated archives.
23
+ - Added the Codex Responses WebSocket transport and structured alpha Web Search
24
+ commands, both verified live with reusable/continuation behavior.
25
+ - Added browser-callback and device-code Codex OAuth login, explicit remote
26
+ token revocation, connector-scope-preserving refresh, and optional workspace
27
+ selection guards.
28
+ - Added guarded Realtime v3 support for the confirmed `gpt-live-1-codex` and
29
+ `gpt-live-1-boulder-alpha` snapshots, plus typed subscription-backed ChatGPT
30
+ pronunciation synthesis with in-memory and persisted output forms.
31
+ - Added optional image-edit masks from URLs, base64 data URLs, or uploaded file
32
+ IDs, verified against the authenticated Codex backend.
33
+ - Added automated signature drift checks against `openai-python` 2.53.0 and an
34
+ audited compatibility matrix for every common exposed resource.
35
+
36
+ ### Changed
37
+ - Grouped surfaces by backend ownership: OpenAI-shaped Codex APIs remain on the
38
+ top-level client, Codex-specific capabilities live under `client.codex`, and
39
+ official-Desktop product APIs live under `client.chatgpt`.
40
+ - Preserved the original connector scopes during OAuth refresh instead of
41
+ accidentally narrowing the grant.
42
+ - Aligned image editing with `openai-python` by exposing the singular `image`
43
+ parameter while translating it to the Codex backend's `images` array.
44
+ - Forwarded official Responses and Models request options that were previously
45
+ accepted but ignored, normalized official image file inputs, and made
46
+ unsupported Files, image-format, streaming, and transcription controls fail
47
+ explicitly instead of degrading silently.
48
+
49
+ ### Documentation
50
+ - Reworked the README as a progressive usage guide from Responses and context
51
+ compaction through Codex cloud and ChatGPT product integrations, with an
52
+ explicit map of `client`, `client.codex`, and `client.chatgpt` ownership.
53
+ - Added a dedicated API reference covering the complete public resource tree,
54
+ supported parameters, return shapes, validation, and transport behavior.
55
+ - Reconciled all production networking modules in the current Codex checkout
56
+ and every concrete HTTP call site in the extracted official Desktop bundle.
57
+ - Added an endpoint coverage matrix with live, contract, and explicit exclusion
58
+ status; no useful route remains unclassified in the audited snapshot.
59
+ - Documented why commercial/admin, attestation, reporting, telemetry, personal
60
+ access token, and Desktop device-key enrollment surfaces remain excluded.
61
+
62
+ ### Tests
63
+ - Expanded behavioral and request-contract coverage to 221 tests and recorded
64
+ read-only live probes separately from stateful or user-interactive contracts.
65
+
66
+ ## [0.3.10] - 2026-07-17
67
+
68
+ ### Added
69
+ - Added typed Codex rate-limit reset credit listing and explicit idempotent consumption through `client.codex.rate_limit_reset_credits`.
70
+ - Added ChatGPT-authenticated image generation and editing through `client.images.generate(...)` and `client.images.edit(...)`, returning typed base64 image data from the Codex backend.
71
+
72
+ ### Documentation
73
+ - Documented that image generation uses the ChatGPT Codex backend rather than the separately billed Platform image endpoint, and that consuming reset credits mutates account quota state.
74
+ - Documented the verified Codex JSON image-edit contract using ordinary URLs or base64 data URLs.
75
+
76
+ ### Tests
77
+ - Added behavioral coverage for credit payloads, redemption validation, image request construction, defaults, URL normalization, and typed responses; verified read-only credit listing plus real image generation and editing against the authenticated backend.
78
+
79
+ ## [0.3.9] - 2026-07-17
80
+
81
+ ### Fixed
82
+ - Detect anonymous audio buffers by their file signature before ChatGPT transcription uploads, correcting filenames and MIME types when callers provide misleading generic names such as `audio.mp3` for WAV data.
83
+ - Restored reliable `AIClient.audio_to_text(bytes)` integration with `/backend-api/transcribe` without requiring callers to understand multipart backend constraints.
84
+
85
+ ### Tests
86
+ - Added regression coverage for WAV buffers carrying an incorrect `.mp3` name and verified the complete Codex Agent transcription path against the real ChatGPT backend.
87
+
88
+ ## [0.3.8] - 2026-07-17
89
+
90
+ ### Changed
91
+ - Routed `client.audio.transcriptions.create(...)` through the ChatGPT-native `/backend-api/transcribe` endpoint instead of the billable Platform `/v1/audio/transcriptions` endpoint.
92
+ - Preserved the OpenAI-shaped `json` and `text` response behavior used by Codex Agent while rejecting unsupported streaming, timestamp, speaker, chunking, SRT, and VTT options explicitly.
93
+ - Added a reusable raw ChatGPT multipart request helper to the client transport.
94
+
95
+ ### Documentation
96
+ - Clarified that embeddings still use the OpenAI Platform endpoint and its developer-account quota, while batch transcription now uses the authenticated ChatGPT backend.
97
+
98
+ ### Tests
99
+ - Added coverage for ChatGPT transcription routing, account authentication headers, text responses, and unsupported parameters.
100
+
101
+ ## [0.3.7] - 2026-07-17
102
+
103
+ ### Added
104
+ - Added typed Realtime call results through `RealtimeCallResponse.answer_sdp` and `RealtimeCallResponse.call_id`.
105
+ - Added Codex AVAS session payload support, including automatic removal of the server-generated session `id` and the required `quicksilver` query parameters.
106
+
107
+ ### Documentation
108
+ - Documented that the ChatGPT-authenticated Codex WebRTC route is experimental and rollout-dependent, while the public Realtime WebSocket route still requires a developer API key.
109
+
110
+ ### Tests
111
+ - Added coverage for SDP response parsing, call ID validation, AVAS payload construction, and invalid session payloads.
112
+
113
+ ## [0.3.6] - 2026-07-11
114
+
115
+ ### Added
116
+ - Added Voice v2 WebSocket headers through `client.realtime.websocket_headers(...)`, using the API key stored by OAuth when available or `OPENAI_API_KEY` as a fallback.
117
+ - Added `authenticate(force=True)` for explicit interactive reauthentication.
118
+
119
+ ### Changed
120
+ - ChatGPT OAuth now attempts the same optional ID-token-to-API-key exchange as Codex CLI and persists the result in the official `OPENAI_API_KEY` auth field.
121
+ - Removed the legacy `request_api_key` authentication option; API-key acquisition is now an internal OAuth concern and never prevents regular Codex login.
122
+
123
+ ### Tests
124
+ - Added coverage for forced authentication and Realtime credential selection/error behavior.
125
+
126
+ ## [0.3.5] - 2026-05-18
127
+
128
+ ### Fixed
129
+ - Preserved `usage` on `client.responses.compact(...)` results so `CompactedResponse` exposes backend token accounting.
130
+
131
+ ### Tests
132
+ - Added coverage to verify compact responses retain `input_tokens`, `output_tokens`, and `total_tokens`.
133
+
134
+ ## [0.3.4] - 2026-05-15
135
+
136
+ ### Added
137
+ - Added `authenticate(interactive=False)` to allow non-interactive credential checks without triggering the browser OAuth flow.
138
+ - Added `client.authenticated` for simple auth-state introspection.
139
+ - Added `client.account_info()` to expose safe non-secret account metadata (`authenticated`, `account_id`, `email`, `plan_type`).
140
+
141
+ ### Documentation
142
+ - Documented the non-interactive authentication helpers in `README.md`.