Rework core integration: validated capability layer, docs, and session state
This commit is contained in:
+10
-13
@@ -1,17 +1,15 @@
|
||||
/*
|
||||
* Veskslop Phase 0 — live DM send test through a running Vesktop instance.
|
||||
* Veskslop — live DM send test through a running client.
|
||||
*
|
||||
* Sanctioned test target: user zzib. Defaults to their user ID.
|
||||
* This talks to the control socket directly (which must be a real Vesktop,
|
||||
* not the mock) and paces the command like everything else.
|
||||
* Sanctioned test target: user zzib (defaults to their user ID).
|
||||
*
|
||||
* Usage:
|
||||
* pnpm poc:dm
|
||||
* TEST_DM_USER_ID=... TEST_DM_CONTENT="hello" pnpm poc:dm
|
||||
*/
|
||||
|
||||
import { paced } from "./pacing.js";
|
||||
import { sendVesktopCommand, socketPath } from "./vesktop-socket.js";
|
||||
import { CdpClient } from "./cdp-client.js";
|
||||
import { Discord } from "./discord.js";
|
||||
|
||||
/** zzib — the only sanctioned live-send target. */
|
||||
const DEFAULT_TEST_DM_USER_ID = "177117296140091393";
|
||||
@@ -19,11 +17,10 @@ const DEFAULT_TEST_DM_USER_ID = "177117296140091393";
|
||||
const userId = process.env.TEST_DM_USER_ID ?? DEFAULT_TEST_DM_USER_ID;
|
||||
const content = process.env.TEST_DM_CONTENT ?? "veskslop test dm";
|
||||
|
||||
if (!userId) {
|
||||
console.error("TEST_DM_USER_ID is required (sanctioned test target: zzib)");
|
||||
process.exit(1);
|
||||
}
|
||||
const cdp = await CdpClient.connect();
|
||||
const discord = new Discord(cdp);
|
||||
|
||||
console.log(`[dm] socket: ${socketPath}`);
|
||||
const result = await paced(() => sendVesktopCommand("dm:send", { userId, content }));
|
||||
console.log("[dm]", result);
|
||||
console.log("[dm] connected via CDP");
|
||||
console.log("[dm]", await discord.sendDm(userId, content));
|
||||
|
||||
cdp.close();
|
||||
|
||||
Reference in New Issue
Block a user