@elizaos/plugin-twitter 1.2.23-alpha.1 → 1.2.23-alpha.2

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
@@ -19486,19 +19486,19 @@ var postTweetAction = {
19486
19486
  validate: async (runtime, message, state, options) => {
19487
19487
  const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
19488
19488
  const __avText = __avTextRaw.toLowerCase();
19489
- const __avKeywords = ["post", "tweet"];
19490
- const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
19491
- const __avRegex = new RegExp("\\b(?:post|tweet)\\b", "i");
19492
- const __avRegexOk = __avRegex.test(__avText);
19489
+ const __avKeywords = ["tweet", "twitter", "post", "share"];
19490
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw)) || String(message?.content?.source ?? message?.source ?? "") === "twitter";
19491
+ const __avRegex = new RegExp("\\b(?:tweet|twitter|post|share)\\b", "i");
19492
+ const __avRegexOk = __avRegex.test(__avText) || String(message?.content?.source ?? message?.source ?? "") === "twitter";
19493
19493
  const __avSource = String(message?.content?.source ?? message?.source ?? "");
19494
- const __avExpectedSource = "twitter";
19494
+ const __avExpectedSource = "";
19495
19495
  const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
19496
19496
  const __avOptions = options && typeof options === "object" ? options : {};
19497
- const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
19497
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object") || String(message?.content?.source ?? message?.source ?? "") === "twitter";
19498
19498
  if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
19499
19499
  return false;
19500
19500
  }
19501
- const __avLegacyValidate = async (runtime2, message2) => {
19501
+ const __avLegacyValidate = async (runtime2, _message) => {
19502
19502
  const service = runtime2.getService("twitter");
19503
19503
  return !!service;
19504
19504
  };