(event: InboundTextEvent)
| 990 | } |
| 991 | |
| 992 | function 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 | |
| 1020 | function resolveRetryContext(event: InboundTextEvent): Record<string, unknown> | null { |
| 1021 | const metadata = event?.metadata; |
no test coverage detected