openai-ws-opencode 0.1.2 → 0.1.3
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.
- package/README.md +2 -2
- package/dist/auth/oauth.js +2 -2
- package/dist/constants.d.ts +2 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/models/resolve.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ This path uses the Codex/ChatGPT backend and sends:
|
|
|
82
82
|
|
|
83
83
|
- `Authorization: Bearer <access-token>`
|
|
84
84
|
- `ChatGPT-Account-Id` when available
|
|
85
|
-
- `originator:
|
|
85
|
+
- `originator: opencode`
|
|
86
86
|
- `OpenAI-Beta: responses_websockets=2026-02-06`
|
|
87
87
|
|
|
88
88
|
Important: the OAuth/Codex WebSocket path is unofficial, reuses Codex OAuth behavior, targets a private ChatGPT backend, can break without notice, and may carry account or terms-of-service risk. This project is not affiliated with OpenAI or OpenCode.
|
|
@@ -101,7 +101,7 @@ Then point OpenCode at the packed tarball through the plugin array:
|
|
|
101
101
|
|
|
102
102
|
```jsonc
|
|
103
103
|
{
|
|
104
|
-
"plugin": ["openai-ws-opencode@file:/absolute/path/openai-ws-opencode-0.1.
|
|
104
|
+
"plugin": ["openai-ws-opencode@file:/absolute/path/openai-ws-opencode-0.1.3.tgz"]
|
|
105
105
|
}
|
|
106
106
|
```
|
|
107
107
|
|
package/dist/auth/oauth.js
CHANGED
|
@@ -175,7 +175,7 @@ export async function createBrowserAuthorization() {
|
|
|
175
175
|
export async function createDeviceAuthorization() {
|
|
176
176
|
const deviceResponse = await fetch(`${ISSUER}/api/accounts/deviceauth/usercode`, {
|
|
177
177
|
method: "POST",
|
|
178
|
-
headers: { "Content-Type": "application/json", "User-Agent": "openai-ws-opencode/0.1.
|
|
178
|
+
headers: { "Content-Type": "application/json", "User-Agent": "openai-ws-opencode/0.1.3" },
|
|
179
179
|
body: JSON.stringify({ client_id: CLIENT_ID }),
|
|
180
180
|
});
|
|
181
181
|
if (!deviceResponse.ok)
|
|
@@ -190,7 +190,7 @@ export async function createDeviceAuthorization() {
|
|
|
190
190
|
for (;;) {
|
|
191
191
|
const response = await fetch(`${ISSUER}/api/accounts/deviceauth/token`, {
|
|
192
192
|
method: "POST",
|
|
193
|
-
headers: { "Content-Type": "application/json", "User-Agent": "openai-ws-opencode/0.1.
|
|
193
|
+
headers: { "Content-Type": "application/json", "User-Agent": "openai-ws-opencode/0.1.3" },
|
|
194
194
|
body: JSON.stringify({
|
|
195
195
|
device_auth_id: deviceData.device_auth_id,
|
|
196
196
|
user_code: deviceData.user_code,
|
package/dist/constants.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export declare const CODEX_API_ENDPOINT = "https://chatgpt.com/backend-api/codex
|
|
|
7
7
|
export declare const OPENAI_WS_URL = "wss://api.openai.com/v1/responses";
|
|
8
8
|
export declare const CODEX_WS_URL = "wss://chatgpt.com/backend-api/codex/responses";
|
|
9
9
|
export declare const OPENAI_WS_BETA = "responses_websockets=2026-02-06";
|
|
10
|
-
export declare const CODEX_ORIGINATOR = "
|
|
11
|
-
export declare const CODEX_OAUTH_SCOPE = "openid profile email offline_access
|
|
10
|
+
export declare const CODEX_ORIGINATOR = "opencode";
|
|
11
|
+
export declare const CODEX_OAUTH_SCOPE = "openid profile email offline_access";
|
|
12
12
|
export declare const OAUTH_PORT = 1455;
|
|
13
13
|
export declare const OAUTH_FALLBACK_PORT = 1457;
|
|
14
14
|
export declare const DEFAULT_INSTRUCTIONS = "You are a helpful assistant.";
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,cAAc,CAAA;AAEtC,eAAO,MAAM,SAAS,iCAAiC,CAAA;AACvD,eAAO,MAAM,MAAM,4BAA4B,CAAA;AAC/C,eAAO,MAAM,eAAe,8BAA8B,CAAA;AAC1D,eAAO,MAAM,cAAc,0CAA0C,CAAA;AACrE,eAAO,MAAM,kBAAkB,oDAAgC,CAAA;AAC/D,eAAO,MAAM,aAAa,sCAAsC,CAAA;AAChE,eAAO,MAAM,YAAY,kDAAkD,CAAA;AAC3E,eAAO,MAAM,cAAc,oCAAoC,CAAA;AAC/D,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,cAAc,CAAA;AAEtC,eAAO,MAAM,SAAS,iCAAiC,CAAA;AACvD,eAAO,MAAM,MAAM,4BAA4B,CAAA;AAC/C,eAAO,MAAM,eAAe,8BAA8B,CAAA;AAC1D,eAAO,MAAM,cAAc,0CAA0C,CAAA;AACrE,eAAO,MAAM,kBAAkB,oDAAgC,CAAA;AAC/D,eAAO,MAAM,aAAa,sCAAsC,CAAA;AAChE,eAAO,MAAM,YAAY,kDAAkD,CAAA;AAC3E,eAAO,MAAM,cAAc,oCAAoC,CAAA;AAC/D,eAAO,MAAM,gBAAgB,aAAa,CAAA;AAC1C,eAAO,MAAM,iBAAiB,wCAAwC,CAAA;AACtE,eAAO,MAAM,UAAU,OAAO,CAAA;AAC9B,eAAO,MAAM,mBAAmB,OAAO,CAAA;AACvC,eAAO,MAAM,oBAAoB,iCAAiC,CAAA;AAElE,eAAO,MAAM,uBAAuB,oCAAoC,CAAA;AACxE,eAAO,MAAM,qBAAqB,+BAA+B,CAAA;AACjE,eAAO,MAAM,qBAAqB,kCAAkC,CAAA;AACpE,eAAO,MAAM,2BAA2B,qCAAqC,CAAA"}
|
package/dist/constants.js
CHANGED
|
@@ -7,8 +7,8 @@ export const CODEX_API_ENDPOINT = `${CODEX_API_BASE}/responses`;
|
|
|
7
7
|
export const OPENAI_WS_URL = "wss://api.openai.com/v1/responses";
|
|
8
8
|
export const CODEX_WS_URL = "wss://chatgpt.com/backend-api/codex/responses";
|
|
9
9
|
export const OPENAI_WS_BETA = "responses_websockets=2026-02-06";
|
|
10
|
-
export const CODEX_ORIGINATOR = "
|
|
11
|
-
export const CODEX_OAUTH_SCOPE = "openid profile email offline_access
|
|
10
|
+
export const CODEX_ORIGINATOR = "opencode";
|
|
11
|
+
export const CODEX_OAUTH_SCOPE = "openid profile email offline_access";
|
|
12
12
|
export const OAUTH_PORT = 1455;
|
|
13
13
|
export const OAUTH_FALLBACK_PORT = 1457;
|
|
14
14
|
export const DEFAULT_INSTRUCTIONS = "You are a helpful assistant.";
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAA;AAEtC,MAAM,CAAC,MAAM,SAAS,GAAG,8BAA8B,CAAA;AACvD,MAAM,CAAC,MAAM,MAAM,GAAG,yBAAyB,CAAA;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,2BAA2B,CAAA;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAG,uCAAuC,CAAA;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,cAAc,YAAY,CAAA;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,mCAAmC,CAAA;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG,+CAA+C,CAAA;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,iCAAiC,CAAA;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAA;AAEtC,MAAM,CAAC,MAAM,SAAS,GAAG,8BAA8B,CAAA;AACvD,MAAM,CAAC,MAAM,MAAM,GAAG,yBAAyB,CAAA;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,2BAA2B,CAAA;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAG,uCAAuC,CAAA;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,cAAc,YAAY,CAAA;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,mCAAmC,CAAA;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG,+CAA+C,CAAA;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,iCAAiC,CAAA;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAA;AAC1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,qCAAqC,CAAA;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,8BAA8B,CAAA;AAElE,MAAM,CAAC,MAAM,uBAAuB,GAAG,iCAAiC,CAAA;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAA;AACjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,+BAA+B,CAAA;AACpE,MAAM,CAAC,MAAM,2BAA2B,GAAG,kCAAkC,CAAA"}
|
package/dist/models/resolve.js
CHANGED
|
@@ -103,7 +103,7 @@ export async function resolveModelsBestEffort(overrides = {}, options = {}) {
|
|
|
103
103
|
try {
|
|
104
104
|
const response = await fetchImpl("https://models.dev/api.json", {
|
|
105
105
|
signal: AbortSignal.timeout(timeoutMs),
|
|
106
|
-
headers: { "User-Agent": "openai-ws-opencode/0.1.
|
|
106
|
+
headers: { "User-Agent": "openai-ws-opencode/0.1.3" },
|
|
107
107
|
});
|
|
108
108
|
if (!response.ok)
|
|
109
109
|
return resolveModels(overrides);
|