Open History to see the last commit
1import * as DateTime from "effect/DateTime";
2import * as Duration from "effect/Duration";
3import * as Effect from "effect/Effect";
4import * as Layer from "effect/Layer";
5import * as Option from "effect/Option";
6import * as Result from "effect/Result";
7import * as Schema from "effect/Schema";
8import * as Scope from "effect/Scope";
9import * as Types from "effect/Types";
10import * as ChildProcess from "effect/unstable/process/ChildProcess";
11import * as ChildProcessSpawner from "effect/unstable/process/ChildProcessSpawner";
12import * as CodexClient from "effect-codex-app-server/client";
13import * as CodexSchema from "effect-codex-app-server/schema";
14import * as CodexErrors from "effect-codex-app-server/errors";
15
16import type {
17 CodexSettings,
18 CustomModelSetting,
19 ServerProvider,
20 ServerProviderState,
21 ModelCapabilities,
22 ProviderOptionDescriptor,
23 ServerProviderModel,
24 ServerProviderSkill,
25} from "@t3tools/contracts";
26import { PREFERRED_DEFAULT_CODEX_MODELS, ServerSettingsError } from "@t3tools/contracts";
27
28import { createModelCapabilities, readCustomModelEntries } from "@t3tools/shared/model";
29import { resolveSpawnCommand } from "@t3tools/shared/shell";
30import { codexAppServerArgs, resolveCodexLaunchArgs } from "./codexLaunchArgs.ts";
31import {
32 AUTH_PROBE_TIMEOUT_MS,
33 buildServerProvider,
34 COMPACT_SLASH_COMMAND,
35 type ServerProviderDraft,
36} from "../providerSnapshot.ts";
37import { expandHomePath } from "../../pathExpansion.ts";
38import { makeUnavailableUsageLimits } from "../providerUsageLimits.ts";
39import {
40 codexRateLimitsFailureMessage,
41 codexRateLimitsToLimits,
42 type CodexRateLimitSnapshot,
43 type CodexResetCreditsSummary,
44} from "./codexUsageLimits.ts";
45import packageJson from "../../../package.json" with { type: "json" };
46const isCodexAppServerSpawnError = Schema.is(CodexErrors.CodexAppServerSpawnError);
47const RATE_LIMITS_PROBE_TIMEOUT_MS = 3_000;
48
49type CodexRateLimitsProbe =
50 | {
51 readonly snapshot: CodexRateLimitSnapshot;
52 readonly resetCredits: CodexResetCreditsSummary | null | undefined;
53 }
54 | { readonly failure: string };
55
56const CODEX_APP_SERVER_PROBE_FORCE_KILL_AFTER = "2 seconds" as const;
57
58const CODEX_PRESENTATION = {
59 displayName: "Codex",
60 showInteractionModeToggle: true,
61} as const;
62
63export interface CodexAppServerProviderSnapshot {
64 readonly account: CodexSchema.V2GetAccountResponse;
65 readonly rateLimits?: CodexRateLimitsProbe;
66 readonly version: string | undefined;
67 readonly models: ReadonlyArray<ServerProviderModel>;
68 readonly skills: ReadonlyArray<ServerProviderSkill>;
69}
70
71const REASONING_EFFORT_LABELS: Readonly<Record<string, string>> = {
72 none: "None",
73 minimal: "Minimal",
74 low: "Low",
75 medium: "Medium",
76 high: "High",
77 xhigh: "Extra High",
78 max: "Max",
79 ultra: "Ultra",
80};
81
82const DEFAULT_SERVICE_TIER_ID = "default";
83
84function reasoningEffortLabel(reasoningEffort: string): string {
85 return REASONING_EFFORT_LABELS[reasoningEffort] ?? reasoningEffort;
86}
87
88function codexAccountAuthLabel(account: CodexSchema.V2GetAccountResponse["account"]) {
89 if (!account) return undefined;
90 if (account.type === "apiKey") return "OpenAI API Key";
91 if (account.type === "amazonBedrock") return "Amazon Bedrock";
92 if (account.type !== "chatgpt") return undefined;
93 return codexPlanLabel(account.planType);
94}
95
96/** Shared with usage-limit sources, which report the same `planType` slugs. */
97export function codexPlanLabel(planType: string | null | undefined): string | undefined {
98 switch (planType) {
99 case "free":
100 return "ChatGPT Free Subscription";
101 case "go":
102 return "ChatGPT Go Subscription";
103 case "plus":
104 return "ChatGPT Plus Subscription";
105 case "pro":
106 return "ChatGPT Pro 20x Subscription";
107 case "prolite":
108 return "ChatGPT Pro 5x Subscription";
109 case "team":
110 return "ChatGPT Team Subscription";
111 case "self_serve_business_prolite":
112 case "self_serve_business_usage_based":
113 case "business":
114 return "ChatGPT Business Subscription";
115 case "ent26":
116 case "enterprise_cbp_automation":
117 case "enterprise_cbp_usage_based":
118 case "enterprise":
119 return "ChatGPT Enterprise Subscription";
120 case "edu":
121 case "edu_plus":
122 case "edu_pro":
123 return "ChatGPT Edu Subscription";
124 case "unknown":
125 return "ChatGPT Subscription";
126 default:
127 return undefined;
128 }
129}
130
131function codexAccountEmail(account: CodexSchema.V2GetAccountResponse["account"]) {
132 if (!account || account.type !== "chatgpt") return undefined;
133 return account.email;
134}
135
136export function mapCodexModelCapabilities(
137 model: CodexSchema.V2ModelListResponse__Model,
138): ModelCapabilities {
139 const reasoningOptions = model.supportedReasoningEfforts.map(({ reasoningEffort }) =>
140 reasoningEffort === model.defaultReasoningEffort
141 ? {
142 id: reasoningEffort,
143 label: reasoningEffortLabel(reasoningEffort),
144 isDefault: true,
145 }
146 : {
147 id: reasoningEffort,
148 label: reasoningEffortLabel(reasoningEffort),
149 },
150 );
151 const defaultReasoning = reasoningOptions.find((option) => option.isDefault)?.id;
152 const serviceTiers =
153 model.serviceTiers && model.serviceTiers.length > 0
154 ? model.serviceTiers
155 : (model.additionalSpeedTiers ?? []).map((id) => ({
156 id,
157 name: id === "fast" ? "Fast" : id,
158 description: "",
159 }));
160 const catalogDefaultServiceTier = serviceTiers.some(
161 (tier) => tier.id === model.defaultServiceTier,
162 )
163 ? model.defaultServiceTier
164 : null;
165 const defaultServiceTier = catalogDefaultServiceTier ?? DEFAULT_SERVICE_TIER_ID;
166 const optionDescriptors: ProviderOptionDescriptor[] = [];
167
168 if (reasoningOptions.length > 0) {
169 optionDescriptors.push({
170 id: "reasoningEffort",
171 label: "Reasoning",
172 type: "select",
173 options: reasoningOptions,
174 ...(defaultReasoning ? { currentValue: defaultReasoning } : {}),
175 });
176 }
177 if (serviceTiers.length > 0) {
178 optionDescriptors.push({
179 id: "serviceTier",
180 label: "Service Tier",
181 type: "select",
182 options: [
183 {
184 id: DEFAULT_SERVICE_TIER_ID,
185 label: "Standard",
186 ...(defaultServiceTier === DEFAULT_SERVICE_TIER_ID ? { isDefault: true } : {}),
187 },
188 ...serviceTiers.map((tier) => ({
189 id: tier.id,
190 label: tier.name,
191 ...(tier.description ? { description: tier.description } : {}),
192 ...(defaultServiceTier === tier.id ? { isDefault: true } : {}),
193 })),
194 ],
195 currentValue: defaultServiceTier,
196 });
197 }
198
199 return createModelCapabilities({
200 optionDescriptors,
201 });
202}
203
204const toDisplayName = (model: CodexSchema.V2ModelListResponse__Model): string => {
205 // Capitalize 'gpt' to 'GPT-' and capitalize any letter following a dash
206 return model.displayName
207 .replace(/^gpt/i, "GPT") // Handle start with 'gpt' or 'GPT'
208 .replace(/-([a-z])/g, (_, c) => "-" + c.toUpperCase());
209};
210
211function parseCodexModelListResponse(
212 response: CodexSchema.V2ModelListResponse,
213): ReadonlyArray<ServerProviderModel> {
214 return response.data.map((model) => ({
215 slug: model.model,
216 name: toDisplayName(model),
217 isCustom: false,
218 ...(model.isDefault ? { isDefault: true } : {}),
219 capabilities: mapCodexModelCapabilities(model),
220 }));
221}
222
223/**
224 * Prefer our own default-model ranking when one of the preferred slugs is in
225 * the live catalog; otherwise keep whatever Codex itself flagged as default.
226 */
227export function applyPreferredCodexDefaultModel(
228 models: ReadonlyArray<ServerProviderModel>,
229): ReadonlyArray<ServerProviderModel> {
230 const preferredSlug = PREFERRED_DEFAULT_CODEX_MODELS.find((slug) =>
231 models.some((model) => model.slug === slug && !model.isCustom),
232 );
233 if (!preferredSlug) {
234 return models;
235 }
236 return models.map((model) => {
237 if (model.slug === preferredSlug) {
238 return model.isDefault ? model : { ...model, isDefault: true };
239 }
240 if (!model.isDefault) {
241 return model;
242 }
243 const { isDefault: _isDefault, ...rest } = model;
244 return rest;
245 });
246}
247
248/**
249 * Codex has no static default capability set, so a bare custom slug borrows
250 * the first built-in's descriptors; an entry with its own capabilities keeps
251 * them.
252 */
253function appendCustomCodexModels(
254 models: ReadonlyArray<ServerProviderModel>,
255 customModels: ReadonlyArray<CustomModelSetting>,
256): ReadonlyArray<ServerProviderModel> {
257 if (customModels.length === 0) {
258 return models;
259 }
260
261 const seen = new Set(models.map((model) => model.slug));
262 const fallbackCapabilities = models.find((model) => model.capabilities)?.capabilities ?? null;
263 const customEntries: ServerProviderModel[] = [];
264 for (const entry of readCustomModelEntries(customModels)) {
265 if (seen.has(entry.slug)) {
266 continue;
267 }
268 seen.add(entry.slug);
269 customEntries.push({
270 slug: entry.slug,
271 name: entry.name,
272 isCustom: true,
273 capabilities: entry.capabilities ?? fallbackCapabilities,
274 });
275 }
276 return customEntries.length === 0 ? models : [...models, ...customEntries];
277}
278
279function parseCodexSkillsListResponse(
280 response: CodexSchema.V2SkillsListResponse,
281 cwd: string,
282): ReadonlyArray<ServerProviderSkill> {
283 const matchingEntry = response.data.find((entry) => entry.cwd === cwd);
284 const skills = matchingEntry
285 ? matchingEntry.skills
286 : response.data.flatMap((entry) => entry.skills);
287
288 return skills.map((skill) => {
289 const shortDescription =
290 skill.shortDescription ?? skill.interface?.shortDescription ?? undefined;
291
292 const parsedSkill: Types.Mutable<ServerProviderSkill> = {
293 name: skill.name,
294 path: skill.path,
295 enabled: skill.enabled,
296 };
297
298 if (skill.description) {
299 parsedSkill.description = skill.description;
300 }
301 if (skill.scope) {
302 parsedSkill.scope = skill.scope;
303 }
304 if (skill.interface?.displayName) {
305 parsedSkill.displayName = skill.interface.displayName;
306 }
307 if (shortDescription) {
308 parsedSkill.shortDescription = shortDescription;
309 }
310
311 return parsedSkill;
312 });
313}
314
315const requestAllCodexModels = Effect.fn("requestAllCodexModels")(function* (
316 client: CodexClient.CodexAppServerClient["Service"],
317) {
318 const models: ServerProviderModel[] = [];
319 let cursor: string | null | undefined = undefined;
320
321 do {
322 const response: CodexSchema.V2ModelListResponse = yield* client.request(
323 "model/list",
324 cursor ? { cursor } : {},
325 );
326 models.push(...parseCodexModelListResponse(response));
327 cursor = response.nextCursor;
328 } while (cursor);
329
330 return models;
331});
332
333export function buildCodexInitializeParams(): CodexSchema.V1InitializeParams {
334 return {
335 clientInfo: {
336 name: "t3code_desktop",
337 title: "T3 Code Desktop",
338 version: packageJson.version,
339 },
340 capabilities: {
341 experimentalApi: true,
342 },
343 };
344}
345
346/**
347 * Spawns a short-lived `codex app-server`, runs the initialize handshake, and
348 * hands the caller a connected client. Scoped: the process is killed when
349 * the caller's scope closes. Shared by the status probe, the skills probe,
350 * and account-level requests such as reset-credit redemption.
351 */
352export const withCodexAppServerClient = Effect.fn("withCodexAppServerClient")(function* (input: {
353 readonly binaryPath: string;
354 readonly homePath?: string | undefined;
355 readonly launchArgs?: string | undefined;
356 readonly cwd: string;
357 readonly environment?: NodeJS.ProcessEnv | undefined;
358}) {
359 // `~` is not shell-expanded when env vars are set via `child_process.spawn`,
360 // so `CODEX_HOME=~/.codex_work` would reach codex verbatim and trip
361 // "CODEX_HOME points to '~/.codex_work', but that path does not exist".
362 // Expand here for parity with `CodexTextGeneration`/`CodexSessionRuntime`.
363 const resolvedHomePath = input.homePath ? expandHomePath(input.homePath) : undefined;
364 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
365 const environment = {
366 ...input.environment,
367 ...(resolvedHomePath ? { CODEX_HOME: resolvedHomePath } : {}),
368 };
369 const spawnCommand = yield* resolveSpawnCommand(
370 input.binaryPath,
371 codexAppServerArgs(input.launchArgs),
372 { env: environment, extendEnv: true },
373 );
374 const child = yield* spawner
375 .spawn(
376 ChildProcess.make(spawnCommand.command, spawnCommand.args, {
377 cwd: input.cwd,
378 env: environment,
379 extendEnv: true,
380 forceKillAfter: CODEX_APP_SERVER_PROBE_FORCE_KILL_AFTER,
381 shell: spawnCommand.shell,
382 }),
383 )
384 .pipe(
385 Effect.mapError(
386 (cause) =>
387 new CodexErrors.CodexAppServerSpawnError({
388 command: `${input.binaryPath} app-server`,
389 cause,
390 }),
391 ),
392 );
393 const clientContext = yield* Layer.build(CodexClient.layerChildProcess(child));
394 const client = yield* Effect.service(CodexClient.CodexAppServerClient).pipe(
395 Effect.provide(clientContext),
396 );
397 const initialize = yield* client.request("initialize", buildCodexInitializeParams());
398 yield* client.notify("initialized", undefined);
399 return { client, initialize };
400});
401
402const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(function* (input: {
403 readonly binaryPath: string;
404 readonly homePath?: string;
405 readonly launchArgs?: string;
406 readonly cwd: string;
407 readonly customModels?: ReadonlyArray<CustomModelSetting>;
408 readonly environment?: NodeJS.ProcessEnv;
409}) {
410 const { client, initialize } = yield* withCodexAppServerClient(input);
411
412 // Extract the version string after the first '/' in userAgent, up to the next space or the end
413 const versionMatch = initialize.userAgent.match(/\/([^\s]+)/);
414 const version = versionMatch ? versionMatch[1] : undefined;
415
416 const accountResponse = yield* client.request("account/read", {});
417 if (!accountResponse.account && accountResponse.requiresOpenaiAuth) {
418 return {
419 account: accountResponse,
420 version,
421 models: appendCustomCodexModels([], input.customModels ?? []),
422 skills: [],
423 } satisfies CodexAppServerProviderSnapshot;
424 }
425
426 const [skillsResponse, models, rateLimits] = yield* Effect.all(
427 [
428 client.request("skills/list", {
429 cwds: [input.cwd],
430 }),
431 requestAllCodexModels(client),
432 // Usage is an enrichment: a failure or a slow answer degrades to "no
433 // usage this probe" rather than costing the account and models.
434 client.request("account/rateLimits/read", undefined).pipe(
435 Effect.map((response): CodexRateLimitsProbe => ({
436 snapshot: response.rateLimits,
437 resetCredits: response.rateLimitResetCredits,
438 })),
439 Effect.timeoutOption(Duration.millis(RATE_LIMITS_PROBE_TIMEOUT_MS)),
440 Effect.map(
441 Option.getOrElse((): CodexRateLimitsProbe => ({
442 failure: "Codex did not answer the usage request.",
443 })),
444 ),
445 Effect.catch((error) =>
446 Effect.logDebug("Codex rate-limit read failed.", { cause: error }).pipe(
447 Effect.as<CodexRateLimitsProbe>({ failure: codexRateLimitsFailureMessage(error) }),
448 ),
449 ),
450 ),
451 ],
452 { concurrency: "unbounded" },
453 );
454
455 return {
456 account: accountResponse,
457 rateLimits,
458 version,
459 models: applyPreferredCodexDefaultModel(
460 appendCustomCodexModels(models, input.customModels ?? []),
461 ),
462 skills: parseCodexSkillsListResponse(skillsResponse, input.cwd),
463 } satisfies CodexAppServerProviderSnapshot;
464});
465
466export const probeCodexSkillsForCwd = Effect.fn("probeCodexSkillsForCwd")(function* (input: {
467 readonly binaryPath: string;
468 readonly homePath?: string;
469 readonly launchArgs?: string;
470 readonly cwd: string;
471 readonly environment?: NodeJS.ProcessEnv;
472}) {
473 const { client } = yield* withCodexAppServerClient(input);
474 const skillsResponse = yield* client.request("skills/list", { cwds: [input.cwd] });
475 return parseCodexSkillsListResponse(skillsResponse, input.cwd);
476});
477
478const emptyCodexModelsFromSettings = (codexSettings: CodexSettings): ServerProvider["models"] =>
479 appendCustomCodexModels([], codexSettings.customModels);
480
481const makePendingCodexProvider = (
482 codexSettings: CodexSettings,
483): Effect.Effect<ServerProviderDraft> =>
484 Effect.gen(function* () {
485 const checkedAt = yield* Effect.map(DateTime.now, DateTime.formatIso);
486 const models = emptyCodexModelsFromSettings(codexSettings);
487
488 if (!codexSettings.enabled) {
489 return buildServerProvider({
490 presentation: CODEX_PRESENTATION,
491 enabled: false,
492 checkedAt,
493 models,
494 skills: [],
495 probe: {
496 installed: false,
497 version: null,
498 status: "warning",
499 auth: { status: "unknown" },
500 message: "Codex is disabled in T3 Code settings.",
501 },
502 });
503 }
504
505 return buildServerProvider({
506 presentation: CODEX_PRESENTATION,
507 enabled: true,
508 checkedAt,
509 models,
510 skills: [],
511 probe: {
512 installed: false,
513 version: null,
514 status: "warning",
515 auth: { status: "unknown" },
516 message: "Codex provider status has not been checked in this session yet.",
517 },
518 });
519 });
520
521function accountProbeStatus(account: CodexAppServerProviderSnapshot["account"]): {
522 readonly status: Exclude<ServerProviderState, "disabled">;
523 readonly auth: ServerProvider["auth"];
524 readonly message?: string;
525} {
526 const authLabel = codexAccountAuthLabel(account.account);
527 const authEmail = codexAccountEmail(account.account);
528 const auth = {
529 status: account.account ? ("authenticated" as const) : ("unknown" as const),
530 ...(account.account?.type ? { type: account.account?.type } : {}),
531 ...(authLabel ? { label: authLabel } : {}),
532 ...(authEmail ? { email: authEmail } : {}),
533 } satisfies ServerProvider["auth"];
534
535 if (account.account) {
536 return { status: "ready", auth };
537 }
538
539 if (account.requiresOpenaiAuth) {
540 return {
541 status: "error",
542 auth: { status: "unauthenticated" },
543 message: "Codex CLI is not authenticated. Run `codex login` and try again.",
544 };
545 }
546
547 return { status: "ready", auth };
548}
549
550export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(function* (
551 codexSettings: CodexSettings,
552 probe: (input: {
553 readonly binaryPath: string;
554 readonly homePath?: string;
555 readonly launchArgs?: string;
556 readonly cwd: string;
557 readonly customModels: ReadonlyArray<CustomModelSetting>;
558 readonly environment?: NodeJS.ProcessEnv;
559 }) => Effect.Effect<
560 CodexAppServerProviderSnapshot,
561 CodexErrors.CodexAppServerError,
562 ChildProcessSpawner.ChildProcessSpawner | Scope.Scope
563 > = probeCodexAppServerProvider,
564 environment?: NodeJS.ProcessEnv,
565): Effect.fn.Return<
566 ServerProviderDraft,
567 ServerSettingsError,
568 ChildProcessSpawner.ChildProcessSpawner
569> {
570 const resolvedEnvironment = environment ?? process.env;
571 const checkedAt = DateTime.formatIso(yield* DateTime.now);
572 const emptyModels = emptyCodexModelsFromSettings(codexSettings);
573
574 if (!codexSettings.enabled) {
575 return buildServerProvider({
576 presentation: CODEX_PRESENTATION,
577 enabled: false,
578 checkedAt,
579 models: emptyModels,
580 skills: [],
581 probe: {
582 installed: false,
583 version: null,
584 status: "warning",
585 auth: { status: "unknown" },
586 message: "Codex is disabled in T3 Code settings.",
587 },
588 });
589 }
590
591 const probeResult = yield* probe({
592 binaryPath: codexSettings.binaryPath,
593 homePath: codexSettings.homePath,
594 launchArgs: resolveCodexLaunchArgs(codexSettings.launchArgs, resolvedEnvironment),
595 cwd: process.cwd(),
596 customModels: codexSettings.customModels,
597 environment: resolvedEnvironment,
598 }).pipe(
599 Effect.scoped,
600 Effect.timeoutOption(Duration.millis(AUTH_PROBE_TIMEOUT_MS)),
601 Effect.result,
602 );
603
604 if (Result.isFailure(probeResult)) {
605 const error = probeResult.failure;
606 const installed = !isCodexAppServerSpawnError(error);
607 return buildServerProvider({
608 presentation: CODEX_PRESENTATION,
609 enabled: codexSettings.enabled,
610 checkedAt,
611 models: emptyModels,
612 skills: [],
613 probe: {
614 installed,
615 version: null,
616 status: "error",
617 auth: { status: "unknown" },
618 message: installed
619 ? `Codex app-server provider probe failed: ${error.message}.`
620 : "Codex CLI (`codex`) was not found on PATH.",
621 },
622 });
623 }
624
625 if (Option.isNone(probeResult.success)) {
626 return buildServerProvider({
627 presentation: CODEX_PRESENTATION,
628 enabled: codexSettings.enabled,
629 checkedAt,
630 models: emptyModels,
631 skills: [],
632 probe: {
633 installed: true,
634 version: null,
635 status: "error",
636 auth: { status: "unknown" },
637 message: "Timed out while checking Codex app-server provider status.",
638 },
639 });
640 }
641
642 const snapshot = probeResult.success.value;
643 const accountStatus = accountProbeStatus(snapshot.account);
644 const usageLimits =
645 snapshot.account.account?.type === "apiKey"
646 ? makeUnavailableUsageLimits({ checkedAt, reason: "unsupported" })
647 : snapshot.rateLimits === undefined || "failure" in snapshot.rateLimits
648 ? makeUnavailableUsageLimits({
649 checkedAt,
650 reason: "probeFailed",
651 ...(snapshot.rateLimits ? { message: snapshot.rateLimits.failure } : {}),
652 })
653 : codexRateLimitsToLimits({
654 snapshot: snapshot.rateLimits.snapshot,
655 resetCredits: snapshot.rateLimits.resetCredits,
656 checkedAt,
657 });
658
659 return buildServerProvider({
660 presentation: CODEX_PRESENTATION,
661 enabled: codexSettings.enabled,
662 checkedAt,
663 models: snapshot.models,
664 skills: snapshot.skills,
665 slashCommands: [
666 COMPACT_SLASH_COMMAND,
667 {
668 name: "feedback",
669 description: "Send this thread and Codex logs to OpenAI",
670 input: { hint: "Describe the issue (optional)" },
671 },
672 ],
673 probe: {
674 installed: true,
675 version: snapshot.version ?? null,
676 status: accountStatus.status,
677 auth: accountStatus.auth,
678 ...(accountStatus.message ? { message: accountStatus.message } : {}),
679 usageLimits,
680 },
681 });
682});
683
684// NOTE: the singleton `CodexProviderLive` Layer has been removed as part of
685// the per-instance-driver refactor. `CodexDriver.create()` builds a managed
686// snapshot per instance (each with its own `CodexSettings`) and hands the
687// resulting `ServerProviderShape` back as `ProviderInstance.snapshot`.
688//
689// The `makePendingCodexProvider` and `checkCodexProviderStatus` helpers are
690// re-exported for use by `CodexDriver`.
691export { makePendingCodexProvider };