@moltium/core 0.1.3 → 0.1.4

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/index.js CHANGED
@@ -985,23 +985,38 @@ var Agent = class {
985
985
  async initSocialAdapters() {
986
986
  const { social } = this.config;
987
987
  if (social.moltbook?.enabled) {
988
- const adapter = new MoltbookAdapter(social.moltbook);
989
- try {
990
- await adapter.connect();
991
- this.socialAdapters["moltbook"] = adapter;
992
- logger4.info("Moltbook adapter connected");
993
- } catch (error) {
994
- logger4.warn(`Failed to connect Moltbook adapter: ${error}`);
988
+ if (!social.moltbook.apiKey || social.moltbook.apiKey === "your-moltbook-key-here") {
989
+ logger4.error("Moltbook is enabled but MOLTBOOK_API_KEY is missing or still a placeholder. Set a valid key in your .env file.");
990
+ } else {
991
+ const adapter = new MoltbookAdapter(social.moltbook);
992
+ try {
993
+ await adapter.connect();
994
+ this.socialAdapters["moltbook"] = adapter;
995
+ logger4.info("Moltbook adapter connected");
996
+ } catch (error) {
997
+ logger4.error(`Failed to connect Moltbook adapter: ${error.message || error}`);
998
+ if (error.response) {
999
+ logger4.error(` HTTP ${error.response.status}: ${JSON.stringify(error.response.data)}`);
1000
+ }
1001
+ }
995
1002
  }
996
1003
  }
997
1004
  if (social.twitter?.enabled) {
998
- const adapter = new TwitterAdapter(social.twitter);
999
- try {
1000
- await adapter.connect();
1001
- this.socialAdapters["twitter"] = adapter;
1002
- logger4.info("Twitter adapter connected");
1003
- } catch (error) {
1004
- logger4.warn(`Failed to connect Twitter adapter: ${error}`);
1005
+ const creds = social.twitter.credentials;
1006
+ if (!creds?.apiKey || creds.apiKey === "your-twitter-api-key") {
1007
+ logger4.error("Twitter is enabled but credentials are missing or still placeholders. Set valid Twitter keys in your .env file.");
1008
+ } else {
1009
+ const adapter = new TwitterAdapter(social.twitter);
1010
+ try {
1011
+ await adapter.connect();
1012
+ this.socialAdapters["twitter"] = adapter;
1013
+ logger4.info("Twitter adapter connected");
1014
+ } catch (error) {
1015
+ logger4.error(`Failed to connect Twitter adapter: ${error.message || error}`);
1016
+ if (error.response) {
1017
+ logger4.error(` HTTP ${error.response.status}: ${JSON.stringify(error.response.data)}`);
1018
+ }
1019
+ }
1005
1020
  }
1006
1021
  }
1007
1022
  }