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
16 lines
687 B
TypeScript
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);
|
|
}
|