Files
luma/Agent/core/console.ts
Ole André Vadla Ravnås 92357bfd80 Add LumaCore package + cross-platform scaffolding
Lay the groundwork for a GTK/Adwaita frontend by extracting
shared infrastructure into a LumaCore Swift package. Agent
sources and LumaBundleCompiler move to top-level locations
so both the Xcode project and SPM can reference them.

New structure:
- Package.swift: root manifest with LumaCore lib + compiler
- Sources/LumaCore/: engine, persistence, models, and
  platform-abstracted token store
- Sources/LumaBundleCompiler/: moved from LumaBundleCompiler/
- Agent/: moved from Luma/Agent/
- LumaGtk/: skeleton GTK app package
2026-04-06 18:59:29 +02:00

16 lines
687 B
TypeScript

import { encodeValues } from "./value.js";
type ConsoleLevel = "info" | "debug" | "warning" | "error";
const proto = Object.getPrototypeOf(console);
proto.info = (...args: unknown[]) => { emitLogMessage("info", args); };
proto.log = (...args: unknown[]) => { emitLogMessage("info", args); };
proto.debug = (...args: unknown[]) => { emitLogMessage("debug", args); };
proto.warn = (...args: unknown[]) => { emitLogMessage("warning", args); };
proto.error = (...args: unknown[]) => { emitLogMessage("error", args); };
function emitLogMessage(level: ConsoleLevel, args: unknown[]) {
const [trees, blob] = encodeValues(args);
send({ type: "console", level, args: trees }, blob);
}