opencode-openai-codex-auth-multi 4.3.0-multiaccount.1

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