@moxxy/plugin-provider-openai-codex 0.29.0 → 0.31.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB,kCAajC,CAAC;AAEH,eAAO,MAAM,iBAAiB,6BAI5B,CAAC;AAEH,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,SAAS,EACT,MAAM,EACN,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,IAAI,qBAAqB,GAC1C,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB,kCAiCjC,CAAC;AAEH,eAAO,MAAM,iBAAiB,6BAI5B,CAAC;AAEH,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,SAAS,EACT,MAAM,EACN,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,IAAI,qBAAqB,GAC1C,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,17 +1,37 @@
1
- import { defineProvider, definePlugin } from '@moxxy/sdk';
1
+ import { defineProvider, definePlugin, MoxxyError } from '@moxxy/sdk';
2
2
  import { CodexProvider } from './provider.js';
3
3
  import { codexModels } from './models.js';
4
- import { codexLogin, codexLogout, codexStatus } from './login.js';
4
+ import { codexLogin, codexLogout, codexStatus, persistCodexTokens, readStoredTokens, } from './login.js';
5
5
  import { PLUGIN_VERSION } from './codex/headers.js';
6
6
  export const openaiCodexProviderDef = defineProvider({
7
7
  name: 'openai-codex',
8
8
  models: [...codexModels],
9
9
  createClient: (config) => new CodexProvider(config),
10
+ async resolveCredentials({ vault, providerConfig }) {
11
+ const tokens = await readStoredTokens(vault).catch(() => null);
12
+ if (!tokens) {
13
+ throw new MoxxyError({
14
+ code: 'AUTH_NO_CREDENTIALS',
15
+ message: 'No ChatGPT OAuth credentials found in the vault.',
16
+ hint: 'Run `moxxy login openai-codex` to sign in with your ChatGPT Pro/Plus account.',
17
+ context: { provider: 'openai-codex' },
18
+ });
19
+ }
20
+ return {
21
+ ...providerConfig,
22
+ tokens,
23
+ onTokensRefreshed: (next) => persistCodexTokens(vault, next),
24
+ reloadTokens: () => readStoredTokens(vault),
25
+ };
26
+ },
10
27
  // No validateKey: OAuth credentials are validated by the OAuth token
11
28
  // exchange itself, not by a synchronous key check.
12
29
  auth: {
13
30
  kind: 'oauth',
14
31
  serviceName: 'ChatGPT Pro/Plus',
32
+ // The codex profile carries a device-flow adapter, so `codexLogin` honours
33
+ // `ctx.headless` with a real no-browser flow — let hosts offer the choice.
34
+ supportsHeadless: true,
15
35
  login: codexLogin,
16
36
  logout: codexLogout,
17
37
  status: codexStatus,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,aAAa,EAA4B,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;IACnD,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,CAAC,GAAG,WAAW,CAAC;IACxB,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,MAA6B,CAAC;IAC1E,qEAAqE;IACrE,mDAAmD;IACnD,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,kBAAkB;QAC/B,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,WAAW;KACpB;CACF,CAAC,CAAC;AAEH,MAAM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mB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,SAAS,EACT,MAAM,EACN,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,IAAI,qBAAqB,GAC1C,MAAM,YAAY,CAAC"}
package/dist/models.d.ts CHANGED
@@ -6,5 +6,5 @@ import type { ModelDescriptor } from '@moxxy/sdk';
6
6
  * routes to ChatGPT-Pro/Plus subscribers without per-token billing.
7
7
  */
8
8
  export declare const codexModels: ReadonlyArray<ModelDescriptor>;
9
- export declare const DEFAULT_CODEX_MODEL = "gpt-5.3-codex";
9
+ export declare const DEFAULT_CODEX_MODEL = "gpt-5.6-sol";
10
10
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;GAKG;AAIH,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,eAAe,CAYtD,CAAC;AAEF,eAAO,MAAM,mBAAmB,kBAAkB,CAAC"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;GAKG;AAIH,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,eAAe,CAmBtD,CAAC;AAIF,eAAO,MAAM,mBAAmB,gBAAgB,CAAC"}
package/dist/models.js CHANGED
@@ -13,6 +13,13 @@ export const codexModels = [
13
13
  // the proactive compactor's `estimatedTokens > 0.75 * contextWindow` gate
14
14
  // unreachable, so every overflow fell through to the reactive
15
15
  // compact-on-overflow retry. Keep these in step with the rest of the catalog.
16
+ // GPT-5.6 family (GA July 9, 2026): served to ChatGPT-Pro/Plus subscribers
17
+ // under the same ids the API uses (sol/terra/luna — no `-codex` variant).
18
+ // Sol is OpenAI's default Codex model. The ChatGPT-plan window cap applies
19
+ // here too, so keep them at 400k like the rest of this list.
20
+ { id: 'gpt-5.6-sol', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
21
+ { id: 'gpt-5.6-terra', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
22
+ { id: 'gpt-5.6-luna', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
16
23
  { id: 'gpt-5.5', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
17
24
  { id: 'gpt-5.4', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
18
25
  { id: 'gpt-5.4-mini', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
@@ -20,5 +27,7 @@ export const codexModels = [
20
27
  { id: 'gpt-5.3-codex-spark', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
21
28
  { id: 'gpt-5.2', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
22
29
  ];
23
- export const DEFAULT_CODEX_MODEL = 'gpt-5.3-codex';
30
+ // OpenAI's own Codex default moved to gpt-5.6-sol at GA (July 9, 2026); mirror
31
+ // it so a ChatGPT-plan user who hasn't pinned a model gets the current flagship.
32
+ export const DEFAULT_CODEX_MODEL = 'gpt-5.6-sol';
24
33
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,+EAA+E;AAC/E,+EAA+E;AAC/E,mEAAmE;AACnE,MAAM,CAAC,MAAM,WAAW,GAAmC;IACzD,8EAA8E;IAC9E,6EAA6E;IAC7E,0EAA0E;IAC1E,8DAA8D;IAC9D,8EAA8E;IAC9E,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE;IACzL,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE;IACzL,EAAE,EAAE,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE;IAC9L,EAAE,EAAE,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,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E,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE;IACrM,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE;CAC1L,CAAC;AAEF,+EAA+E;AAC/E,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxxy/plugin-provider-openai-codex",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "OpenAI Codex (ChatGPT Pro/Plus OAuth) LLMProvider plugin for moxxy. Streams against https://chatgpt.com/backend-api/codex/responses using PKCE-based OAuth tokens.",
5
5
  "keywords": [
6
6
  "moxxy",
@@ -43,11 +43,24 @@
43
43
  "plugin": {
44
44
  "entry": "./dist/index.js",
45
45
  "kind": "provider"
46
+ },
47
+ "catalog": {
48
+ "label": "OpenAI Codex (ChatGPT sign-in)",
49
+ "description": "Codex models through a ChatGPT subscription sign-in.",
50
+ "provides": [
51
+ {
52
+ "category": "provider",
53
+ "name": "openai-codex"
54
+ }
55
+ ],
56
+ "provider": {
57
+ "auth": "oauth"
58
+ }
46
59
  }
47
60
  },
48
61
  "dependencies": {
49
- "@moxxy/sdk": "0.29.0",
50
- "@moxxy/plugin-oauth": "0.29.0"
62
+ "@moxxy/sdk": "0.31.0",
63
+ "@moxxy/plugin-oauth": "0.31.0"
51
64
  },
52
65
  "devDependencies": {
53
66
  "@types/node": "^22.10.0",
package/src/index.ts CHANGED
@@ -1,18 +1,45 @@
1
- import { defineProvider, definePlugin } from '@moxxy/sdk';
1
+ import { defineProvider, definePlugin, MoxxyError } from '@moxxy/sdk';
2
2
  import { CodexProvider, type CodexProviderConfig } from './provider.js';
3
3
  import { codexModels } from './models.js';
4
- import { codexLogin, codexLogout, codexStatus } from './login.js';
4
+ import {
5
+ codexLogin,
6
+ codexLogout,
7
+ codexStatus,
8
+ persistCodexTokens,
9
+ readStoredTokens,
10
+ } from './login.js';
11
+ import type { CodexTokens } from './types.js';
5
12
  import { PLUGIN_VERSION } from './codex/headers.js';
6
13
 
7
14
  export const openaiCodexProviderDef = defineProvider({
8
15
  name: 'openai-codex',
9
16
  models: [...codexModels],
10
17
  createClient: (config) => new CodexProvider(config as CodexProviderConfig),
18
+ async resolveCredentials({ vault, providerConfig }) {
19
+ const tokens = await readStoredTokens(vault).catch(() => null);
20
+ if (!tokens) {
21
+ throw new MoxxyError({
22
+ code: 'AUTH_NO_CREDENTIALS',
23
+ message: 'No ChatGPT OAuth credentials found in the vault.',
24
+ hint: 'Run `moxxy login openai-codex` to sign in with your ChatGPT Pro/Plus account.',
25
+ context: { provider: 'openai-codex' },
26
+ });
27
+ }
28
+ return {
29
+ ...providerConfig,
30
+ tokens,
31
+ onTokensRefreshed: (next: CodexTokens) => persistCodexTokens(vault, next),
32
+ reloadTokens: () => readStoredTokens(vault),
33
+ };
34
+ },
11
35
  // No validateKey: OAuth credentials are validated by the OAuth token
12
36
  // exchange itself, not by a synchronous key check.
13
37
  auth: {
14
38
  kind: 'oauth',
15
39
  serviceName: 'ChatGPT Pro/Plus',
40
+ // The codex profile carries a device-flow adapter, so `codexLogin` honours
41
+ // `ctx.headless` with a real no-browser flow — let hosts offer the choice.
42
+ supportsHeadless: true,
16
43
  login: codexLogin,
17
44
  logout: codexLogout,
18
45
  status: codexStatus,
package/src/models.ts CHANGED
@@ -15,6 +15,13 @@ export const codexModels: ReadonlyArray<ModelDescriptor> = [
15
15
  // the proactive compactor's `estimatedTokens > 0.75 * contextWindow` gate
16
16
  // unreachable, so every overflow fell through to the reactive
17
17
  // compact-on-overflow retry. Keep these in step with the rest of the catalog.
18
+ // GPT-5.6 family (GA July 9, 2026): served to ChatGPT-Pro/Plus subscribers
19
+ // under the same ids the API uses (sol/terra/luna — no `-codex` variant).
20
+ // Sol is OpenAI's default Codex model. The ChatGPT-plan window cap applies
21
+ // here too, so keep them at 400k like the rest of this list.
22
+ { id: 'gpt-5.6-sol', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
23
+ { id: 'gpt-5.6-terra', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
24
+ { id: 'gpt-5.6-luna', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
18
25
  { id: 'gpt-5.5', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
19
26
  { id: 'gpt-5.4', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
20
27
  { id: 'gpt-5.4-mini', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
@@ -23,4 +30,6 @@ export const codexModels: ReadonlyArray<ModelDescriptor> = [
23
30
  { id: 'gpt-5.2', contextWindow: 400_000, maxOutputTokens: 128_000, supportsTools: true, supportsStreaming: true, supportsImages: true, supportsDocuments: true, supportsReasoning: true },
24
31
  ];
25
32
 
26
- export const DEFAULT_CODEX_MODEL = 'gpt-5.3-codex';
33
+ // OpenAI's own Codex default moved to gpt-5.6-sol at GA (July 9, 2026); mirror
34
+ // it so a ChatGPT-plan user who hasn't pinned a model gets the current flagship.
35
+ export const DEFAULT_CODEX_MODEL = 'gpt-5.6-sol';