agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
28 lines • 1.1 kB
JavaScript
;
/**
* hosting/headers — one lower-casing of one header bag, shared by every door.
*
* A six-line helper gets its own file for the reason every other shared piece
* in this folder does: two copies of it is how the request door and the
* conversation door end up disagreeing about whether a header the caller sent
* as `X-Session-Id` is present, and that disagreement would surface as one door
* seeing a session the other cannot.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.lowerCasedHeaders = void 0;
/**
* Header names lower-cased, repeated values joined — the shape every wire reads
* from, so no wire ever has to guess at casing.
*/
function lowerCasedHeaders(headers) {
const out = {};
for (const [name, value] of Object.entries(headers)) {
if (typeof value === 'string')
out[name.toLowerCase()] = value;
else if (Array.isArray(value))
out[name.toLowerCase()] = value.join(', ');
}
return out;
}
exports.lowerCasedHeaders = lowerCasedHeaders;
//# sourceMappingURL=headers.js.map