(value: unknown)
| 966 | ].join('\n'); |
| 967 | |
| 968 | function normalizeCodexPersonality(value: unknown): 'friendly' | 'pragmatic' | 'none' | null { |
| 969 | const normalized = typeof value === 'string' ? value.trim().toLowerCase() : ''; |
| 970 | if (normalized === 'friendly' || normalized === 'pragmatic' || normalized === 'none') { |
| 971 | return normalized; |
| 972 | } |
| 973 | return null; |
| 974 | } |
| 975 | |
| 976 | function resolveTurnArtifactContext(event: InboundTextEvent): TurnArtifactContext | null { |
| 977 | const metadata = event?.metadata; |