lovelyai 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import "../chunk-IMWGIC63.js";
2
+ import "../chunk-QI5UMJSF.js";
@@ -627,16 +627,19 @@ function createWhatsAppPlugin(opts) {
627
627
  async function startPlugin(startOpts) {
628
628
  const { onMessage } = startOpts;
629
629
  const { makeWASocket, useMultiFileAuthState, DisconnectReason } = await import("baileys");
630
+ const qrMod = await import("qrcode-terminal");
631
+ const qrGenerate = qrMod.default.generate.bind(qrMod.default);
630
632
  const { state, saveCreds } = await useMultiFileAuthState(opts.authDir);
631
- sock = makeWASocket({
632
- auth: state,
633
- printQRInTerminal: true
634
- });
633
+ sock = makeWASocket({ auth: state });
635
634
  sock.ev.on("creds.update", () => {
636
635
  saveCreds().catch(console.error);
637
636
  });
638
637
  sock.ev.on("connection.update", (update) => {
639
- const { connection, lastDisconnect } = update;
638
+ const { connection, lastDisconnect, qr } = update;
639
+ if (typeof qr === "string") {
640
+ console.log("\nScan this QR code with WhatsApp \u2192 Settings \u2192 Linked Devices \u2192 Link a Device:\n");
641
+ qrGenerate(qr, { small: true });
642
+ }
640
643
  if (connection === "close") {
641
644
  if (lastDisconnect?.["error"]?.output?.statusCode !== DisconnectReason.restartRequired) startPlugin(startOpts).catch(console.error);
642
645
  }
package/dist/src/index.js CHANGED
@@ -1 +1 @@
1
- import "../chunk-IMWGIC63.js";
1
+ import "../chunk-QI5UMJSF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lovelyai",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "lovely": "./dist/bin/lovely.js",
@@ -24,6 +24,7 @@
24
24
  "@inquirer/prompts": "^7.10.1",
25
25
  "@sinclair/typebox": "^0.33.0",
26
26
  "baileys": "^7.0.0-rc.9",
27
+ "qrcode-terminal": "^0.12.0",
27
28
  "better-sqlite3": "^12.0.0",
28
29
  "chalk": "^5.6.2",
29
30
  "commander": "^12.1.0",
@@ -39,14 +40,14 @@
39
40
  "devDependencies": {
40
41
  "tsup": "^8.5.1",
41
42
  "@lovely/channel-imessage": "0.0.1",
42
- "@lovely/channel-telegram": "0.0.1",
43
43
  "@lovely/channel-whatsapp": "0.0.1",
44
- "@lovely/channels": "0.0.1",
45
- "@lovely/hitl": "0.0.1",
46
- "@lovely/llm": "0.0.1",
47
44
  "@lovely/agent": "0.0.1",
45
+ "@lovely/channel-telegram": "0.0.1",
48
46
  "@lovely/core": "0.0.1",
47
+ "@lovely/hitl": "0.0.1",
48
+ "@lovely/llm": "0.0.1",
49
49
  "@lovely/memory": "0.0.1",
50
+ "@lovely/channels": "0.0.1",
50
51
  "@lovely/privacy": "0.0.1"
51
52
  },
52
53
  "scripts": {