INNER CODE UNIT · TypeScript
jsonStr
open-gitagent/clawless · src/container.ts:112
const jsonStr = line.slice(idx + MARKER.length);
try {
const data = JSON.parse(jsonStr);
if (data.type === 'request' || data.type === 'request.body') {
this.audit?.log('net.request', data.url ?? '', {
origin: 'container',
method: data.method,
...(data.headers ? { headers: data.headers } : {}),
...(data.bodyPreview ? { bodyPreview: data.bodyPreview } : {}),
}, { source });
} else if (data.type === 'response') {
this.audit?.log('net.response', data.url ?? '', {
origin: 'container',
method: data.method,
...(data.status != null ? { status: data.status } : {}),
...(data.error ? { error: data.error } : {}),
...(data.headers ? { headers: data.headers } : {}),
...(data.durationMs != null ? { durationMs: data.durationMs } : {}),