opencode-openai-codex-multi-auth 4.4.0

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 (90) hide show
  1. package/LICENSE +37 -0
  2. package/README.md +89 -0
  3. package/assets/openai-codex-auth-config.schema.json +63 -0
  4. package/assets/opencode-logo-ornate-dark.svg +18 -0
  5. package/assets/readme-hero.svg +31 -0
  6. package/config/README.md +103 -0
  7. package/config/minimal-opencode.json +12 -0
  8. package/config/opencode-legacy.json +571 -0
  9. package/config/opencode-modern.json +239 -0
  10. package/dist/index.d.ts +42 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +564 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/lib/accounts.d.ts +58 -0
  15. package/dist/lib/accounts.d.ts.map +1 -0
  16. package/dist/lib/accounts.js +405 -0
  17. package/dist/lib/accounts.js.map +1 -0
  18. package/dist/lib/auth/auth.d.ts +43 -0
  19. package/dist/lib/auth/auth.d.ts.map +1 -0
  20. package/dist/lib/auth/auth.js +163 -0
  21. package/dist/lib/auth/auth.js.map +1 -0
  22. package/dist/lib/auth/browser.d.ts +17 -0
  23. package/dist/lib/auth/browser.d.ts.map +1 -0
  24. package/dist/lib/auth/browser.js +76 -0
  25. package/dist/lib/auth/browser.js.map +1 -0
  26. package/dist/lib/auth/server.d.ts +10 -0
  27. package/dist/lib/auth/server.d.ts.map +1 -0
  28. package/dist/lib/auth/server.js +78 -0
  29. package/dist/lib/auth/server.js.map +1 -0
  30. package/dist/lib/cli.d.ts +8 -0
  31. package/dist/lib/cli.d.ts.map +1 -0
  32. package/dist/lib/cli.js +36 -0
  33. package/dist/lib/cli.js.map +1 -0
  34. package/dist/lib/config.d.ts +25 -0
  35. package/dist/lib/config.d.ts.map +1 -0
  36. package/dist/lib/config.js +112 -0
  37. package/dist/lib/config.js.map +1 -0
  38. package/dist/lib/constants.d.ts +67 -0
  39. package/dist/lib/constants.d.ts.map +1 -0
  40. package/dist/lib/constants.js +67 -0
  41. package/dist/lib/constants.js.map +1 -0
  42. package/dist/lib/logger.d.ts +21 -0
  43. package/dist/lib/logger.d.ts.map +1 -0
  44. package/dist/lib/logger.js +77 -0
  45. package/dist/lib/logger.js.map +1 -0
  46. package/dist/lib/oauth-success.html +712 -0
  47. package/dist/lib/prompts/codex-opencode-bridge.d.ts +19 -0
  48. package/dist/lib/prompts/codex-opencode-bridge.d.ts.map +1 -0
  49. package/dist/lib/prompts/codex-opencode-bridge.js +152 -0
  50. package/dist/lib/prompts/codex-opencode-bridge.js.map +1 -0
  51. package/dist/lib/prompts/codex.d.ts +28 -0
  52. package/dist/lib/prompts/codex.d.ts.map +1 -0
  53. package/dist/lib/prompts/codex.js +248 -0
  54. package/dist/lib/prompts/codex.js.map +1 -0
  55. package/dist/lib/prompts/opencode-codex.d.ts +21 -0
  56. package/dist/lib/prompts/opencode-codex.d.ts.map +1 -0
  57. package/dist/lib/prompts/opencode-codex.js +91 -0
  58. package/dist/lib/prompts/opencode-codex.js.map +1 -0
  59. package/dist/lib/request/fetch-helpers.d.ts +73 -0
  60. package/dist/lib/request/fetch-helpers.d.ts.map +1 -0
  61. package/dist/lib/request/fetch-helpers.js +221 -0
  62. package/dist/lib/request/fetch-helpers.js.map +1 -0
  63. package/dist/lib/request/helpers/input-utils.d.ts +6 -0
  64. package/dist/lib/request/helpers/input-utils.d.ts.map +1 -0
  65. package/dist/lib/request/helpers/input-utils.js +174 -0
  66. package/dist/lib/request/helpers/input-utils.js.map +1 -0
  67. package/dist/lib/request/helpers/model-map.d.ts +28 -0
  68. package/dist/lib/request/helpers/model-map.d.ts.map +1 -0
  69. package/dist/lib/request/helpers/model-map.js +109 -0
  70. package/dist/lib/request/helpers/model-map.js.map +1 -0
  71. package/dist/lib/request/request-transformer.d.ts +93 -0
  72. package/dist/lib/request/request-transformer.d.ts.map +1 -0
  73. package/dist/lib/request/request-transformer.js +403 -0
  74. package/dist/lib/request/request-transformer.js.map +1 -0
  75. package/dist/lib/request/response-handler.d.ts +14 -0
  76. package/dist/lib/request/response-handler.d.ts.map +1 -0
  77. package/dist/lib/request/response-handler.js +88 -0
  78. package/dist/lib/request/response-handler.js.map +1 -0
  79. package/dist/lib/storage.d.ts +5 -0
  80. package/dist/lib/storage.d.ts.map +1 -0
  81. package/dist/lib/storage.js +46 -0
  82. package/dist/lib/storage.js.map +1 -0
  83. package/dist/lib/types.d.ts +236 -0
  84. package/dist/lib/types.d.ts.map +1 -0
  85. package/dist/lib/types.js +2 -0
  86. package/dist/lib/types.js.map +1 -0
  87. package/package.json +77 -0
  88. package/scripts/install-opencode-codex-auth.js +450 -0
  89. package/scripts/test-all-models.sh +259 -0
  90. package/scripts/validate-model-map.sh +97 -0
@@ -0,0 +1,239 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.json",
3
+ "plugin": [
4
+ "opencode-openai-codex-multi-auth"
5
+ ],
6
+ "provider": {
7
+ "openai": {
8
+ "options": {
9
+ "reasoningEffort": "medium",
10
+ "reasoningSummary": "auto",
11
+ "textVerbosity": "medium",
12
+ "include": [
13
+ "reasoning.encrypted_content"
14
+ ],
15
+ "store": false
16
+ },
17
+ "models": {
18
+ "gpt-5.2": {
19
+ "name": "GPT 5.2 (OAuth)",
20
+ "limit": {
21
+ "context": 272000,
22
+ "output": 128000
23
+ },
24
+ "modalities": {
25
+ "input": [
26
+ "text",
27
+ "image"
28
+ ],
29
+ "output": [
30
+ "text"
31
+ ]
32
+ },
33
+ "variants": {
34
+ "none": {
35
+ "reasoningEffort": "none",
36
+ "reasoningSummary": "auto",
37
+ "textVerbosity": "medium"
38
+ },
39
+ "low": {
40
+ "reasoningEffort": "low",
41
+ "reasoningSummary": "auto",
42
+ "textVerbosity": "medium"
43
+ },
44
+ "medium": {
45
+ "reasoningEffort": "medium",
46
+ "reasoningSummary": "auto",
47
+ "textVerbosity": "medium"
48
+ },
49
+ "high": {
50
+ "reasoningEffort": "high",
51
+ "reasoningSummary": "detailed",
52
+ "textVerbosity": "medium"
53
+ },
54
+ "xhigh": {
55
+ "reasoningEffort": "xhigh",
56
+ "reasoningSummary": "detailed",
57
+ "textVerbosity": "medium"
58
+ }
59
+ }
60
+ },
61
+ "gpt-5.2-codex": {
62
+ "name": "GPT 5.2 Codex (OAuth)",
63
+ "limit": {
64
+ "context": 272000,
65
+ "output": 128000
66
+ },
67
+ "modalities": {
68
+ "input": [
69
+ "text",
70
+ "image"
71
+ ],
72
+ "output": [
73
+ "text"
74
+ ]
75
+ },
76
+ "variants": {
77
+ "low": {
78
+ "reasoningEffort": "low",
79
+ "reasoningSummary": "auto",
80
+ "textVerbosity": "medium"
81
+ },
82
+ "medium": {
83
+ "reasoningEffort": "medium",
84
+ "reasoningSummary": "auto",
85
+ "textVerbosity": "medium"
86
+ },
87
+ "high": {
88
+ "reasoningEffort": "high",
89
+ "reasoningSummary": "detailed",
90
+ "textVerbosity": "medium"
91
+ },
92
+ "xhigh": {
93
+ "reasoningEffort": "xhigh",
94
+ "reasoningSummary": "detailed",
95
+ "textVerbosity": "medium"
96
+ }
97
+ }
98
+ },
99
+ "gpt-5.1-codex-max": {
100
+ "name": "GPT 5.1 Codex Max (OAuth)",
101
+ "limit": {
102
+ "context": 272000,
103
+ "output": 128000
104
+ },
105
+ "modalities": {
106
+ "input": [
107
+ "text",
108
+ "image"
109
+ ],
110
+ "output": [
111
+ "text"
112
+ ]
113
+ },
114
+ "variants": {
115
+ "low": {
116
+ "reasoningEffort": "low",
117
+ "reasoningSummary": "detailed",
118
+ "textVerbosity": "medium"
119
+ },
120
+ "medium": {
121
+ "reasoningEffort": "medium",
122
+ "reasoningSummary": "detailed",
123
+ "textVerbosity": "medium"
124
+ },
125
+ "high": {
126
+ "reasoningEffort": "high",
127
+ "reasoningSummary": "detailed",
128
+ "textVerbosity": "medium"
129
+ },
130
+ "xhigh": {
131
+ "reasoningEffort": "xhigh",
132
+ "reasoningSummary": "detailed",
133
+ "textVerbosity": "medium"
134
+ }
135
+ }
136
+ },
137
+ "gpt-5.1-codex": {
138
+ "name": "GPT 5.1 Codex (OAuth)",
139
+ "limit": {
140
+ "context": 272000,
141
+ "output": 128000
142
+ },
143
+ "modalities": {
144
+ "input": [
145
+ "text",
146
+ "image"
147
+ ],
148
+ "output": [
149
+ "text"
150
+ ]
151
+ },
152
+ "variants": {
153
+ "low": {
154
+ "reasoningEffort": "low",
155
+ "reasoningSummary": "auto",
156
+ "textVerbosity": "medium"
157
+ },
158
+ "medium": {
159
+ "reasoningEffort": "medium",
160
+ "reasoningSummary": "auto",
161
+ "textVerbosity": "medium"
162
+ },
163
+ "high": {
164
+ "reasoningEffort": "high",
165
+ "reasoningSummary": "detailed",
166
+ "textVerbosity": "medium"
167
+ }
168
+ }
169
+ },
170
+ "gpt-5.1-codex-mini": {
171
+ "name": "GPT 5.1 Codex Mini (OAuth)",
172
+ "limit": {
173
+ "context": 272000,
174
+ "output": 128000
175
+ },
176
+ "modalities": {
177
+ "input": [
178
+ "text",
179
+ "image"
180
+ ],
181
+ "output": [
182
+ "text"
183
+ ]
184
+ },
185
+ "variants": {
186
+ "medium": {
187
+ "reasoningEffort": "medium",
188
+ "reasoningSummary": "auto",
189
+ "textVerbosity": "medium"
190
+ },
191
+ "high": {
192
+ "reasoningEffort": "high",
193
+ "reasoningSummary": "detailed",
194
+ "textVerbosity": "medium"
195
+ }
196
+ }
197
+ },
198
+ "gpt-5.1": {
199
+ "name": "GPT 5.1 (OAuth)",
200
+ "limit": {
201
+ "context": 272000,
202
+ "output": 128000
203
+ },
204
+ "modalities": {
205
+ "input": [
206
+ "text",
207
+ "image"
208
+ ],
209
+ "output": [
210
+ "text"
211
+ ]
212
+ },
213
+ "variants": {
214
+ "none": {
215
+ "reasoningEffort": "none",
216
+ "reasoningSummary": "auto",
217
+ "textVerbosity": "medium"
218
+ },
219
+ "low": {
220
+ "reasoningEffort": "low",
221
+ "reasoningSummary": "auto",
222
+ "textVerbosity": "low"
223
+ },
224
+ "medium": {
225
+ "reasoningEffort": "medium",
226
+ "reasoningSummary": "auto",
227
+ "textVerbosity": "medium"
228
+ },
229
+ "high": {
230
+ "reasoningEffort": "high",
231
+ "reasoningSummary": "detailed",
232
+ "textVerbosity": "high"
233
+ }
234
+ }
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * OpenAI ChatGPT (Codex) OAuth Authentication Plugin for opencode
3
+ *
4
+ * COMPLIANCE NOTICE:
5
+ * This plugin uses OpenAI's official OAuth authentication flow (the same method
6
+ * used by OpenAI's official Codex CLI at https://github.com/openai/codex).
7
+ *
8
+ * INTENDED USE: Personal development and coding assistance with your own
9
+ * ChatGPT Plus/Pro subscription.
10
+ *
11
+ * NOT INTENDED FOR: Commercial resale, multi-user services, high-volume
12
+ * automated extraction, or any use that violates OpenAI's Terms of Service.
13
+ *
14
+ * Users are responsible for ensuring their usage complies with:
15
+ * - OpenAI Terms of Use: https://openai.com/policies/terms-of-use/
16
+ * - OpenAI Usage Policies: https://openai.com/policies/usage-policies/
17
+ *
18
+ * For production applications, use the OpenAI Platform API: https://platform.openai.com/
19
+ *
20
+ * @license MIT with Usage Disclaimer (see LICENSE file)
21
+ * @author numman-ali
22
+ * @repository https://github.com/numman-ali/opencode-openai-codex-auth
23
+ */
24
+ import { type Plugin } from "@opencode-ai/plugin";
25
+ /**
26
+ * OpenAI Codex OAuth authentication plugin for opencode
27
+ *
28
+ * This plugin enables opencode to use OpenAI's Codex backend via ChatGPT Plus/Pro
29
+ * OAuth authentication, allowing users to leverage their ChatGPT subscription
30
+ * instead of OpenAI Platform API credits.
31
+ *
32
+ * @example
33
+ * ```json
34
+ * {
35
+ * "plugin": ["opencode-openai-codex-auth"],
36
+ * "model": "openai/gpt-5-codex"
37
+ * }
38
+ * ```
39
+ */
40
+ export declare const OpenAIAuthPlugin: Plugin;
41
+ export default OpenAIAuthPlugin;
42
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AA8E1E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAgmB9B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}