@elizaos/plugin-linear 2.0.0-alpha.5 → 2.0.0-alpha.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.
package/dist/index.js CHANGED
@@ -38,9 +38,30 @@ var clearActivityAction = {
38
38
  }
39
39
  ]
40
40
  ],
41
- async validate(runtime, _message, _state) {
42
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
43
- return !!apiKey;
41
+ validate: async (runtime, message, state, options) => {
42
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
43
+ const __avText = __avTextRaw.toLowerCase();
44
+ const __avKeywords = ["clear", "linear", "activity"];
45
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
46
+ const __avRegex = /\b(?:clear|linear|activity)\b/i;
47
+ const __avRegexOk = __avRegex.test(__avText);
48
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
49
+ const __avExpectedSource = "";
50
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
51
+ const __avOptions = options && typeof options === "object" ? options : {};
52
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
53
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
54
+ return false;
55
+ }
56
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
57
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
58
+ return !!apiKey;
59
+ };
60
+ try {
61
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
62
+ } catch {
63
+ return false;
64
+ }
44
65
  },
45
66
  async handler(runtime, message, _state, _options, callback) {
46
67
  try {
@@ -345,9 +366,30 @@ var createCommentAction = {
345
366
  }
346
367
  ]
347
368
  ],
348
- async validate(runtime, _message, _state) {
349
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
350
- return !!apiKey;
369
+ validate: async (runtime, message, state, options) => {
370
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
371
+ const __avText = __avTextRaw.toLowerCase();
372
+ const __avKeywords = ["create", "linear", "comment"];
373
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
374
+ const __avRegex = /\b(?:create|linear|comment)\b/i;
375
+ const __avRegexOk = __avRegex.test(__avText);
376
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
377
+ const __avExpectedSource = "";
378
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
379
+ const __avOptions = options && typeof options === "object" ? options : {};
380
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
381
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
382
+ return false;
383
+ }
384
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
385
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
386
+ return !!apiKey;
387
+ };
388
+ try {
389
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
390
+ } catch {
391
+ return false;
392
+ }
351
393
  },
352
394
  async handler(runtime, message, _state, _options, callback) {
353
395
  try {
@@ -557,9 +599,30 @@ var createIssueAction = {
557
599
  }
558
600
  ]
559
601
  ],
560
- async validate(runtime, _message, _state) {
561
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
562
- return !!apiKey;
602
+ validate: async (runtime, message, state, options) => {
603
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
604
+ const __avText = __avTextRaw.toLowerCase();
605
+ const __avKeywords = ["create", "linear", "issue"];
606
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
607
+ const __avRegex = /\b(?:create|linear|issue)\b/i;
608
+ const __avRegexOk = __avRegex.test(__avText);
609
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
610
+ const __avExpectedSource = "";
611
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
612
+ const __avOptions = options && typeof options === "object" ? options : {};
613
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
614
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
615
+ return false;
616
+ }
617
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
618
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
619
+ return !!apiKey;
620
+ };
621
+ try {
622
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
623
+ } catch {
624
+ return false;
625
+ }
563
626
  },
564
627
  async handler(runtime, message, _state, _options, callback) {
565
628
  try {
@@ -786,9 +849,30 @@ var deleteIssueAction = {
786
849
  }
787
850
  ]
788
851
  ],
789
- async validate(runtime, _message, _state) {
790
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
791
- return !!apiKey;
852
+ validate: async (runtime, message, state, options) => {
853
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
854
+ const __avText = __avTextRaw.toLowerCase();
855
+ const __avKeywords = ["delete", "linear", "issue"];
856
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
857
+ const __avRegex = /\b(?:delete|linear|issue)\b/i;
858
+ const __avRegexOk = __avRegex.test(__avText);
859
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
860
+ const __avExpectedSource = "";
861
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
862
+ const __avOptions = options && typeof options === "object" ? options : {};
863
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
864
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
865
+ return false;
866
+ }
867
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
868
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
869
+ return !!apiKey;
870
+ };
871
+ try {
872
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
873
+ } catch {
874
+ return false;
875
+ }
792
876
  },
793
877
  async handler(runtime, message, _state, _options, callback) {
794
878
  try {
@@ -942,9 +1026,30 @@ var getActivityAction = {
942
1026
  }
943
1027
  ]
944
1028
  ],
945
- async validate(runtime, _message, _state) {
946
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
947
- return !!apiKey;
1029
+ validate: async (runtime, message, state, options) => {
1030
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
1031
+ const __avText = __avTextRaw.toLowerCase();
1032
+ const __avKeywords = ["get", "linear", "activity"];
1033
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
1034
+ const __avRegex = /\b(?:get|linear|activity)\b/i;
1035
+ const __avRegexOk = __avRegex.test(__avText);
1036
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
1037
+ const __avExpectedSource = "";
1038
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
1039
+ const __avOptions = options && typeof options === "object" ? options : {};
1040
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
1041
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
1042
+ return false;
1043
+ }
1044
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
1045
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
1046
+ return !!apiKey;
1047
+ };
1048
+ try {
1049
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
1050
+ } catch {
1051
+ return false;
1052
+ }
948
1053
  },
949
1054
  async handler(runtime, message, _state, _options, callback) {
950
1055
  try {
@@ -1153,9 +1258,30 @@ var getIssueAction = {
1153
1258
  }
1154
1259
  ]
1155
1260
  ],
1156
- async validate(runtime, _message, _state) {
1157
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
1158
- return !!apiKey;
1261
+ validate: async (runtime, message, state, options) => {
1262
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
1263
+ const __avText = __avTextRaw.toLowerCase();
1264
+ const __avKeywords = ["get", "linear", "issue"];
1265
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
1266
+ const __avRegex = /\b(?:get|linear|issue)\b/i;
1267
+ const __avRegexOk = __avRegex.test(__avText);
1268
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
1269
+ const __avExpectedSource = "";
1270
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
1271
+ const __avOptions = options && typeof options === "object" ? options : {};
1272
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
1273
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
1274
+ return false;
1275
+ }
1276
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
1277
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
1278
+ return !!apiKey;
1279
+ };
1280
+ try {
1281
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
1282
+ } catch {
1283
+ return false;
1284
+ }
1159
1285
  },
1160
1286
  async handler(runtime, message, _state, _options, callback) {
1161
1287
  try {
@@ -1447,9 +1573,30 @@ var listProjectsAction = {
1447
1573
  }
1448
1574
  ]
1449
1575
  ],
1450
- async validate(runtime, _message, _state) {
1451
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
1452
- return !!apiKey;
1576
+ validate: async (runtime, message, state, options) => {
1577
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
1578
+ const __avText = __avTextRaw.toLowerCase();
1579
+ const __avKeywords = ["list", "linear", "projects"];
1580
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
1581
+ const __avRegex = /\b(?:list|linear|projects)\b/i;
1582
+ const __avRegexOk = __avRegex.test(__avText);
1583
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
1584
+ const __avExpectedSource = "";
1585
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
1586
+ const __avOptions = options && typeof options === "object" ? options : {};
1587
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
1588
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
1589
+ return false;
1590
+ }
1591
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
1592
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
1593
+ return !!apiKey;
1594
+ };
1595
+ try {
1596
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
1597
+ } catch {
1598
+ return false;
1599
+ }
1453
1600
  },
1454
1601
  async handler(runtime, message, _state, _options, callback) {
1455
1602
  try {
@@ -1670,9 +1817,30 @@ var listTeamsAction = {
1670
1817
  }
1671
1818
  ]
1672
1819
  ],
1673
- async validate(runtime, _message, _state) {
1674
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
1675
- return !!apiKey;
1820
+ validate: async (runtime, message, state, options) => {
1821
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
1822
+ const __avText = __avTextRaw.toLowerCase();
1823
+ const __avKeywords = ["list", "linear", "teams"];
1824
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
1825
+ const __avRegex = /\b(?:list|linear|teams)\b/i;
1826
+ const __avRegexOk = __avRegex.test(__avText);
1827
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
1828
+ const __avExpectedSource = "";
1829
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
1830
+ const __avOptions = options && typeof options === "object" ? options : {};
1831
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
1832
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
1833
+ return false;
1834
+ }
1835
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
1836
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
1837
+ return !!apiKey;
1838
+ };
1839
+ try {
1840
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
1841
+ } catch {
1842
+ return false;
1843
+ }
1676
1844
  },
1677
1845
  async handler(runtime, message, _state, _options, callback) {
1678
1846
  try {
@@ -1874,9 +2042,30 @@ var searchIssuesAction = {
1874
2042
  }
1875
2043
  ]
1876
2044
  ],
1877
- async validate(runtime, _message, _state) {
1878
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
1879
- return !!apiKey;
2045
+ validate: async (runtime, message, state, options) => {
2046
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
2047
+ const __avText = __avTextRaw.toLowerCase();
2048
+ const __avKeywords = ["search", "linear", "issues"];
2049
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
2050
+ const __avRegex = /\b(?:search|linear|issues)\b/i;
2051
+ const __avRegexOk = __avRegex.test(__avText);
2052
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
2053
+ const __avExpectedSource = "";
2054
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
2055
+ const __avOptions = options && typeof options === "object" ? options : {};
2056
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
2057
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
2058
+ return false;
2059
+ }
2060
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
2061
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
2062
+ return !!apiKey;
2063
+ };
2064
+ try {
2065
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
2066
+ } catch {
2067
+ return false;
2068
+ }
1880
2069
  },
1881
2070
  async handler(runtime, message, _state, _options, callback) {
1882
2071
  try {
@@ -2120,9 +2309,30 @@ var updateIssueAction = {
2120
2309
  }
2121
2310
  ]
2122
2311
  ],
2123
- async validate(runtime, _message, _state) {
2124
- const apiKey = runtime.getSetting("LINEAR_API_KEY");
2125
- return !!apiKey;
2312
+ validate: async (runtime, message, state, options) => {
2313
+ const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
2314
+ const __avText = __avTextRaw.toLowerCase();
2315
+ const __avKeywords = ["update", "linear", "issue"];
2316
+ const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
2317
+ const __avRegex = /\b(?:update|linear|issue)\b/i;
2318
+ const __avRegexOk = __avRegex.test(__avText);
2319
+ const __avSource = String(message?.content?.source ?? message?.source ?? "");
2320
+ const __avExpectedSource = "";
2321
+ const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
2322
+ const __avOptions = options && typeof options === "object" ? options : {};
2323
+ const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
2324
+ if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
2325
+ return false;
2326
+ }
2327
+ const __avLegacyValidate = async (runtime2, _message, _state) => {
2328
+ const apiKey = runtime2.getSetting("LINEAR_API_KEY");
2329
+ return !!apiKey;
2330
+ };
2331
+ try {
2332
+ return Boolean(await __avLegacyValidate(runtime, message, state, options));
2333
+ } catch {
2334
+ return false;
2335
+ }
2126
2336
  },
2127
2337
  async handler(runtime, message, _state, _options, callback) {
2128
2338
  try {
@@ -2316,6 +2526,7 @@ View it at: ${updatedIssue.url}`;
2316
2526
  var linearActivityProvider = {
2317
2527
  name: "LINEAR_ACTIVITY",
2318
2528
  description: "Provides context about recent Linear activity",
2529
+ dynamic: true,
2319
2530
  get: async (runtime, _message, _state) => {
2320
2531
  try {
2321
2532
  const linearService = runtime.getService("linear");
@@ -2365,6 +2576,7 @@ ${activityList.join(`
2365
2576
  var linearIssuesProvider = {
2366
2577
  name: "LINEAR_ISSUES",
2367
2578
  description: "Provides context about recent Linear issues",
2579
+ dynamic: true,
2368
2580
  get: async (runtime, _message, _state) => {
2369
2581
  try {
2370
2582
  const linearService = runtime.getService("linear");
@@ -2408,6 +2620,7 @@ ${issuesList.join(`
2408
2620
  var linearProjectsProvider = {
2409
2621
  name: "LINEAR_PROJECTS",
2410
2622
  description: "Provides context about active Linear projects",
2623
+ dynamic: true,
2411
2624
  get: async (runtime, _message, _state) => {
2412
2625
  try {
2413
2626
  const linearService = runtime.getService("linear");
@@ -2449,6 +2662,7 @@ ${projectsList.join(`
2449
2662
  var linearTeamsProvider = {
2450
2663
  name: "LINEAR_TEAMS",
2451
2664
  description: "Provides context about Linear teams",
2665
+ dynamic: true,
2452
2666
  get: async (runtime, _message, _state) => {
2453
2667
  try {
2454
2668
  const linearService = runtime.getService("linear");
@@ -2830,4 +3044,4 @@ export {
2830
3044
  LinearService
2831
3045
  };
2832
3046
 
2833
- //# debugId=AB1E47AE7B755C0964756E2164756E21
3047
+ //# debugId=FD61149701EB826464756E2164756E21