MCPcopy
hub / github.com/21st-dev/1code / normalizeCodexIntegrationState

Function normalizeCodexIntegrationState

src/main/lib/trpc/routers/codex.ts:1029–1048  ·  view source on GitHub ↗
(rawOutput: string)

Source from the content-addressed store, hash-verified

1027}
1028
1029function normalizeCodexIntegrationState(rawOutput: string): CodexIntegrationState {
1030 const normalizedOutput = rawOutput.toLowerCase()
1031
1032 if (normalizedOutput.includes("logged in using chatgpt")) {
1033 return "connected_chatgpt"
1034 }
1035
1036 if (
1037 normalizedOutput.includes("logged in using an api key") ||
1038 normalizedOutput.includes("logged in using api key")
1039 ) {
1040 return "connected_api_key"
1041 }
1042
1043 if (normalizedOutput.includes("not logged in")) {
1044 return "not_logged_in"
1045 }
1046
1047 return "unknown"
1048}
1049
1050function parseStoredMessages(raw: string | null | undefined): any[] {
1051 if (!raw) return []

Callers 1

codex.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected