@c4t4/heyamigo 0.8.1 → 0.8.3

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.
package/dist/ai/claude.js CHANGED
@@ -33,6 +33,7 @@ function buildArgs(params) {
33
33
  '-p',
34
34
  '--output-format',
35
35
  'stream-json',
36
+ '--verbose',
36
37
  '--model',
37
38
  config.claude.model,
38
39
  '--permission-mode',
@@ -225,6 +225,7 @@ async function spawnGenerator(prompt) {
225
225
  '-p',
226
226
  '--output-format',
227
227
  'stream-json',
228
+ '--verbose',
228
229
  '--model',
229
230
  config.claude.model,
230
231
  '--permission-mode',
@@ -14,6 +14,7 @@ async function spawnDigester(prompt) {
14
14
  '-p',
15
15
  '--output-format',
16
16
  'stream-json',
17
+ '--verbose',
17
18
  '--model',
18
19
  config.claude.model,
19
20
  '--permission-mode',
@@ -19,6 +19,7 @@ async function spawnComposer(prompt) {
19
19
  '-p',
20
20
  '--output-format',
21
21
  'stream-json',
22
+ '--verbose',
22
23
  '--model',
23
24
  config.claude.model,
24
25
  '--permission-mode',
@@ -15,6 +15,7 @@ async function spawnObserver(prompt) {
15
15
  '-p',
16
16
  '--output-format',
17
17
  'stream-json',
18
+ '--verbose',
18
19
  '--model',
19
20
  config.claude.model,
20
21
  '--permission-mode',
@@ -114,6 +114,7 @@ function buildArgs(task) {
114
114
  '-p',
115
115
  '--output-format',
116
116
  'stream-json',
117
+ '--verbose',
117
118
  '--model',
118
119
  config.claude.model,
119
120
  '--permission-mode',
@@ -398,6 +399,7 @@ function buildBrowserArgs(task, sessionId) {
398
399
  '-p',
399
400
  '--output-format',
400
401
  'stream-json',
402
+ '--verbose',
401
403
  '--model',
402
404
  config.claude.model,
403
405
  '--permission-mode',
@@ -24,13 +24,41 @@ export function detectMediaType(msg) {
24
24
  return null;
25
25
  return MEDIA_TYPES[type] ?? null;
26
26
  }
27
+ // Baileys' extensionForMediaMessage throws when the media's mimetype is
28
+ // undefined — happens on some forwarded documents (notably PDFs shared in
29
+ // contexts that strip metadata). Fall back to the filename's extension,
30
+ // then to .bin. Never throws.
31
+ function resolveMediaExtension(msg) {
32
+ try {
33
+ const ext = extensionForMediaMessage(msg.message);
34
+ if (ext)
35
+ return ext;
36
+ }
37
+ catch {
38
+ // baileys tripped on missing mimetype — try fileName instead
39
+ }
40
+ const content = msg.message;
41
+ if (content) {
42
+ const type = getContentType(content);
43
+ if (type) {
44
+ const mediaMsg = content[type];
45
+ const fileName = mediaMsg?.fileName;
46
+ if (fileName) {
47
+ const m = fileName.match(/\.([a-zA-Z0-9]+)$/);
48
+ if (m && m[1])
49
+ return m[1].toLowerCase();
50
+ }
51
+ }
52
+ }
53
+ return 'bin';
54
+ }
27
55
  export async function downloadAndSave(msg, jid) {
28
56
  const mediaType = detectMediaType(msg);
29
57
  if (!mediaType)
30
58
  return null;
31
59
  try {
32
60
  const buffer = await downloadMediaMessage(msg, 'buffer', {});
33
- const ext = extensionForMediaMessage(msg.message) || 'bin';
61
+ const ext = resolveMediaExtension(msg);
34
62
  const id = msg.key.id || `${Date.now()}`;
35
63
  const dir = mediaDir(jid);
36
64
  await mkdir(dir, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4t4/heyamigo",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "WhatsApp AI bot powered by Claude with long-term memory, browser control, and role-based access",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",