char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
bdffafa5d
char/aliceai-t5-moe
1/** Number of trailing characters to keep visible when partially redacting mcp-session-id */ 2const MCP_SESSION_ID_VISIBLE_CHARS = 5 ; 3 4/** HTTP header handling for API and MCP requests. */ 5export const HEADERS = { 6/** Canonical casing for the Authorization header (RFC 7235) */ 7AUTHORIZATION :'Authorization' , 8/** Bearer scheme prefix used for Authorization headers (RFC 6750) */ 9BEARER :'Bearer ' , 10/** Content-Type HTTP header name */ 11CONTENT_TYPE :'Content-Type' , 12/** Partial-redaction rules for MCP headers: header name -> visible trailing chars */ 13PARTIAL_REDACT :new Map < string , number >([[ 'mcp-session-id' , MCP_SESSION_ID_VISIBLE_CHARS ]]), 14 15/** Header names whose values should be redacted in diagnostic logs */ 16REDACTED :new Set ([ 17'authorization' , 18'api-key' , 19'cookie' , 20'mcp-session-id' , 21'proxy-authorization' , 22'set-cookie' , 23'x-auth-token' , 24'x-api-key' 25]), 26 27/** Header carrying the stream-session identity (conversation id, optionally with a model suffix) */ 28X_CONVERSATION_ID_HEADER :'X-Conversation-Id' , 29 30/** Header asking the server to encode a tool's output differently, e.g. read_file returning base64. */ 31X_RESP_TYPE_HEADER :'x-resp-type' , 32 33/** Header carrying the working directory a tool call runs in; the model cannot override it */ 34X_TOOL_CWD_HEADER :'x-tool-cwd' 35}; 36 37/** `X_RESP_TYPE_HEADER` value that makes read_file return raw bytes as base64 instead of text. */ 38export const RESP_TYPE_BASE64 = 'base64' ;