GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — opencode-codex-computer-use/src/debug.ts at main · malhashemi/opencode-codex-computer-use Expand file tree/ Copy pathdebug.tsMore file actions 33 lines (31 loc) · 1.31 KB / Copy pathdebug.tsFile metadata and controls33 lines (31 loc) · 1.31 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 import { appendFileSync, mkdirSync } from "node:fs" import { dirname } from "node:path" /** * Appends every app-server message to a JSONL file. Screenshot data is replaced by its size; everything else * (accessibility trees, page text, code) is written as is, so the log can contain sensitive data. */ export function trafficLogger(path: string, log: (message: string) => void) { let failed = false mkdirSync(dirname(path), { recursive: true }) return (direction: "send" | "receive", message: unknown) => { if (failed) return try { appendFileSync( path, JSON.stringify({ time: new Date().toISOString(), direction, message: stripImages(message) }) + "\n", ) } catch (error) { failed = true log(`debug log disabled, could not write ${path}: ${error instanceof Error ? error.message : String(error)}`) } } } export function stripImages(value: unknown): unknown { if (Array.isArray(value)) return value.map(stripImages) if (value === null || typeof value !== "object") return value const record = value as Record<string, unknown> if (record.type === "image" && typeof record.data === "string") { return { ...record, data: `<${record.data.length} base64 chars>` } } return Object.fromEntries(Object.entries(record).map(([key, item]) => [key, stripImages(item)])) } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |