@melandlabs/integrations-whatsapp 0.3.0 → 0.3.1

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,10 +1,10 @@
1
- import { homedir } from 'os';
2
1
  import { join } from 'path';
3
2
  import { loadChannelDay, saveChannelMessage, clearChannelConversationFromAllDays, clearAllChannelForUser } from '@melandlabs/ai/store';
3
+ import { getOpenContextPath } from '@melandlabs/env-config';
4
4
 
5
5
  // src/conversation-store.ts
6
6
  function getAppMemoryDir(userId) {
7
- const base = join(homedir(), ".opencontext", "data", "memory");
7
+ const base = getOpenContextPath("data", "memory");
8
8
  return userId ? join(base, userId) : base;
9
9
  }
10
10
  var WhatsAppConversationStore = class {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { MessagePlatformAdapter } from '@melandlabs/integrations-channels';
5
5
  import { proto, fetchLatestBaileysVersion, makeWASocket, DisconnectReason } from '@whiskeysockets/baileys';
6
6
  import { downloadMediaMessage } from '@whiskeysockets/baileys/lib/Utils/messages.js';
7
7
  import { rmSync, mkdirSync, writeFileSync, renameSync, existsSync, readFileSync, readdirSync } from 'fs';
8
- import { homedir } from 'os';
8
+ import { getOpenContextPath } from '@melandlabs/env-config';
9
9
  import { loadChannelDay, saveChannelMessage, clearChannelConversationFromAllDays, clearAllChannelForUser } from '@melandlabs/ai/store';
10
10
 
11
11
  var __create = Object.create;
@@ -4352,7 +4352,7 @@ var FLUSH_DEBOUNCE_MS = 2e3;
4352
4352
  var FLUSH_MAX_FILES_PER_PASS = 50;
4353
4353
  var MAX_CONSECUTIVE_FLUSH_FAILURES = 5;
4354
4354
  function defaultBaseDir() {
4355
- return join(homedir(), ".opencontext", "data", "whatsapp-history");
4355
+ return getOpenContextPath("data", "whatsapp-history");
4356
4356
  }
4357
4357
  function sanitizeForFilename(value) {
4358
4358
  return value.replace(/[^a-zA-Z0-9_-]/g, "_");
@@ -6139,7 +6139,7 @@ function jidToUser(jid) {
6139
6139
  return jid.split("@")[0];
6140
6140
  }
6141
6141
  function getAppMemoryDir(userId) {
6142
- const base = join(homedir(), ".opencontext", "data", "memory");
6142
+ const base = getOpenContextPath("data", "memory");
6143
6143
  return userId ? join(base, userId) : base;
6144
6144
  }
6145
6145
  var WhatsAppConversationStore = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melandlabs/integrations-whatsapp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -34,8 +34,9 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@whiskeysockets/baileys": "^7.0.0-rc.9",
37
- "@melandlabs/ai": "0.3.0",
37
+ "@melandlabs/ai": "0.3.1",
38
38
  "@melandlabs/integrations": "0.3.0",
39
+ "@melandlabs/env-config": "0.4.0",
39
40
  "@melandlabs/integrations-channels": "0.3.0"
40
41
  },
41
42
  "devDependencies": {