Wire validated core bridge, migrate daemon to it, verify live

This commit is contained in:
Fisto
2026-09-11 14:15:03 +02:00
parent e62d3007d8
commit 7d6650ce4e
27 changed files with 754 additions and 266 deletions
+7 -2
View File
@@ -15,7 +15,12 @@ import {
type ParsedCommand,
type PuppetMessage
} from "./communication.js";
import type { Discord } from "./discord.js";
/** The subset of the transport that the puppet logic needs. */
export interface PuppetTransport {
getSelfId(): Promise<string | undefined>;
sendMessage(channelId: string, content: string): Promise<void>;
}
const DM_CHANNEL = 1;
const GROUP_DM_CHANNEL = 3;
@@ -36,7 +41,7 @@ export class Puppet {
private whitelistIds: string[] = [];
private selfId?: string;
constructor(private readonly discord: Discord) {
constructor(private readonly discord: PuppetTransport) {
try {
const state = JSON.parse(readFileSync(STATE_FILE, "utf8")) as PersistedState;
if (state.ownerId) this.ownerId = state.ownerId;