lovelyai 0.0.6 → 0.0.8

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-EVM3ISZE.js";
2
+ import "../chunk-IUNYJXNS.js";
@@ -626,17 +626,19 @@ function createWhatsAppPlugin(opts) {
626
626
  let sock = null;
627
627
  async function startPlugin(startOpts) {
628
628
  const { onMessage } = startOpts;
629
- const { makeWASocket, useMultiFileAuthState, DisconnectReason } = await import("@whiskeysockets/baileys");
629
+ const { makeWASocket, useMultiFileAuthState, DisconnectReason } = await import("baileys");
630
+ const { generate: qrGenerate } = await import("qrcode-terminal");
630
631
  const { state, saveCreds } = await useMultiFileAuthState(opts.authDir);
631
- sock = makeWASocket({
632
- auth: state,
633
- printQRInTerminal: true
634
- });
632
+ sock = makeWASocket({ auth: state });
635
633
  sock.ev.on("creds.update", () => {
636
634
  saveCreds().catch(console.error);
637
635
  });
638
636
  sock.ev.on("connection.update", (update) => {
639
- const { connection, lastDisconnect } = update;
637
+ const { connection, lastDisconnect, qr } = update;
638
+ if (typeof qr === "string") {
639
+ console.log("\nScan this QR code with WhatsApp \u2192 Settings \u2192 Linked Devices \u2192 Link a Device:\n");
640
+ qrGenerate(qr, { small: true });
641
+ }
640
642
  if (connection === "close") {
641
643
  if (lastDisconnect?.["error"]?.output?.statusCode !== DisconnectReason.restartRequired) startPlugin(startOpts).catch(console.error);
642
644
  }
package/dist/src/index.js CHANGED
@@ -1 +1 @@
1
- import "../chunk-EVM3ISZE.js";
1
+ import "../chunk-IUNYJXNS.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lovelyai",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "lovely": "./dist/bin/lovely.js",
@@ -23,7 +23,8 @@
23
23
  "@grammyjs/runner": "^2.0.3",
24
24
  "@inquirer/prompts": "^7.10.1",
25
25
  "@sinclair/typebox": "^0.33.0",
26
- "@whiskeysockets/baileys": "^6.17.16",
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",
@@ -38,16 +39,16 @@
38
39
  "license": "SEE LICENSE IN LICENSE",
39
40
  "devDependencies": {
40
41
  "tsup": "^8.5.1",
42
+ "@lovely/agent": "0.0.1",
41
43
  "@lovely/channels": "0.0.1",
44
+ "@lovely/channel-telegram": "0.0.1",
42
45
  "@lovely/channel-imessage": "0.0.1",
43
- "@lovely/agent": "0.0.1",
44
- "@lovely/llm": "0.0.1",
45
46
  "@lovely/core": "0.0.1",
46
47
  "@lovely/channel-whatsapp": "0.0.1",
47
- "@lovely/hitl": "0.0.1",
48
+ "@lovely/llm": "0.0.1",
48
49
  "@lovely/privacy": "0.0.1",
49
- "@lovely/memory": "0.0.1",
50
- "@lovely/channel-telegram": "0.0.1"
50
+ "@lovely/hitl": "0.0.1",
51
+ "@lovely/memory": "0.0.1"
51
52
  },
52
53
  "scripts": {
53
54
  "build": "tsup",