Elffuss BraidHub

kikocis/continue public

main · 613 BRawPermalink
1export function parseOtelHeaders(headersStr: string): Record<string, string> {
2 const headers: Record<string, string> = {};
3 if (!headersStr) return headers;
4
5 headersStr.split(",").forEach((header) => {
6 const [key, value] = header.split("=");
7 if (key && value) {
8 headers[key.trim()] = value.trim();
9 }
10 });
11
12 return headers;
13}
14
15export function detectTerminalType(): string | undefined {
16 if (process.env.TERM_PROGRAM) {
17 return process.env.TERM_PROGRAM;
18 }
19 if (process.env.VSCODE_PID) {
20 return "vscode";
21 }
22 if (process.env.TMUX) {
23 return "tmux";
24 }
25 return undefined;
26}