@cortexkit/pi-openai-auth 0.3.4 → 0.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 (2) hide show
  1. package/dist/index.js +2 -20
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createAssistantMessageEventStream, streamSimpleOpenAICodexResponses, } from '@earendil-works/pi-ai';
2
- import { loginOpenAICodex, refreshOpenAICodexToken, } from '@earendil-works/pi-ai/oauth';
1
+ import { createAssistantMessageEventStream } from '@earendil-works/pi-ai';
2
+ import { streamSimple as streamSimpleOpenAICodexResponses } from '@earendil-works/pi-ai/api/openai-codex-responses';
3
3
  import { RawWebSocket } from "./raw-ws-node.js";
4
4
  const BASE_URL = 'https://chatgpt.com/backend-api';
5
5
  class PiRawCodexWebSocket extends RawWebSocket {
@@ -83,18 +83,6 @@ const OPENAI_CODEX_MODELS = [
83
83
  maxTokens: 128_000,
84
84
  },
85
85
  ];
86
- async function loginOpenAI(callbacks) {
87
- return loginOpenAICodex({
88
- onAuth: callbacks.onAuth,
89
- onPrompt: callbacks.onPrompt,
90
- onProgress: callbacks.onProgress,
91
- onManualCodeInput: callbacks.onManualCodeInput,
92
- originator: 'pi',
93
- });
94
- }
95
- async function refreshOpenAI(credentials) {
96
- return refreshOpenAICodexToken(credentials.refresh);
97
- }
98
86
  function streamOpenAI(model, context, options) {
99
87
  const outer = createAssistantMessageEventStream();
100
88
  const restoreWebSocket = installRawCodexWebSocket();
@@ -156,12 +144,6 @@ export default function cortexKitPiOpenAIAuth(pi) {
156
144
  baseUrl: BASE_URL,
157
145
  api: 'openai-codex-responses',
158
146
  models: OPENAI_CODEX_MODELS,
159
- oauth: {
160
- name: 'ChatGPT Plus/Pro (CortexKit)',
161
- login: loginOpenAI,
162
- refreshToken: refreshOpenAI,
163
- getApiKey: (credentials) => credentials.access,
164
- },
165
147
  streamSimple: streamOpenAI,
166
148
  });
167
149
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-openai-auth",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  "prepublishOnly": "bun run build"
38
38
  },
39
39
  "peerDependencies": {
40
- "@earendil-works/pi-ai": "*",
41
- "@earendil-works/pi-coding-agent": "*",
42
- "@earendil-works/pi-tui": "*"
40
+ "@earendil-works/pi-ai": ">=0.80.10",
41
+ "@earendil-works/pi-coding-agent": ">=0.80.10",
42
+ "@earendil-works/pi-tui": ">=0.80.10"
43
43
  }
44
44
  }