Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/server/src/provider/Layers/CodexProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,18 @@ function codexAccountAuthLabel(account: CodexSchema.V2GetAccountResponse["accoun
return "ChatGPT Pro 5x Subscription";
case "team":
return "ChatGPT Team Subscription";
case "self_serve_business_prolite":
case "self_serve_business_usage_based":
case "business":
return "ChatGPT Business Subscription";
case "ent26":
case "enterprise_cbp_automation":
case "enterprise_cbp_usage_based":
case "enterprise":
return "ChatGPT Enterprise Subscription";
case "edu":
case "edu_plus":
case "edu_pro":
return "ChatGPT Edu Subscription";
case "unknown":
return "ChatGPT Subscription";
Expand Down
22 changes: 22 additions & 0 deletions packages/effect-codex-app-server/scripts/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,28 @@ const Codex0150DefinitionSchemas: Record<string, Schema.Json> = {
type: "string",
enum: ["inProgress", "completed", "failed", "interrupted"],
},
PlanType: {
type: "string",
enum: [
"free",
"go",
"plus",
"pro",
"prolite",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
"business",
"ent26",
"enterprise_cbp_automation",
"enterprise_cbp_usage_based",
"enterprise",
"edu",
"edu_plus",
"edu_pro",
"unknown",
],
},
SubAgentActivityKind: {
type: "string",
enum: ["started", "interacted", "interrupted", "completed"],
Expand Down
50 changes: 50 additions & 0 deletions packages/effect-codex-app-server/src/_generated/schema.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2411,11 +2411,16 @@ export type ServerNotification__PlanType =
| "pro"
| "prolite"
| "team"
| "self_serve_business_prolite"
| "self_serve_business_usage_based"
| "business"
| "ent26"
| "enterprise_cbp_automation"
| "enterprise_cbp_usage_based"
| "enterprise"
| "edu"
| "edu_plus"
| "edu_pro"
| "unknown";
export const ServerNotification__PlanType = Schema.Literals([
"free",
Expand All @@ -2424,11 +2429,16 @@ export const ServerNotification__PlanType = Schema.Literals([
"pro",
"prolite",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
"business",
"ent26",
"enterprise_cbp_automation",
"enterprise_cbp_usage_based",
"enterprise",
"edu",
"edu_plus",
"edu_pro",
"unknown",
]);

Expand Down Expand Up @@ -3248,11 +3258,16 @@ export type V2AccountRateLimitsUpdatedNotification__PlanType =
| "pro"
| "prolite"
| "team"
| "self_serve_business_prolite"
| "self_serve_business_usage_based"
| "business"
| "ent26"
| "enterprise_cbp_automation"
| "enterprise_cbp_usage_based"
| "enterprise"
| "edu"
| "edu_plus"
| "edu_pro"
| "unknown";
export const V2AccountRateLimitsUpdatedNotification__PlanType = Schema.Literals([
"free",
Expand All @@ -3261,11 +3276,16 @@ export const V2AccountRateLimitsUpdatedNotification__PlanType = Schema.Literals(
"pro",
"prolite",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
"business",
"ent26",
"enterprise_cbp_automation",
"enterprise_cbp_usage_based",
"enterprise",
"edu",
"edu_plus",
"edu_pro",
"unknown",
]);

Expand Down Expand Up @@ -3336,11 +3356,16 @@ export type V2AccountUpdatedNotification__PlanType =
| "pro"
| "prolite"
| "team"
| "self_serve_business_prolite"
| "self_serve_business_usage_based"
| "business"
| "ent26"
| "enterprise_cbp_automation"
| "enterprise_cbp_usage_based"
| "enterprise"
| "edu"
| "edu_plus"
| "edu_pro"
| "unknown";
export const V2AccountUpdatedNotification__PlanType = Schema.Literals([
"free",
Expand All @@ -3349,11 +3374,16 @@ export const V2AccountUpdatedNotification__PlanType = Schema.Literals([
"pro",
"prolite",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
"business",
"ent26",
"enterprise_cbp_automation",
"enterprise_cbp_usage_based",
"enterprise",
"edu",
"edu_plus",
"edu_pro",
"unknown",
]);

Expand Down Expand Up @@ -4140,11 +4170,16 @@ export type V2GetAccountRateLimitsResponse__PlanType =
| "pro"
| "prolite"
| "team"
| "self_serve_business_prolite"
| "self_serve_business_usage_based"
| "business"
| "ent26"
| "enterprise_cbp_automation"
| "enterprise_cbp_usage_based"
| "enterprise"
| "edu"
| "edu_plus"
| "edu_pro"
| "unknown";
export const V2GetAccountRateLimitsResponse__PlanType = Schema.Literals([
"free",
Expand All @@ -4153,11 +4188,16 @@ export const V2GetAccountRateLimitsResponse__PlanType = Schema.Literals([
"pro",
"prolite",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
"business",
"ent26",
"enterprise_cbp_automation",
"enterprise_cbp_usage_based",
"enterprise",
"edu",
"edu_plus",
"edu_pro",
"unknown",
]);

Expand Down Expand Up @@ -4228,11 +4268,16 @@ export type V2GetAccountResponse__PlanType =
| "pro"
| "prolite"
| "team"
| "self_serve_business_prolite"
| "self_serve_business_usage_based"
| "business"
| "ent26"
| "enterprise_cbp_automation"
| "enterprise_cbp_usage_based"
| "enterprise"
| "edu"
| "edu_plus"
| "edu_pro"
| "unknown";
export const V2GetAccountResponse__PlanType = Schema.Literals([
"free",
Expand All @@ -4241,11 +4286,16 @@ export const V2GetAccountResponse__PlanType = Schema.Literals([
"pro",
"prolite",
"team",
"self_serve_business_prolite",
"self_serve_business_usage_based",
"business",
"ent26",
"enterprise_cbp_automation",
"enterprise_cbp_usage_based",
"enterprise",
"edu",
"edu_plus",
"edu_pro",
"unknown",
]);

Expand Down
25 changes: 25 additions & 0 deletions packages/effect-codex-app-server/src/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as Schema from "effect/Schema";

import * as CodexSchema from "./schema.ts";

const isGetAccountResponse = Schema.is(CodexSchema.V2GetAccountResponse);

it("accepts Codex 0.150 multi-agent values", () => {
const schemas = [
CodexSchema.ServerNotification__SubAgentActivityKind,
Expand Down Expand Up @@ -71,3 +73,26 @@ it("accepts Codex 0.150 multi-agent values", () => {

assert.equal(Schema.is(CodexSchema.V2ThreadResumeResponse)(resumeResponse), true);
});

it("accepts Codex 0.150 account plan values", () => {
const planTypes = [
"self_serve_business_prolite",
"ent26",
"enterprise_cbp_automation",
"edu_plus",
"edu_pro",
];

for (const planType of planTypes) {
const accountResponse = {
account: {
email: "user@example.com",
planType,
type: "chatgpt",
},
requiresOpenaiAuth: true,
};

assert.equal(isGetAccountResponse(accountResponse), true);
}
});
Loading