MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / resolveDeveloperPromptContext

Function resolveDeveloperPromptContext

src/providers/codex/plugin.ts:992–1018  ·  view source on GitHub ↗
(event: InboundTextEvent)

Source from the content-addressed store, hash-verified

990}
991
992function resolveDeveloperPromptContext(event: InboundTextEvent): DeveloperPromptContext | null {
993 const metadata = event?.metadata;
994 if (!metadata || typeof metadata !== 'object') {
995 return null;
996 }
997 const codexbridge = (metadata as Record<string, unknown>).codexbridge;
998 if (!codexbridge || typeof codexbridge !== 'object') {
999 return null;
1000 }
1001 const context = (codexbridge as Record<string, unknown>).developerPromptContext;
1002 if (!context || typeof context !== 'object') {
1003 return null;
1004 }
1005 const raw = context as Record<string, unknown>;
1006 const mode = normalizeDeveloperPromptMode(raw.mode);
1007 if (!mode) {
1008 return null;
1009 }
1010 return {
1011 mode,
1012 title: normalizeDeveloperPromptContextValue(raw.title),
1013 source: normalizeDeveloperPromptContextValue(raw.source),
1014 command: normalizeDeveloperPromptContextValue(raw.command),
1015 subcommand: normalizeDeveloperPromptContextValue(raw.subcommand),
1016 operation: normalizeDeveloperPromptContextValue(raw.operation),
1017 };
1018}
1019
1020function resolveRetryContext(event: InboundTextEvent): Record<string, unknown> | null {
1021 const metadata = event?.metadata;

Callers 1

Tested by

no test coverage detected