summaryrefslogtreecommitdiff
path: root/src/luarocks_runtime.zig
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-13 12:22:18 -0600
committert <t@tjp.lol>2026-06-15 15:08:32 -0600
commiteb19fd812e15de5a6930daf2fcd0b2b0757687c7 (patch)
treeace85c641e48836fe45b289141213fe8984ccb52 /src/luarocks_runtime.zig
parent9f983c5d0ecc1c12f15eadf1add123e24995b660 (diff)
auth: openai_responses provider for Codex subscription (Tier 2)
Add the OpenAI Responses API wire dialect (openai_responses APIStyle + OpenAIResponsesConfig), a request serializer (instructions/input items, flat function tools, reasoning, store:false, include encrypted reasoning), and a streaming state machine over the typed response.* SSE events mapping to the shared block model. Wire dispatch, buildProviderConfig, the C-ABI free switch, and the reasoning selectors. Ship a commented Codex example in the default config. Implemented from the Responses API docs + the open-source Codex client and covered by fixture tests; live verification against a ChatGPT plan is still required (documented).
Diffstat (limited to 'src/luarocks_runtime.zig')
-rw-r--r--src/luarocks_runtime.zig24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/luarocks_runtime.zig b/src/luarocks_runtime.zig
index ac34ee0..3cfd02f 100644
--- a/src/luarocks_runtime.zig
+++ b/src/luarocks_runtime.zig
@@ -347,6 +347,30 @@ const default_base_config =
\\# Editor-Plugin-Version = "copilot-chat/0.26.7"
\\# Copilot-Integration-Id = "vscode-chat"
\\
+ \\# OpenAI Codex via a ChatGPT subscription (device login). Codex speaks the
+ \\# OpenAI Responses API, not Chat Completions, so style = "openai_responses".
+ \\# NOTE: this path is implemented but not yet verified against a live
+ \\# ChatGPT plan — see docs/oauth-provider-auth.md.
+ \\#
+ \\# [providers.codex]
+ \\# style = "openai_responses"
+ \\# base_url = "https://chatgpt.com/backend-api/codex"
+ \\# auth = "openai_codex"
+ \\#
+ \\# [providers.codex.extra_headers]
+ \\# OpenAI-Beta = "responses=experimental"
+ \\# originator = "codex_cli_rs"
+ \\#
+ \\# [auth.openai_codex]
+ \\# type = "oauth_device"
+ \\# dialect = "codex"
+ \\# client_id = "app_EMoamEEZ73f0CkXaXp7hrann"
+ \\# device_code_url = "https://auth.openai.com/api/accounts/deviceauth/usercode"
+ \\# device_poll_url = "https://auth.openai.com/api/accounts/deviceauth/token"
+ \\# verification_url = "https://auth.openai.com/codex/device"
+ \\# token_url = "https://auth.openai.com/oauth/token"
+ \\# account_id_jwt_claim = "https://api.openai.com/auth"
+ \\
\\# Tool/extension availability (glob patterns). Empty allow = allow all.
\\# [tools]
\\# allow = ["std.*"]