beercan 0.4.5 → 0.4.6

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.
@@ -53,25 +53,25 @@ export const tools = [
53
53
  }
54
54
 
55
55
  const data = await response.json();
56
- const accounts = data.social_accounts || data.platforms || data.connected || [];
56
+ // API returns { success, profile: { social_accounts: { platform: { handle, ... } } } }
57
+ const socialAccounts = data?.profile?.social_accounts || data?.social_accounts || {};
58
+ const platformNames = Object.keys(socialAccounts);
57
59
 
58
- if (Array.isArray(accounts) && accounts.length === 0) {
60
+ if (platformNames.length === 0) {
59
61
  return [
60
62
  "No social networks connected yet.",
61
63
  `Go to ${markSupremeUrl} → Platforms to connect.`,
62
- "Supported: Twitter/X, Instagram, TikTok, LinkedIn, Reddit, Threads, Facebook, YouTube, Pinterest, Bluesky",
64
+ "Supported: x (Twitter), instagram, tiktok, linkedin, reddit, threads, facebook, youtube, pinterest, bluesky",
63
65
  ].join("\n");
64
66
  }
65
67
 
66
- let result = `Connected platforms for profile "${profile}":\n`;
67
- if (Array.isArray(accounts)) {
68
- for (const a of accounts) {
69
- result += `\n● ${a.platform || a.name} — ${a.username || a.handle || "connected"}`;
70
- }
71
- } else {
72
- result += JSON.stringify(accounts, null, 2);
68
+ let result = `Connected platforms for profile "${profile}" (${platformNames.length}):\n`;
69
+ for (const [platform, info] of Object.entries(socialAccounts)) {
70
+ const details = info;
71
+ result += `\n● ${platform} — @${details.handle || details.display_name || "connected"}`;
73
72
  }
74
- result += `\n\nManage connections: ${markSupremeUrl}`;
73
+ result += `\n\nUse these exact platform names when posting: ${platformNames.join(", ")}`;
74
+ result += `\nManage connections: ${markSupremeUrl}`;
75
75
  return result;
76
76
  } catch (err) {
77
77
  return `Cannot reach Upload-Post API: ${err.message}\nManage at: ${markSupremeUrl}`;
@@ -128,8 +128,7 @@ export const tools = [
128
128
  };
129
129
 
130
130
  addField("user", profile);
131
- addField("description", content);
132
- if (title) addField("title", title);
131
+ addField("title", content); // "title" is the main post text for Upload-Post API
133
132
  if (subreddit) addField("subreddit", subreddit);
134
133
 
135
134
  // Each platform as separate "platform[]" field
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beercan",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Autonomous AI agent system — powered by Skippy the Magnificent.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",