@elizaos/plugin-linear 1.2.8 → 1.2.9

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
@@ -419,7 +419,7 @@ var createIssueAction = {
419
419
  return false;
420
420
  }
421
421
  },
422
- async handler(runtime, message, _state, _options) {
422
+ async handler(runtime, message, _state, _options, callback) {
423
423
  try {
424
424
  const linearService = runtime.getService("linear");
425
425
  if (!linearService) {
@@ -427,8 +427,13 @@ var createIssueAction = {
427
427
  }
428
428
  const content = message.content.text;
429
429
  if (!content) {
430
+ const errorMessage = "Please provide a description for the issue.";
431
+ await callback?.({
432
+ text: errorMessage,
433
+ source: message.content.source
434
+ });
430
435
  return {
431
- text: "Please provide a description for the issue.",
436
+ text: errorMessage,
432
437
  success: false
433
438
  };
434
439
  }
@@ -509,18 +514,35 @@ var createIssueAction = {
509
514
  }
510
515
  }
511
516
  if (!issueData.title) {
517
+ const errorMessage = "Could not determine issue title. Please provide more details.";
518
+ await callback?.({
519
+ text: errorMessage,
520
+ source: message.content.source
521
+ });
512
522
  return {
513
- text: "Could not determine issue title. Please provide more details.",
523
+ text: errorMessage,
514
524
  success: false
515
525
  };
516
526
  }
517
527
  if (!issueData.teamId) {
528
+ const errorMessage = "No Linear teams found. Please ensure at least one team exists in your Linear workspace.";
529
+ await callback?.({
530
+ text: errorMessage,
531
+ source: message.content.source
532
+ });
518
533
  return {
519
- text: "No Linear teams found. Please ensure at least one team exists in your Linear workspace.",
534
+ text: errorMessage,
520
535
  success: false
521
536
  };
522
537
  }
523
538
  const issue = await linearService.createIssue(issueData);
539
+ const successMessage = `\u2705 Created Linear issue: ${issue.title} (${issue.identifier})
540
+
541
+ View it at: ${issue.url}`;
542
+ await callback?.({
543
+ text: successMessage,
544
+ source: message.content.source
545
+ });
524
546
  return {
525
547
  text: `Created issue: ${issue.title} (${issue.identifier})`,
526
548
  success: true,
@@ -532,8 +554,13 @@ var createIssueAction = {
532
554
  };
533
555
  } catch (error) {
534
556
  logger2.error("Failed to create issue:", error);
557
+ const errorMessage = `\u274C Failed to create issue: ${error instanceof Error ? error.message : "Unknown error"}`;
558
+ await callback?.({
559
+ text: errorMessage,
560
+ source: message.content.source
561
+ });
535
562
  return {
536
- text: `Failed to create issue: ${error instanceof Error ? error.message : "Unknown error"}`,
563
+ text: errorMessage,
537
564
  success: false
538
565
  };
539
566
  }
@@ -583,7 +610,7 @@ var getIssueAction = {
583
610
  return false;
584
611
  }
585
612
  },
586
- async handler(runtime, message, _state, _options) {
613
+ async handler(runtime, message, _state, _options, callback) {
587
614
  try {
588
615
  const linearService = runtime.getService("linear");
589
616
  if (!linearService) {
@@ -591,15 +618,25 @@ var getIssueAction = {
591
618
  }
592
619
  const content = message.content.text;
593
620
  if (!content) {
621
+ const errorMessage = "Please specify an issue ID.";
622
+ await callback?.({
623
+ text: errorMessage,
624
+ source: message.content.source
625
+ });
594
626
  return {
595
- text: "Please specify an issue ID.",
627
+ text: errorMessage,
596
628
  success: false
597
629
  };
598
630
  }
599
631
  const issueMatch = content.match(/(\w+-\d+)/);
600
632
  if (!issueMatch) {
633
+ const errorMessage = "Please provide a valid issue ID (e.g., ENG-123).";
634
+ await callback?.({
635
+ text: errorMessage,
636
+ source: message.content.source
637
+ });
601
638
  return {
602
- text: "Please provide a valid issue ID (e.g., ENG-123).",
639
+ text: errorMessage,
603
640
  success: false
604
641
  };
605
642
  }
@@ -648,7 +685,7 @@ var getIssueAction = {
648
685
  name: project.name
649
686
  } : null
650
687
  };
651
- let responseText = `Issue ${issue.identifier}: ${issue.title}
688
+ let responseText = `\u{1F4CB} Issue ${issue.identifier}: ${issue.title}
652
689
  `;
653
690
  responseText += `Status: ${state?.name || "Unknown"}
654
691
  `;
@@ -669,6 +706,10 @@ Description: ${issue.description}
669
706
  }
670
707
  responseText += `
671
708
  View in Linear: ${issue.url}`;
709
+ await callback?.({
710
+ text: responseText,
711
+ source: message.content.source
712
+ });
672
713
  return {
673
714
  text: responseText,
674
715
  success: true,
@@ -676,8 +717,13 @@ View in Linear: ${issue.url}`;
676
717
  };
677
718
  } catch (error) {
678
719
  logger3.error("Failed to get issue:", error);
720
+ const errorMessage = `\u274C Failed to get issue: ${error instanceof Error ? error.message : "Unknown error"}`;
721
+ await callback?.({
722
+ text: errorMessage,
723
+ source: message.content.source
724
+ });
679
725
  return {
680
- text: `Failed to get issue: ${error instanceof Error ? error.message : "Unknown error"}`,
726
+ text: errorMessage,
681
727
  success: false
682
728
  };
683
729
  }
@@ -727,7 +773,7 @@ var updateIssueAction = {
727
773
  return false;
728
774
  }
729
775
  },
730
- async handler(runtime, message, _state, _options) {
776
+ async handler(runtime, message, _state, _options, callback) {
731
777
  try {
732
778
  const linearService = runtime.getService("linear");
733
779
  if (!linearService) {
@@ -735,15 +781,25 @@ var updateIssueAction = {
735
781
  }
736
782
  const content = message.content.text;
737
783
  if (!content) {
784
+ const errorMessage = "Please provide update instructions for the issue.";
785
+ await callback?.({
786
+ text: errorMessage,
787
+ source: message.content.source
788
+ });
738
789
  return {
739
- text: "Please provide update instructions for the issue.",
790
+ text: errorMessage,
740
791
  success: false
741
792
  };
742
793
  }
743
794
  const issueMatch = content.match(/(\w+-\d+)/);
744
795
  if (!issueMatch) {
796
+ const errorMessage = "Please specify an issue ID (e.g., ENG-123) to update.";
797
+ await callback?.({
798
+ text: errorMessage,
799
+ source: message.content.source
800
+ });
745
801
  return {
746
- text: "Please specify an issue ID (e.g., ENG-123) to update.",
802
+ text: errorMessage,
747
803
  success: false
748
804
  };
749
805
  }
@@ -776,13 +832,25 @@ var updateIssueAction = {
776
832
  logger4.warn("Status updates not yet implemented");
777
833
  }
778
834
  if (Object.keys(updates).length === 0) {
835
+ const errorMessage = `No valid updates found. Please specify what to update (e.g., "Update issue ENG-123 title to 'New Title'")`;
836
+ await callback?.({
837
+ text: errorMessage,
838
+ source: message.content.source
839
+ });
779
840
  return {
780
- text: `No valid updates found. Please specify what to update (e.g., "Update issue ENG-123 title to 'New Title'")`,
841
+ text: errorMessage,
781
842
  success: false
782
843
  };
783
844
  }
784
845
  const updatedIssue = await linearService.updateIssue(issueId, updates);
785
846
  const updateSummary = Object.entries(updates).map(([key, value]) => `${key}: ${value}`).join(", ");
847
+ const successMessage = `\u2705 Updated issue ${updatedIssue.identifier}: ${updateSummary}
848
+
849
+ View it at: ${updatedIssue.url}`;
850
+ await callback?.({
851
+ text: successMessage,
852
+ source: message.content.source
853
+ });
786
854
  return {
787
855
  text: `Updated issue ${updatedIssue.identifier}: ${updateSummary}`,
788
856
  success: true,
@@ -795,8 +863,13 @@ var updateIssueAction = {
795
863
  };
796
864
  } catch (error) {
797
865
  logger4.error("Failed to update issue:", error);
866
+ const errorMessage = `\u274C Failed to update issue: ${error instanceof Error ? error.message : "Unknown error"}`;
867
+ await callback?.({
868
+ text: errorMessage,
869
+ source: message.content.source
870
+ });
798
871
  return {
799
- text: `Failed to update issue: ${error instanceof Error ? error.message : "Unknown error"}`,
872
+ text: errorMessage,
800
873
  success: false
801
874
  };
802
875
  }
@@ -866,7 +939,7 @@ var searchIssuesAction = {
866
939
  return false;
867
940
  }
868
941
  },
869
- async handler(runtime, message, _state, _options) {
942
+ async handler(runtime, message, _state, _options, callback) {
870
943
  try {
871
944
  const linearService = runtime.getService("linear");
872
945
  if (!linearService) {
@@ -874,8 +947,13 @@ var searchIssuesAction = {
874
947
  }
875
948
  const content = message.content.text;
876
949
  if (!content) {
950
+ const errorMessage = "Please provide search criteria for issues.";
951
+ await callback?.({
952
+ text: errorMessage,
953
+ source: message.content.source
954
+ });
877
955
  return {
878
- text: "Please provide search criteria for issues.",
956
+ text: errorMessage,
879
957
  success: false
880
958
  };
881
959
  }
@@ -916,8 +994,13 @@ var searchIssuesAction = {
916
994
  filters.limit = _options?.limit || 10;
917
995
  const issues = await linearService.searchIssues(filters);
918
996
  if (issues.length === 0) {
997
+ const noResultsMessage = "No issues found matching your search criteria.";
998
+ await callback?.({
999
+ text: noResultsMessage,
1000
+ source: message.content.source
1001
+ });
919
1002
  return {
920
- text: "No issues found matching your search criteria.",
1003
+ text: noResultsMessage,
921
1004
  success: true,
922
1005
  data: {
923
1006
  issues: [],
@@ -931,6 +1014,12 @@ var searchIssuesAction = {
931
1014
  return `${index + 1}. ${issue.identifier}: ${issue.title} (${state?.name || "No state"})`;
932
1015
  }));
933
1016
  const issueText = issueList.join("\n");
1017
+ const resultMessage = `\u{1F4CB} Found ${issues.length} issue${issues.length === 1 ? "" : "s"}:
1018
+ ${issueText}`;
1019
+ await callback?.({
1020
+ text: resultMessage,
1021
+ source: message.content.source
1022
+ });
934
1023
  return {
935
1024
  text: `Found ${issues.length} issue${issues.length === 1 ? "" : "s"}:
936
1025
  ${issueText}`,
@@ -953,8 +1042,13 @@ ${issueText}`,
953
1042
  };
954
1043
  } catch (error) {
955
1044
  logger5.error("Failed to search issues:", error);
1045
+ const errorMessage = `\u274C Failed to search issues: ${error instanceof Error ? error.message : "Unknown error"}`;
1046
+ await callback?.({
1047
+ text: errorMessage,
1048
+ source: message.content.source
1049
+ });
956
1050
  return {
957
- text: `Failed to search issues: ${error instanceof Error ? error.message : "Unknown error"}`,
1051
+ text: errorMessage,
958
1052
  success: false
959
1053
  };
960
1054
  }
@@ -1004,7 +1098,7 @@ var createCommentAction = {
1004
1098
  return false;
1005
1099
  }
1006
1100
  },
1007
- async handler(runtime, message, _state, _options) {
1101
+ async handler(runtime, message, _state, _options, callback) {
1008
1102
  try {
1009
1103
  const linearService = runtime.getService("linear");
1010
1104
  if (!linearService) {
@@ -1012,15 +1106,25 @@ var createCommentAction = {
1012
1106
  }
1013
1107
  const content = message.content.text;
1014
1108
  if (!content) {
1109
+ const errorMessage = "Please provide a message with the issue ID and comment content.";
1110
+ await callback?.({
1111
+ text: errorMessage,
1112
+ source: message.content.source
1113
+ });
1015
1114
  return {
1016
- text: "Please provide a message with the issue ID and comment content.",
1115
+ text: errorMessage,
1017
1116
  success: false
1018
1117
  };
1019
1118
  }
1020
1119
  const issueMatch = content.match(/(?:comment on|add.*comment.*to)\s+(\w+-\d+):?\s*(.*)/i);
1021
1120
  if (!issueMatch) {
1121
+ const errorMessage = 'Please specify the issue ID and comment content. Example: "Comment on ENG-123: This looks good"';
1122
+ await callback?.({
1123
+ text: errorMessage,
1124
+ source: message.content.source
1125
+ });
1022
1126
  return {
1023
- text: 'Please specify the issue ID and comment content. Example: "Comment on ENG-123: This looks good"',
1127
+ text: errorMessage,
1024
1128
  success: false
1025
1129
  };
1026
1130
  }
@@ -1030,6 +1134,11 @@ var createCommentAction = {
1030
1134
  issueId: issue.id,
1031
1135
  body: commentBody.trim()
1032
1136
  });
1137
+ const successMessage = `\u2705 Comment added to issue ${issueIdentifier}: "${commentBody.trim()}"`;
1138
+ await callback?.({
1139
+ text: successMessage,
1140
+ source: message.content.source
1141
+ });
1033
1142
  return {
1034
1143
  text: `Comment added to issue ${issueIdentifier}: "${commentBody.trim()}"`,
1035
1144
  success: true,
@@ -1040,8 +1149,13 @@ var createCommentAction = {
1040
1149
  };
1041
1150
  } catch (error) {
1042
1151
  logger6.error("Failed to create comment:", error);
1152
+ const errorMessage = `\u274C Failed to create comment: ${error instanceof Error ? error.message : "Unknown error"}`;
1153
+ await callback?.({
1154
+ text: errorMessage,
1155
+ source: message.content.source
1156
+ });
1043
1157
  return {
1044
- text: `Failed to create comment: ${error instanceof Error ? error.message : "Unknown error"}`,
1158
+ text: errorMessage,
1045
1159
  success: false
1046
1160
  };
1047
1161
  }
@@ -1091,7 +1205,7 @@ var listTeamsAction = {
1091
1205
  return false;
1092
1206
  }
1093
1207
  },
1094
- async handler(runtime, _message, _state, _options) {
1208
+ async handler(runtime, message, _state, _options, callback) {
1095
1209
  try {
1096
1210
  const linearService = runtime.getService("linear");
1097
1211
  if (!linearService) {
@@ -1099,8 +1213,13 @@ var listTeamsAction = {
1099
1213
  }
1100
1214
  const teams = await linearService.getTeams();
1101
1215
  if (teams.length === 0) {
1216
+ const noTeamsMessage = "No teams found in Linear.";
1217
+ await callback?.({
1218
+ text: noTeamsMessage,
1219
+ source: message.content.source
1220
+ });
1102
1221
  return {
1103
- text: "No teams found in Linear.",
1222
+ text: noTeamsMessage,
1104
1223
  success: true,
1105
1224
  data: {
1106
1225
  teams: []
@@ -1110,6 +1229,12 @@ var listTeamsAction = {
1110
1229
  const teamList = teams.map(
1111
1230
  (team, index) => `${index + 1}. ${team.name} (${team.key})${team.description ? ` - ${team.description}` : ""}`
1112
1231
  ).join("\n");
1232
+ const resultMessage = `\u{1F465} Found ${teams.length} team${teams.length === 1 ? "" : "s"}:
1233
+ ${teamList}`;
1234
+ await callback?.({
1235
+ text: resultMessage,
1236
+ source: message.content.source
1237
+ });
1113
1238
  return {
1114
1239
  text: `Found ${teams.length} team${teams.length === 1 ? "" : "s"}:
1115
1240
  ${teamList}`,
@@ -1126,8 +1251,13 @@ ${teamList}`,
1126
1251
  };
1127
1252
  } catch (error) {
1128
1253
  logger7.error("Failed to list teams:", error);
1254
+ const errorMessage = `\u274C Failed to list teams: ${error instanceof Error ? error.message : "Unknown error"}`;
1255
+ await callback?.({
1256
+ text: errorMessage,
1257
+ source: message.content.source
1258
+ });
1129
1259
  return {
1130
- text: `Failed to list teams: ${error instanceof Error ? error.message : "Unknown error"}`,
1260
+ text: errorMessage,
1131
1261
  success: false
1132
1262
  };
1133
1263
  }
@@ -1177,7 +1307,7 @@ var listProjectsAction = {
1177
1307
  return false;
1178
1308
  }
1179
1309
  },
1180
- async handler(runtime, _message, _state, _options) {
1310
+ async handler(runtime, message, _state, _options, callback) {
1181
1311
  try {
1182
1312
  const linearService = runtime.getService("linear");
1183
1313
  if (!linearService) {
@@ -1185,8 +1315,13 @@ var listProjectsAction = {
1185
1315
  }
1186
1316
  const projects = await linearService.getProjects();
1187
1317
  if (projects.length === 0) {
1318
+ const noProjectsMessage = "No projects found in Linear.";
1319
+ await callback?.({
1320
+ text: noProjectsMessage,
1321
+ source: message.content.source
1322
+ });
1188
1323
  return {
1189
- text: "No projects found in Linear.",
1324
+ text: noProjectsMessage,
1190
1325
  success: true,
1191
1326
  data: {
1192
1327
  projects: []
@@ -1207,6 +1342,12 @@ var listProjectsAction = {
1207
1342
  const teamNames = project.teamsList.map((t) => t.name).join(", ") || "No teams";
1208
1343
  return `${index + 1}. ${project.name}${project.description ? ` - ${project.description}` : ""} (Teams: ${teamNames})`;
1209
1344
  }).join("\n");
1345
+ const resultMessage = `\u{1F4C1} Found ${projects.length} project${projects.length === 1 ? "" : "s"}:
1346
+ ${projectList}`;
1347
+ await callback?.({
1348
+ text: resultMessage,
1349
+ source: message.content.source
1350
+ });
1210
1351
  return {
1211
1352
  text: `Found ${projects.length} project${projects.length === 1 ? "" : "s"}:
1212
1353
  ${projectList}`,
@@ -1232,8 +1373,13 @@ ${projectList}`,
1232
1373
  };
1233
1374
  } catch (error) {
1234
1375
  logger8.error("Failed to list projects:", error);
1376
+ const errorMessage = `\u274C Failed to list projects: ${error instanceof Error ? error.message : "Unknown error"}`;
1377
+ await callback?.({
1378
+ text: errorMessage,
1379
+ source: message.content.source
1380
+ });
1235
1381
  return {
1236
- text: `Failed to list projects: ${error instanceof Error ? error.message : "Unknown error"}`,
1382
+ text: errorMessage,
1237
1383
  success: false
1238
1384
  };
1239
1385
  }
@@ -1283,7 +1429,7 @@ var getActivityAction = {
1283
1429
  return false;
1284
1430
  }
1285
1431
  },
1286
- async handler(runtime, _message, _state, _options) {
1432
+ async handler(runtime, message, _state, _options, callback) {
1287
1433
  try {
1288
1434
  const linearService = runtime.getService("linear");
1289
1435
  if (!linearService) {
@@ -1291,8 +1437,13 @@ var getActivityAction = {
1291
1437
  }
1292
1438
  const activity = linearService.getActivityLog();
1293
1439
  if (activity.length === 0) {
1440
+ const noActivityMessage = "No recent Linear activity found.";
1441
+ await callback?.({
1442
+ text: noActivityMessage,
1443
+ source: message.content.source
1444
+ });
1294
1445
  return {
1295
- text: "No recent Linear activity found.",
1446
+ text: noActivityMessage,
1296
1447
  success: true,
1297
1448
  data: {
1298
1449
  activity: []
@@ -1303,6 +1454,12 @@ var getActivityAction = {
1303
1454
  const description = `${item.action} ${item.resource_type} ${item.resource_id}${item.error ? ` (failed: ${item.error})` : ""}`;
1304
1455
  return `${index + 1}. ${description}`;
1305
1456
  }).join("\n");
1457
+ const resultMessage = `\u{1F4CA} Recent Linear activity:
1458
+ ${activityText}`;
1459
+ await callback?.({
1460
+ text: resultMessage,
1461
+ source: message.content.source
1462
+ });
1306
1463
  return {
1307
1464
  text: `Recent Linear activity:
1308
1465
  ${activityText}`,
@@ -1314,8 +1471,13 @@ ${activityText}`,
1314
1471
  };
1315
1472
  } catch (error) {
1316
1473
  logger9.error("Failed to get Linear activity:", error);
1474
+ const errorMessage = `\u274C Failed to get Linear activity: ${error instanceof Error ? error.message : "Unknown error"}`;
1475
+ await callback?.({
1476
+ text: errorMessage,
1477
+ source: message.content.source
1478
+ });
1317
1479
  return {
1318
- text: `Failed to get Linear activity: ${error instanceof Error ? error.message : "Unknown error"}`,
1480
+ text: errorMessage,
1319
1481
  success: false
1320
1482
  };
1321
1483
  }
@@ -1365,21 +1527,31 @@ var clearActivityAction = {
1365
1527
  return false;
1366
1528
  }
1367
1529
  },
1368
- async handler(runtime, message, _state, _options) {
1530
+ async handler(runtime, message, _state, _options, callback) {
1369
1531
  try {
1370
1532
  const linearService = runtime.getService("linear");
1371
1533
  if (!linearService) {
1372
1534
  throw new Error("Linear service not available");
1373
1535
  }
1374
1536
  await linearService.clearActivityLog();
1537
+ const successMessage = "\u2705 Linear activity log has been cleared.";
1538
+ await callback?.({
1539
+ text: successMessage,
1540
+ source: message.content.source
1541
+ });
1375
1542
  return {
1376
- text: "Linear activity log has been cleared.",
1543
+ text: successMessage,
1377
1544
  success: true
1378
1545
  };
1379
1546
  } catch (error) {
1380
1547
  logger10.error("Failed to clear Linear activity:", error);
1548
+ const errorMessage = `\u274C Failed to clear Linear activity: ${error instanceof Error ? error.message : "Unknown error"}`;
1549
+ await callback?.({
1550
+ text: errorMessage,
1551
+ source: message.content.source
1552
+ });
1381
1553
  return {
1382
- text: `Failed to clear Linear activity: ${error instanceof Error ? error.message : "Unknown error"}`,
1554
+ text: errorMessage,
1383
1555
  success: false
1384
1556
  };
1385
1557
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/services/linear.ts","../src/types/index.ts","../src/actions/createIssue.ts","../src/actions/getIssue.ts","../src/actions/updateIssue.ts","../src/actions/searchIssues.ts","../src/actions/createComment.ts","../src/actions/listTeams.ts","../src/actions/listProjects.ts","../src/actions/getActivity.ts","../src/actions/clearActivity.ts","../src/providers/issues.ts","../src/providers/teams.ts","../src/providers/projects.ts","../src/providers/activity.ts","../src/index.ts"],"sourcesContent":["import { logger, Service, type IAgentRuntime } from '@elizaos/core';\nimport { LinearClient, Issue, Project, Team, User, WorkflowState, IssueLabel, Comment } from '@linear/sdk';\nimport type { \n LinearConfig, \n LinearActivityItem, \n LinearIssueInput, \n LinearCommentInput,\n LinearSearchFilters \n} from '../types';\nimport { LinearAPIError, LinearAuthenticationError } from '../types';\n\nexport class LinearService extends Service {\n static serviceType = 'linear';\n \n capabilityDescription = 'Linear API integration for issue tracking, project management, and team collaboration';\n \n private client: LinearClient;\n private activityLog: LinearActivityItem[] = [];\n private linearConfig: LinearConfig;\n private workspaceId?: string;\n \n constructor(runtime?: IAgentRuntime) {\n super(runtime);\n \n // Get config from runtime settings\n const apiKey = runtime?.getSetting('LINEAR_API_KEY') as string;\n const workspaceId = runtime?.getSetting('LINEAR_WORKSPACE_ID') as string;\n \n if (!apiKey) {\n throw new LinearAuthenticationError('Linear API key is required');\n }\n \n this.linearConfig = {\n LINEAR_API_KEY: apiKey,\n LINEAR_WORKSPACE_ID: workspaceId,\n };\n \n this.workspaceId = workspaceId;\n \n this.config = {\n LINEAR_API_KEY: apiKey,\n LINEAR_WORKSPACE_ID: workspaceId,\n };\n \n this.client = new LinearClient({\n apiKey: this.linearConfig.LINEAR_API_KEY,\n });\n }\n \n static async start(runtime: IAgentRuntime): Promise<LinearService> {\n const service = new LinearService(runtime);\n await service.validateConnection();\n logger.info('Linear service started successfully');\n return service;\n }\n \n async stop(): Promise<void> {\n this.activityLog = [];\n logger.info('Linear service stopped');\n }\n \n // Validate the API connection\n private async validateConnection(): Promise<void> {\n try {\n const viewer = await this.client.viewer;\n logger.info(`Linear connected as user: ${viewer.email}`);\n } catch (error) {\n throw new LinearAuthenticationError('Failed to authenticate with Linear API');\n }\n }\n \n // Log activity\n private logActivity(\n action: string,\n resourceType: LinearActivityItem['resource_type'],\n resourceId: string,\n details: Record<string, any>,\n success: boolean,\n error?: string\n ): void {\n const activity: LinearActivityItem = {\n id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n timestamp: new Date().toISOString(),\n action,\n resource_type: resourceType,\n resource_id: resourceId,\n details,\n success,\n error,\n };\n \n this.activityLog.push(activity);\n \n // Keep only last 1000 activities\n if (this.activityLog.length > 1000) {\n this.activityLog = this.activityLog.slice(-1000);\n }\n }\n \n // Get activity log\n getActivityLog(limit?: number, filter?: Partial<LinearActivityItem>): LinearActivityItem[] {\n let filtered = [...this.activityLog];\n \n if (filter) {\n filtered = filtered.filter(item => {\n return Object.entries(filter).every(([key, value]) => {\n return item[key as keyof LinearActivityItem] === value;\n });\n });\n }\n \n return filtered.slice(-(limit || 100));\n }\n \n // Clear activity log\n clearActivityLog(): void {\n this.activityLog = [];\n logger.info('Linear activity log cleared');\n }\n \n // Team operations\n async getTeams(): Promise<Team[]> {\n try {\n const teams = await this.client.teams();\n const teamList = await teams.nodes;\n \n this.logActivity('list_teams', 'team', 'all', { count: teamList.length }, true);\n return teamList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_teams', 'team', 'all', {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch teams: ${errorMessage}`);\n }\n }\n \n async getTeam(teamId: string): Promise<Team> {\n try {\n const team = await this.client.team(teamId);\n this.logActivity('get_team', 'team', teamId, { name: team.name }, true);\n return team;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('get_team', 'team', teamId, {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch team: ${errorMessage}`);\n }\n }\n \n // Issue operations\n async createIssue(input: LinearIssueInput): Promise<Issue> {\n try {\n const issuePayload = await this.client.createIssue({\n title: input.title,\n description: input.description,\n teamId: input.teamId,\n priority: input.priority,\n assigneeId: input.assigneeId,\n labelIds: input.labelIds,\n projectId: input.projectId,\n stateId: input.stateId,\n estimate: input.estimate,\n dueDate: input.dueDate,\n });\n \n const issue = await issuePayload.issue;\n if (!issue) {\n throw new Error('Failed to create issue');\n }\n \n this.logActivity('create_issue', 'issue', issue.id, { \n title: input.title,\n teamId: input.teamId \n }, true);\n \n return issue;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('create_issue', 'issue', 'new', input, false, errorMessage);\n throw new LinearAPIError(`Failed to create issue: ${errorMessage}`);\n }\n }\n \n async getIssue(issueId: string): Promise<Issue> {\n try {\n const issue = await this.client.issue(issueId);\n this.logActivity('get_issue', 'issue', issueId, { \n title: issue.title,\n identifier: issue.identifier \n }, true);\n return issue;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('get_issue', 'issue', issueId, {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch issue: ${errorMessage}`);\n }\n }\n \n async updateIssue(issueId: string, updates: Partial<LinearIssueInput>): Promise<Issue> {\n try {\n const updatePayload = await this.client.updateIssue(issueId, {\n title: updates.title,\n description: updates.description,\n priority: updates.priority,\n assigneeId: updates.assigneeId,\n labelIds: updates.labelIds,\n projectId: updates.projectId,\n stateId: updates.stateId,\n estimate: updates.estimate,\n dueDate: updates.dueDate,\n });\n \n const issue = await updatePayload.issue;\n if (!issue) {\n throw new Error('Failed to update issue');\n }\n \n this.logActivity('update_issue', 'issue', issueId, updates, true);\n return issue;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('update_issue', 'issue', issueId, updates, false, errorMessage);\n throw new LinearAPIError(`Failed to update issue: ${errorMessage}`);\n }\n }\n \n async searchIssues(filters: LinearSearchFilters): Promise<Issue[]> {\n try {\n const query = this.client.issues({\n first: filters.limit || 50,\n filter: filters.query ? {\n or: [\n { title: { containsIgnoreCase: filters.query } },\n { description: { containsIgnoreCase: filters.query } },\n ],\n } : undefined,\n });\n \n const issues = await query;\n const issueList = await issues.nodes;\n \n this.logActivity('search_issues', 'issue', 'search', { \n filters,\n count: issueList.length \n }, true);\n \n return issueList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('search_issues', 'issue', 'search', filters, false, errorMessage);\n throw new LinearAPIError(`Failed to search issues: ${errorMessage}`);\n }\n }\n \n // Comment operations\n async createComment(input: LinearCommentInput): Promise<Comment> {\n try {\n const commentPayload = await this.client.createComment({\n body: input.body,\n issueId: input.issueId,\n });\n \n const comment = await commentPayload.comment;\n if (!comment) {\n throw new Error('Failed to create comment');\n }\n \n this.logActivity('create_comment', 'comment', comment.id, { \n issueId: input.issueId,\n bodyLength: input.body.length \n }, true);\n \n return comment;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('create_comment', 'comment', 'new', input, false, errorMessage);\n throw new LinearAPIError(`Failed to create comment: ${errorMessage}`);\n }\n }\n \n // Project operations\n async getProjects(teamId?: string): Promise<Project[]> {\n try {\n // Note: Linear SDK v51 may not support direct team filtering on projects\n // Get all projects and filter manually if needed\n const query = this.client.projects({\n first: 100,\n });\n \n const projects = await query;\n let projectList = await projects.nodes;\n \n // Manual filtering by team if teamId is provided\n if (teamId) {\n const filteredProjects = await Promise.all(\n projectList.map(async (project) => {\n const projectTeams = await project.teams();\n const teamsList = await projectTeams.nodes;\n const hasTeam = teamsList.some((team: any) => team.id === teamId);\n return hasTeam ? project : null;\n })\n );\n projectList = filteredProjects.filter(Boolean) as Project[];\n }\n \n this.logActivity('list_projects', 'project', 'all', { \n count: projectList.length,\n teamId \n }, true);\n \n return projectList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_projects', 'project', 'all', { teamId }, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch projects: ${errorMessage}`);\n }\n }\n \n async getProject(projectId: string): Promise<Project> {\n try {\n const project = await this.client.project(projectId);\n this.logActivity('get_project', 'project', projectId, { \n name: project.name \n }, true);\n return project;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('get_project', 'project', projectId, {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch project: ${errorMessage}`);\n }\n }\n \n // User operations\n async getUsers(): Promise<User[]> {\n try {\n const users = await this.client.users();\n const userList = await users.nodes;\n \n this.logActivity('list_users', 'user', 'all', { \n count: userList.length \n }, true);\n \n return userList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_users', 'user', 'all', {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch users: ${errorMessage}`);\n }\n }\n \n async getCurrentUser(): Promise<User> {\n try {\n const user = await this.client.viewer;\n this.logActivity('get_current_user', 'user', user.id, { \n email: user.email,\n name: user.name \n }, true);\n return user;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('get_current_user', 'user', 'current', {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch current user: ${errorMessage}`);\n }\n }\n \n // Label operations\n async getLabels(teamId?: string): Promise<IssueLabel[]> {\n try {\n const query = this.client.issueLabels({\n first: 100,\n filter: teamId ? {\n team: { id: { eq: teamId } },\n } : undefined,\n });\n \n const labels = await query;\n const labelList = await labels.nodes;\n \n this.logActivity('list_labels', 'label', 'all', { \n count: labelList.length,\n teamId \n }, true);\n \n return labelList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_labels', 'label', 'all', { teamId }, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch labels: ${errorMessage}`);\n }\n }\n \n // Workflow state operations\n async getWorkflowStates(teamId: string): Promise<WorkflowState[]> {\n try {\n const states = await this.client.workflowStates({\n filter: {\n team: { id: { eq: teamId } },\n },\n });\n \n const stateList = await states.nodes;\n \n this.logActivity('list_workflow_states', 'team', teamId, { \n count: stateList.length \n }, true);\n \n return stateList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_workflow_states', 'team', teamId, {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch workflow states: ${errorMessage}`);\n }\n }\n} ","export interface LinearConfig {\n LINEAR_API_KEY: string;\n LINEAR_WORKSPACE_ID?: string;\n}\n\nexport interface LinearActivityItem {\n id: string;\n timestamp: string;\n action: string;\n resource_type: 'issue' | 'project' | 'comment' | 'label' | 'user' | 'team';\n resource_id: string;\n details: Record<string, any>;\n success: boolean;\n error?: string;\n}\n\nexport interface LinearIssueInput {\n title: string;\n description?: string;\n teamId: string;\n priority?: number; // 0 = No priority, 1 = Urgent, 2 = High, 3 = Normal, 4 = Low\n assigneeId?: string;\n labelIds?: string[];\n projectId?: string;\n stateId?: string;\n estimate?: number;\n dueDate?: Date;\n}\n\nexport interface LinearCommentInput {\n body: string;\n issueId: string;\n}\n\nexport interface LinearSearchFilters {\n state?: string[];\n assignee?: string[];\n label?: string[];\n project?: string;\n team?: string;\n priority?: number[];\n query?: string;\n limit?: number;\n}\n\n// Error classes specific to Linear\nexport class LinearAPIError extends Error {\n constructor(\n message: string,\n public status?: number,\n public response?: any\n ) {\n super(message);\n this.name = 'LinearAPIError';\n }\n}\n\nexport class LinearAuthenticationError extends LinearAPIError {\n constructor(message: string) {\n super(message, 401);\n this.name = 'LinearAuthenticationError';\n }\n}\n\nexport class LinearRateLimitError extends LinearAPIError {\n constructor(\n message: string,\n public resetTime: number\n ) {\n super(message, 429);\n this.name = 'LinearRateLimitError';\n }\n} ","import {\n Action,\n ActionResult,\n IAgentRuntime,\n Memory,\n State,\n ModelType,\n logger,\n} from '@elizaos/core';\nimport { LinearService } from '../services/linear';\nimport type { LinearIssueInput } from '../types';\n\nconst createIssueTemplate = `Given the user's request, extract the information needed to create a Linear issue.\n\nUser request: \"{{userMessage}}\"\n\nExtract and return ONLY a JSON object (no markdown formatting, no code blocks) with the following structure:\n{\n \"title\": \"Brief, clear issue title\",\n \"description\": \"Detailed description of the issue (optional, omit or use null if not provided)\",\n \"teamKey\": \"Team key if mentioned (e.g., ENG, PROD) - omit or use null if not mentioned\",\n \"priority\": \"Priority level if mentioned (1=urgent, 2=high, 3=normal, 4=low) - omit or use null if not mentioned\",\n \"labels\": [\"label1\", \"label2\"] (if any labels are mentioned, empty array if none),\n \"assignee\": \"Assignee username or email if mentioned - omit or use null if not mentioned\"\n}\n\nReturn only the JSON object, no other text.`;\n\nexport const createIssueAction: Action = {\n name: 'CREATE_LINEAR_ISSUE',\n description: 'Create a new issue in Linear',\n similes: ['create-linear-issue', 'new-linear-issue', 'add-linear-issue'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Create a new issue: Fix login button not working on mobile devices'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll create that issue for you in Linear.',\n actions: ['CREATE_LINEAR_ISSUE']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Create a bug report for the ENG team: API returns 500 error when updating user profile'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll create a bug report for the engineering team right away.',\n actions: ['CREATE_LINEAR_ISSUE']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n return {\n text: 'Please provide a description for the issue.',\n success: false\n };\n }\n \n // Check if the message already has structured data\n const structuredData = _options?.issueData as Partial<LinearIssueInput> | undefined;\n \n let issueData: Partial<LinearIssueInput>;\n \n if (structuredData) {\n issueData = structuredData;\n } else {\n // Use LLM to extract issue information\n const prompt = createIssueTemplate.replace('{{userMessage}}', content);\n \n const response = await runtime.useModel(ModelType.TEXT_LARGE, {\n prompt: prompt\n });\n \n if (!response) {\n throw new Error('Failed to extract issue information');\n }\n \n try {\n // Strip markdown code blocks if present\n const cleanedResponse = response.replace(/^```(?:json)?\\n?/,'').replace(/\\n?```$/,'').trim();\n const parsed = JSON.parse(cleanedResponse);\n \n // Clean up parsed data - convert empty strings to undefined for fields that need it\n issueData = {\n title: parsed.title || undefined,\n description: parsed.description || undefined,\n priority: parsed.priority ? Number(parsed.priority) : undefined,\n };\n \n // Handle team assignment\n if (parsed.teamKey) {\n const teams = await linearService.getTeams();\n const team = teams.find(t => \n t.key.toLowerCase() === parsed.teamKey.toLowerCase()\n );\n if (team) {\n issueData.teamId = team.id;\n }\n }\n \n // Handle assignee\n if (parsed.assignee && parsed.assignee !== '') {\n // Clean up assignee - remove @ symbol if present\n const cleanAssignee = parsed.assignee.replace(/^@/, '');\n \n const users = await linearService.getUsers();\n const user = users.find(u => \n u.email === cleanAssignee || \n u.name.toLowerCase().includes(cleanAssignee.toLowerCase())\n );\n if (user) {\n issueData.assigneeId = user.id;\n }\n }\n \n // Handle labels\n if (parsed.labels && Array.isArray(parsed.labels) && parsed.labels.length > 0) {\n const labels = await linearService.getLabels(issueData.teamId);\n const labelIds: string[] = [];\n \n for (const labelName of parsed.labels) {\n if (labelName && labelName !== '') {\n const label = labels.find(l => \n l.name.toLowerCase() === labelName.toLowerCase()\n );\n if (label) {\n labelIds.push(label.id);\n }\n }\n }\n \n if (labelIds.length > 0) {\n issueData.labelIds = labelIds;\n }\n }\n \n // If no team was specified, use the first available team as default\n if (!issueData.teamId) {\n const teams = await linearService.getTeams();\n if (teams.length > 0) {\n issueData.teamId = teams[0].id;\n logger.warn(`No team specified, using default team: ${teams[0].name}`);\n }\n }\n } catch (parseError) {\n logger.error('Failed to parse LLM response:', parseError);\n // Fallback to simple title extraction\n issueData = {\n title: content.length > 100 ? content.substring(0, 100) + '...' : content,\n description: content\n };\n \n // Ensure we have a teamId even in fallback case\n const teams = await linearService.getTeams();\n if (teams.length > 0) {\n issueData.teamId = teams[0].id;\n logger.warn(`Using default team for fallback: ${teams[0].name}`);\n }\n }\n }\n \n if (!issueData.title) {\n return {\n text: 'Could not determine issue title. Please provide more details.',\n success: false\n };\n }\n \n // Final check for required teamId\n if (!issueData.teamId) {\n return {\n text: 'No Linear teams found. Please ensure at least one team exists in your Linear workspace.',\n success: false\n };\n }\n \n const issue = await linearService.createIssue(issueData as LinearIssueInput);\n \n return {\n text: `Created issue: ${issue.title} (${issue.identifier})`,\n success: true,\n data: {\n issueId: issue.id,\n identifier: issue.identifier,\n url: issue.url\n }\n };\n } catch (error) {\n logger.error('Failed to create issue:', error);\n return {\n text: `Failed to create issue: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const getIssueAction: Action = {\n name: 'GET_LINEAR_ISSUE',\n description: 'Get details of a specific Linear issue',\n similes: ['get-linear-issue', 'show-linear-issue', 'view-linear-issue'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me issue ENG-123'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll get the details for issue ENG-123.',\n actions: ['GET_LINEAR_ISSUE']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'What\\'s the status of BUG-456?'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'Let me check the status of BUG-456 for you.',\n actions: ['GET_LINEAR_ISSUE']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n return {\n text: 'Please specify an issue ID.',\n success: false\n };\n }\n \n // Extract issue ID from the message\n const issueMatch = content.match(/(\\w+-\\d+)/);\n if (!issueMatch) {\n return {\n text: 'Please provide a valid issue ID (e.g., ENG-123).',\n success: false\n };\n }\n \n const issueId = issueMatch[1];\n const issue = await linearService.getIssue(issueId);\n \n const assignee = await issue.assignee;\n const state = await issue.state;\n const team = await issue.team;\n const labels = await issue.labels();\n const project = await issue.project;\n \n const issueDetails = {\n id: issue.id,\n identifier: issue.identifier,\n title: issue.title,\n description: issue.description,\n priority: issue.priority,\n priorityLabel: issue.priorityLabel,\n url: issue.url,\n createdAt: issue.createdAt,\n updatedAt: issue.updatedAt,\n dueDate: issue.dueDate,\n estimate: issue.estimate,\n assignee: assignee ? {\n id: assignee.id,\n name: assignee.name,\n email: assignee.email,\n } : null,\n state: state ? {\n id: state.id,\n name: state.name,\n type: state.type,\n color: state.color,\n } : null,\n team: team ? {\n id: team.id,\n name: team.name,\n key: team.key,\n } : null,\n labels: labels.nodes.map(label => ({\n id: label.id,\n name: label.name,\n color: label.color,\n })),\n project: project ? {\n id: project.id,\n name: project.name,\n } : null,\n };\n \n // Format the response text\n let responseText = `Issue ${issue.identifier}: ${issue.title}\\n`;\n responseText += `Status: ${state?.name || 'Unknown'}\\n`;\n responseText += `Priority: ${issue.priorityLabel}\\n`;\n if (assignee) {\n responseText += `Assignee: ${assignee.name}\\n`;\n }\n if (issue.dueDate) {\n responseText += `Due: ${new Date(issue.dueDate).toLocaleDateString()}\\n`;\n }\n if (issue.description) {\n responseText += `\\nDescription: ${issue.description}\\n`;\n }\n responseText += `\\nView in Linear: ${issue.url}`;\n \n return {\n text: responseText,\n success: true,\n data: issueDetails\n };\n } catch (error) {\n logger.error('Failed to get issue:', error);\n return {\n text: `Failed to get issue: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\nimport type { LinearIssueInput } from '../types';\n\nexport const updateIssueAction: Action = {\n name: 'UPDATE_LINEAR_ISSUE',\n description: 'Update an existing Linear issue',\n similes: ['update-linear-issue', 'edit-linear-issue', 'modify-linear-issue'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Update issue ENG-123 title to \"Fix login button on all devices\"'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll update the title of issue ENG-123 for you.',\n actions: ['UPDATE_LINEAR_ISSUE']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Change the priority of BUG-456 to high'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll change the priority of BUG-456 to high.',\n actions: ['UPDATE_LINEAR_ISSUE']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n return {\n text: 'Please provide update instructions for the issue.',\n success: false\n };\n }\n \n // Extract issue ID from the message\n const issueMatch = content.match(/(\\w+-\\d+)/);\n if (!issueMatch) {\n return {\n text: 'Please specify an issue ID (e.g., ENG-123) to update.',\n success: false\n };\n }\n \n const issueId = issueMatch[1];\n \n // Parse update instructions\n const updates: Partial<LinearIssueInput> = {};\n \n // Title update\n const titleMatch = content.match(/title to [\"'](.+?)[\"']/i);\n if (titleMatch) {\n updates.title = titleMatch[1];\n }\n \n // Priority update\n const priorityMatch = content.match(/priority (?:to |as )?(\\w+)/i);\n if (priorityMatch) {\n const priorityMap: Record<string, number> = {\n 'urgent': 1,\n 'high': 2,\n 'normal': 3,\n 'medium': 3,\n 'low': 4,\n };\n const priority = priorityMap[priorityMatch[1].toLowerCase()];\n if (priority) {\n updates.priority = priority;\n }\n }\n \n // Description update\n const descMatch = content.match(/description to [\"'](.+?)[\"']/i);\n if (descMatch) {\n updates.description = descMatch[1];\n }\n \n // Status update\n const statusMatch = content.match(/status to (\\w+)/i);\n if (statusMatch) {\n // This would need to look up the state ID - simplified for now\n logger.warn('Status updates not yet implemented');\n }\n \n if (Object.keys(updates).length === 0) {\n return {\n text: 'No valid updates found. Please specify what to update (e.g., \"Update issue ENG-123 title to \\'New Title\\'\")',\n success: false\n };\n }\n \n const updatedIssue = await linearService.updateIssue(issueId, updates);\n \n const updateSummary = Object.entries(updates)\n .map(([key, value]) => `${key}: ${value}`)\n .join(', ');\n \n return {\n text: `Updated issue ${updatedIssue.identifier}: ${updateSummary}`,\n success: true,\n data: {\n issueId: updatedIssue.id,\n identifier: updatedIssue.identifier,\n updates,\n url: updatedIssue.url\n }\n };\n } catch (error) {\n logger.error('Failed to update issue:', error);\n return {\n text: `Failed to update issue: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import {\n Action,\n ActionResult,\n IAgentRuntime,\n Memory,\n State,\n ModelType,\n logger,\n} from '@elizaos/core';\nimport { LinearService } from '../services/linear';\nimport type { LinearSearchFilters } from '../types';\n\nconst searchTemplate = `Extract search criteria from the user's request for Linear issues.\n\nUser request: \"{{userMessage}}\"\n\nExtract and return ONLY a JSON object (no markdown formatting, no code blocks) with these possible filters:\n{\n \"query\": \"general search text\",\n \"state\": \"filter by state name (e.g., 'In Progress', 'Done', 'Todo')\",\n \"assignee\": \"filter by assignee name or email\",\n \"priority\": \"filter by priority (1=urgent, 2=high, 3=normal, 4=low)\",\n \"team\": \"filter by team name or key\",\n \"label\": \"filter by label name\",\n \"hasAssignee\": true/false - whether issue should have an assignee,\n \"limit\": number of results to return (default 10)\n}\n\nOnly include fields that are mentioned. Return only the JSON object.`;\n\nexport const searchIssuesAction: Action = {\n name: 'SEARCH_LINEAR_ISSUES',\n description: 'Search for issues in Linear with various filters',\n similes: ['search-linear-issues', 'find-linear-issues', 'query-linear-issues'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me all open bugs'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll search for all open bug issues in Linear.',\n actions: ['SEARCH_LINEAR_ISSUES']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Find high priority issues assigned to me'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll search for high priority issues assigned to you.',\n actions: ['SEARCH_LINEAR_ISSUES']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n return {\n text: 'Please provide search criteria for issues.',\n success: false\n };\n }\n \n let filters: LinearSearchFilters = {};\n \n // Check if we have explicit filters in options\n if (_options?.filters) {\n filters = _options.filters as LinearSearchFilters;\n } else {\n // Use LLM to extract search filters\n const prompt = searchTemplate.replace('{{userMessage}}', content);\n \n const response = await runtime.useModel(ModelType.TEXT_LARGE, {\n prompt: prompt\n });\n \n if (!response) {\n // Fallback to simple keyword search\n filters = { query: content };\n } else {\n try {\n // Strip markdown code blocks if present\n const cleanedResponse = response.replace(/^```(?:json)?\\n?/,'').replace(/\\n?```$/,'').trim();\n const parsed = JSON.parse(cleanedResponse);\n filters = {\n query: parsed.query,\n state: parsed.state ? [parsed.state] : undefined,\n assignee: parsed.assignee ? [parsed.assignee] : undefined,\n priority: parsed.priority ? [parsed.priority] : undefined,\n team: parsed.team,\n label: parsed.label ? [parsed.label] : undefined,\n limit: parsed.limit\n };\n \n // Clean up undefined values\n Object.keys(filters).forEach(key => {\n if (filters[key as keyof LinearSearchFilters] === undefined) {\n delete filters[key as keyof LinearSearchFilters];\n }\n });\n } catch (parseError) {\n logger.error('Failed to parse search filters:', parseError);\n // Fallback to simple search\n filters = { query: content };\n }\n }\n }\n \n filters.limit = (_options?.limit as number) || 10;\n const issues = await linearService.searchIssues(filters);\n \n if (issues.length === 0) {\n return {\n text: 'No issues found matching your search criteria.',\n success: true,\n data: {\n issues: [],\n filters,\n count: 0\n }\n };\n }\n \n const issueList = await Promise.all(issues.map(async (issue, index) => {\n const state = await issue.state;\n return `${index + 1}. ${issue.identifier}: ${issue.title} (${state?.name || 'No state'})`;\n }));\n const issueText = issueList.join('\\n');\n \n return {\n text: `Found ${issues.length} issue${issues.length === 1 ? '' : 's'}:\\n${issueText}`,\n success: true,\n data: {\n issues: issues.map(i => ({\n id: i.id,\n identifier: i.identifier,\n title: i.title,\n description: i.description,\n url: i.url,\n state: i.state,\n priority: i.priority,\n priorityLabel: i.priorityLabel,\n assignee: i.assignee\n })),\n filters,\n count: issues.length\n }\n };\n } catch (error) {\n logger.error('Failed to search issues:', error);\n return {\n text: `Failed to search issues: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, ActionExample, logger } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const createCommentAction: Action = {\n name: 'CREATE_LINEAR_COMMENT',\n description: 'Create a comment on a Linear issue',\n similes: ['create-linear-comment', 'add-linear-comment', 'comment-on-linear-issue'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Comment on ENG-123: This has been fixed in the latest release'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll add that comment to issue ENG-123.',\n actions: ['CREATE_LINEAR_COMMENT']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Add a comment to BUG-456: Need more information from the reporter'\n }\n },\n {\n name: 'Assistant', \n content: {\n text: 'I\\'ll post that comment on BUG-456 right away.',\n actions: ['CREATE_LINEAR_COMMENT']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n return {\n text: 'Please provide a message with the issue ID and comment content.',\n success: false\n };\n }\n \n const issueMatch = content.match(/(?:comment on|add.*comment.*to)\\s+(\\w+-\\d+):?\\s*(.*)/i);\n \n if (!issueMatch) {\n return {\n text: 'Please specify the issue ID and comment content. Example: \"Comment on ENG-123: This looks good\"',\n success: false\n };\n }\n \n const [, issueIdentifier, commentBody] = issueMatch;\n \n // Find the issue first to get its ID\n const issue = await linearService.getIssue(issueIdentifier);\n \n const comment = await linearService.createComment({\n issueId: issue.id,\n body: commentBody.trim()\n });\n \n return {\n text: `Comment added to issue ${issueIdentifier}: \"${commentBody.trim()}\"`,\n success: true,\n data: {\n commentId: comment.id,\n issueId: issue.id\n }\n };\n } catch (error) {\n logger.error('Failed to create comment:', error);\n return {\n text: `Failed to create comment: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const listTeamsAction: Action = {\n name: 'LIST_LINEAR_TEAMS',\n description: 'List all teams in Linear',\n similes: ['list-linear-teams', 'show-linear-teams', 'get-linear-teams'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me all teams'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll list all the teams in Linear for you.',\n actions: ['LIST_LINEAR_TEAMS']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'What teams are available?'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'Let me show you all the available teams.',\n actions: ['LIST_LINEAR_TEAMS']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n _message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const teams = await linearService.getTeams();\n \n if (teams.length === 0) {\n return {\n text: 'No teams found in Linear.',\n success: true,\n data: {\n teams: []\n }\n };\n }\n \n const teamList = teams.map((team, index) => \n `${index + 1}. ${team.name} (${team.key})${team.description ? ` - ${team.description}` : ''}`\n ).join('\\n');\n \n return {\n text: `Found ${teams.length} team${teams.length === 1 ? '' : 's'}:\\n${teamList}`,\n success: true,\n data: {\n teams: teams.map(t => ({\n id: t.id,\n name: t.name,\n key: t.key,\n description: t.description\n })),\n count: teams.length\n }\n };\n } catch (error) {\n logger.error('Failed to list teams:', error);\n return {\n text: `Failed to list teams: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const listProjectsAction: Action = {\n name: 'LIST_LINEAR_PROJECTS',\n description: 'List all projects in Linear',\n similes: ['list-linear-projects', 'show-linear-projects', 'get-linear-projects'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me all projects'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll list all the projects in Linear for you.',\n actions: ['LIST_LINEAR_PROJECTS']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'What projects do we have?'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'Let me show you all the available projects.',\n actions: ['LIST_LINEAR_PROJECTS']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n _message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const projects = await linearService.getProjects();\n \n if (projects.length === 0) {\n return {\n text: 'No projects found in Linear.',\n success: true,\n data: {\n projects: []\n }\n };\n }\n \n // Get teams for each project\n const projectsWithDetails = await Promise.all(\n projects.map(async (project) => {\n const teamsQuery = await project.teams();\n const teams = await teamsQuery.nodes;\n return {\n ...project,\n teamsList: teams\n };\n })\n );\n \n const projectList = projectsWithDetails.map((project, index) => {\n const teamNames = project.teamsList.map((t: any) => t.name).join(', ') || 'No teams';\n return `${index + 1}. ${project.name}${project.description ? ` - ${project.description}` : ''} (Teams: ${teamNames})`;\n }).join('\\n');\n \n return {\n text: `Found ${projects.length} project${projects.length === 1 ? '' : 's'}:\\n${projectList}`,\n success: true,\n data: {\n projects: projectsWithDetails.map(p => ({\n id: p.id,\n name: p.name,\n description: p.description,\n url: p.url,\n teams: p.teamsList.map((t: any) => ({\n id: t.id,\n name: t.name,\n key: t.key\n })),\n state: p.state,\n progress: p.progress,\n startDate: p.startDate,\n targetDate: p.targetDate\n })),\n count: projects.length\n }\n };\n } catch (error) {\n logger.error('Failed to list projects:', error);\n return {\n text: `Failed to list projects: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const getActivityAction: Action = {\n name: 'GET_LINEAR_ACTIVITY',\n description: 'Get recent Linear activity',\n similes: ['get-linear-activity', 'show-linear-activity', 'view-linear-activity'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me recent Linear activity'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll check the recent Linear activity for you.',\n actions: ['GET_LINEAR_ACTIVITY']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'What\\'s been happening in Linear?'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'Let me show you the recent Linear activity.',\n actions: ['GET_LINEAR_ACTIVITY']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n _message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const activity = linearService.getActivityLog();\n \n if (activity.length === 0) {\n return {\n text: 'No recent Linear activity found.',\n success: true,\n data: {\n activity: []\n }\n };\n }\n \n const activityText = activity\n .slice(0, 10) // Show last 10 activities\n .map((item, index) => {\n const description = `${item.action} ${item.resource_type} ${item.resource_id}${item.error ? ` (failed: ${item.error})` : ''}`;\n return `${index + 1}. ${description}`;\n })\n .join('\\n');\n \n return {\n text: `Recent Linear activity:\\n${activityText}`,\n success: true,\n data: {\n activity: activity.slice(0, 10),\n count: activity.length\n }\n };\n } catch (error) {\n logger.error('Failed to get Linear activity:', error);\n return {\n text: `Failed to get Linear activity: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, ActionExample, logger } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const clearActivityAction: Action = {\n name: 'CLEAR_LINEAR_ACTIVITY',\n description: 'Clear the Linear activity log',\n similes: ['clear-linear-activity', 'reset-linear-activity', 'delete-linear-activity'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Clear the Linear activity log'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll clear the Linear activity log for you.',\n actions: ['CLEAR_LINEAR_ACTIVITY']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Reset Linear activity'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll reset the Linear activity log now.',\n actions: ['CLEAR_LINEAR_ACTIVITY']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n await linearService.clearActivityLog();\n \n return {\n text: 'Linear activity log has been cleared.',\n success: true\n };\n } catch (error) {\n logger.error('Failed to clear Linear activity:', error);\n return {\n text: `Failed to clear Linear activity: ${error instanceof Error ? error.message : 'Unknown error'}`,\n success: false\n };\n }\n }\n}; ","import type { IAgentRuntime, Memory, Provider, State } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const linearIssuesProvider: Provider = {\n name: 'LINEAR_ISSUES',\n description: 'Provides context about recent Linear issues',\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n return {\n text: 'Linear service is not available',\n };\n }\n \n // Get recent issues\n const issues = await linearService.searchIssues({ limit: 10 });\n \n if (issues.length === 0) {\n return {\n text: 'No recent Linear issues found',\n };\n }\n \n // Format issues for context\n const issuesList = await Promise.all(\n issues.map(async (issue: any) => {\n const [assignee, state] = await Promise.all([\n issue.assignee,\n issue.state,\n ]);\n \n return `- ${issue.identifier}: ${issue.title} (${state?.name || 'Unknown'}, ${assignee?.name || 'Unassigned'})`;\n })\n );\n \n const text = `Recent Linear Issues:\\n${issuesList.join('\\n')}`;\n \n return {\n text,\n data: {\n issues: issues.map((issue: any) => ({\n id: issue.id,\n identifier: issue.identifier,\n title: issue.title,\n })),\n },\n };\n } catch (error) {\n return {\n text: 'Error retrieving Linear issues',\n };\n }\n },\n}; ","import type { IAgentRuntime, Memory, Provider, State } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const linearTeamsProvider: Provider = {\n name: 'LINEAR_TEAMS',\n description: 'Provides context about Linear teams',\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n return {\n text: 'Linear service is not available',\n };\n }\n \n const teams = await linearService.getTeams();\n \n if (teams.length === 0) {\n return {\n text: 'No Linear teams found',\n };\n }\n \n const teamsList = teams.map((team: any) => \n `- ${team.name} (${team.key}): ${team.description || 'No description'}`\n );\n \n const text = `Linear Teams:\\n${teamsList.join('\\n')}`;\n \n return {\n text,\n data: {\n teams: teams.map((team: any) => ({\n id: team.id,\n name: team.name,\n key: team.key,\n })),\n },\n };\n } catch (error) {\n return {\n text: 'Error retrieving Linear teams',\n };\n }\n },\n}; ","import type { IAgentRuntime, Memory, Provider, State } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const linearProjectsProvider: Provider = {\n name: 'LINEAR_PROJECTS',\n description: 'Provides context about active Linear projects',\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n return {\n text: 'Linear service is not available',\n };\n }\n \n const projects = await linearService.getProjects();\n \n if (projects.length === 0) {\n return {\n text: 'No Linear projects found',\n };\n }\n \n // Filter active projects\n const activeProjects = projects.filter((project: any) => \n project.state === 'started' || project.state === 'planned'\n );\n \n const projectsList = activeProjects.slice(0, 10).map((project: any) => \n `- ${project.name}: ${project.state} (${project.startDate || 'No start date'} - ${project.targetDate || 'No target date'})`\n );\n \n const text = `Active Linear Projects:\\n${projectsList.join('\\n')}`;\n \n return {\n text,\n data: {\n projects: activeProjects.slice(0, 10).map((project: any) => ({\n id: project.id,\n name: project.name,\n state: project.state,\n })),\n },\n };\n } catch (error) {\n return {\n text: 'Error retrieving Linear projects',\n };\n }\n },\n}; ","import type { IAgentRuntime, Memory, Provider, State } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\nimport type { LinearActivityItem } from '../types';\n\nexport const linearActivityProvider: Provider = {\n name: 'LINEAR_ACTIVITY',\n description: 'Provides context about recent Linear activity',\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n return {\n text: 'Linear service is not available',\n };\n }\n \n const activity = linearService.getActivityLog(10);\n \n if (activity.length === 0) {\n return {\n text: 'No recent Linear activity',\n };\n }\n \n const activityList = activity.map((item: LinearActivityItem) => {\n const status = item.success ? '✓' : '✗';\n const time = new Date(item.timestamp).toLocaleTimeString();\n return `${status} ${time}: ${item.action} ${item.resource_type} ${item.resource_id}`;\n });\n \n const text = `Recent Linear Activity:\\n${activityList.join('\\n')}`;\n \n return {\n text,\n data: {\n activity: activity.slice(0, 10),\n },\n };\n } catch (error) {\n return {\n text: 'Error retrieving Linear activity',\n };\n }\n },\n}; ","import { Plugin } from '@elizaos/core';\nimport { LinearService } from './services/linear';\n\n// Import all actions\nimport { createIssueAction } from './actions/createIssue';\nimport { getIssueAction } from './actions/getIssue';\nimport { updateIssueAction } from './actions/updateIssue';\nimport { searchIssuesAction } from './actions/searchIssues';\nimport { createCommentAction } from './actions/createComment';\nimport { listTeamsAction } from './actions/listTeams';\nimport { listProjectsAction } from './actions/listProjects';\nimport { getActivityAction } from './actions/getActivity';\nimport { clearActivityAction } from './actions/clearActivity';\n\n// Import all providers\nimport { linearIssuesProvider } from './providers/issues';\nimport { linearTeamsProvider } from './providers/teams';\nimport { linearProjectsProvider } from './providers/projects';\nimport { linearActivityProvider } from './providers/activity';\n\nexport const linearPlugin: Plugin = {\n name: '@elizaos/plugin-linear',\n description: 'Plugin for integrating with Linear issue tracking system',\n services: [LinearService],\n actions: [\n createIssueAction,\n getIssueAction,\n updateIssueAction,\n searchIssuesAction,\n createCommentAction,\n listTeamsAction,\n listProjectsAction,\n getActivityAction,\n clearActivityAction,\n ],\n providers: [\n linearIssuesProvider,\n linearTeamsProvider,\n linearProjectsProvider,\n linearActivityProvider,\n ],\n};\n\n// Re-export types and service for external use\nexport * from './types';\nexport { LinearService } from './services/linear'; "],"mappings":";AAAA,SAAS,QAAQ,eAAmC;AACpD,SAAS,oBAAoF;;;AC6CtF,IAAM,iBAAN,cAA6B,MAAM;AAAA,EACxC,YACE,SACO,QACA,UACP;AACA,UAAM,OAAO;AAHN;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,4BAAN,cAAwC,eAAe;AAAA,EAC5D,YAAY,SAAiB;AAC3B,UAAM,SAAS,GAAG;AAClB,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,uBAAN,cAAmC,eAAe;AAAA,EACvD,YACE,SACO,WACP;AACA,UAAM,SAAS,GAAG;AAFX;AAGP,SAAK,OAAO;AAAA,EACd;AACF;;;AD7DO,IAAM,iBAAN,MAAM,uBAAsB,QAAQ;AAAA,EAUzC,YAAY,SAAyB;AACnC,UAAM,OAAO;AARf,iCAAwB;AAGxB,SAAQ,cAAoC,CAAC;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ACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["logger","logger","logger","ModelType","logger","logger","logger","logger","logger","logger"]}
1
+ {"version":3,"sources":["../src/services/linear.ts","../src/types/index.ts","../src/actions/createIssue.ts","../src/actions/getIssue.ts","../src/actions/updateIssue.ts","../src/actions/searchIssues.ts","../src/actions/createComment.ts","../src/actions/listTeams.ts","../src/actions/listProjects.ts","../src/actions/getActivity.ts","../src/actions/clearActivity.ts","../src/providers/issues.ts","../src/providers/teams.ts","../src/providers/projects.ts","../src/providers/activity.ts","../src/index.ts"],"sourcesContent":["import { logger, Service, type IAgentRuntime } from '@elizaos/core';\nimport { LinearClient, Issue, Project, Team, User, WorkflowState, IssueLabel, Comment } from '@linear/sdk';\nimport type { \n LinearConfig, \n LinearActivityItem, \n LinearIssueInput, \n LinearCommentInput,\n LinearSearchFilters \n} from '../types';\nimport { LinearAPIError, LinearAuthenticationError } from '../types';\n\nexport class LinearService extends Service {\n static serviceType = 'linear';\n \n capabilityDescription = 'Linear API integration for issue tracking, project management, and team collaboration';\n \n private client: LinearClient;\n private activityLog: LinearActivityItem[] = [];\n private linearConfig: LinearConfig;\n private workspaceId?: string;\n \n constructor(runtime?: IAgentRuntime) {\n super(runtime);\n \n // Get config from runtime settings\n const apiKey = runtime?.getSetting('LINEAR_API_KEY') as string;\n const workspaceId = runtime?.getSetting('LINEAR_WORKSPACE_ID') as string;\n \n if (!apiKey) {\n throw new LinearAuthenticationError('Linear API key is required');\n }\n \n this.linearConfig = {\n LINEAR_API_KEY: apiKey,\n LINEAR_WORKSPACE_ID: workspaceId,\n };\n \n this.workspaceId = workspaceId;\n \n this.config = {\n LINEAR_API_KEY: apiKey,\n LINEAR_WORKSPACE_ID: workspaceId,\n };\n \n this.client = new LinearClient({\n apiKey: this.linearConfig.LINEAR_API_KEY,\n });\n }\n \n static async start(runtime: IAgentRuntime): Promise<LinearService> {\n const service = new LinearService(runtime);\n await service.validateConnection();\n logger.info('Linear service started successfully');\n return service;\n }\n \n async stop(): Promise<void> {\n this.activityLog = [];\n logger.info('Linear service stopped');\n }\n \n // Validate the API connection\n private async validateConnection(): Promise<void> {\n try {\n const viewer = await this.client.viewer;\n logger.info(`Linear connected as user: ${viewer.email}`);\n } catch (error) {\n throw new LinearAuthenticationError('Failed to authenticate with Linear API');\n }\n }\n \n // Log activity\n private logActivity(\n action: string,\n resourceType: LinearActivityItem['resource_type'],\n resourceId: string,\n details: Record<string, any>,\n success: boolean,\n error?: string\n ): void {\n const activity: LinearActivityItem = {\n id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n timestamp: new Date().toISOString(),\n action,\n resource_type: resourceType,\n resource_id: resourceId,\n details,\n success,\n error,\n };\n \n this.activityLog.push(activity);\n \n // Keep only last 1000 activities\n if (this.activityLog.length > 1000) {\n this.activityLog = this.activityLog.slice(-1000);\n }\n }\n \n // Get activity log\n getActivityLog(limit?: number, filter?: Partial<LinearActivityItem>): LinearActivityItem[] {\n let filtered = [...this.activityLog];\n \n if (filter) {\n filtered = filtered.filter(item => {\n return Object.entries(filter).every(([key, value]) => {\n return item[key as keyof LinearActivityItem] === value;\n });\n });\n }\n \n return filtered.slice(-(limit || 100));\n }\n \n // Clear activity log\n clearActivityLog(): void {\n this.activityLog = [];\n logger.info('Linear activity log cleared');\n }\n \n // Team operations\n async getTeams(): Promise<Team[]> {\n try {\n const teams = await this.client.teams();\n const teamList = await teams.nodes;\n \n this.logActivity('list_teams', 'team', 'all', { count: teamList.length }, true);\n return teamList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_teams', 'team', 'all', {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch teams: ${errorMessage}`);\n }\n }\n \n async getTeam(teamId: string): Promise<Team> {\n try {\n const team = await this.client.team(teamId);\n this.logActivity('get_team', 'team', teamId, { name: team.name }, true);\n return team;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('get_team', 'team', teamId, {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch team: ${errorMessage}`);\n }\n }\n \n // Issue operations\n async createIssue(input: LinearIssueInput): Promise<Issue> {\n try {\n const issuePayload = await this.client.createIssue({\n title: input.title,\n description: input.description,\n teamId: input.teamId,\n priority: input.priority,\n assigneeId: input.assigneeId,\n labelIds: input.labelIds,\n projectId: input.projectId,\n stateId: input.stateId,\n estimate: input.estimate,\n dueDate: input.dueDate,\n });\n \n const issue = await issuePayload.issue;\n if (!issue) {\n throw new Error('Failed to create issue');\n }\n \n this.logActivity('create_issue', 'issue', issue.id, { \n title: input.title,\n teamId: input.teamId \n }, true);\n \n return issue;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('create_issue', 'issue', 'new', input, false, errorMessage);\n throw new LinearAPIError(`Failed to create issue: ${errorMessage}`);\n }\n }\n \n async getIssue(issueId: string): Promise<Issue> {\n try {\n const issue = await this.client.issue(issueId);\n this.logActivity('get_issue', 'issue', issueId, { \n title: issue.title,\n identifier: issue.identifier \n }, true);\n return issue;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('get_issue', 'issue', issueId, {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch issue: ${errorMessage}`);\n }\n }\n \n async updateIssue(issueId: string, updates: Partial<LinearIssueInput>): Promise<Issue> {\n try {\n const updatePayload = await this.client.updateIssue(issueId, {\n title: updates.title,\n description: updates.description,\n priority: updates.priority,\n assigneeId: updates.assigneeId,\n labelIds: updates.labelIds,\n projectId: updates.projectId,\n stateId: updates.stateId,\n estimate: updates.estimate,\n dueDate: updates.dueDate,\n });\n \n const issue = await updatePayload.issue;\n if (!issue) {\n throw new Error('Failed to update issue');\n }\n \n this.logActivity('update_issue', 'issue', issueId, updates, true);\n return issue;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('update_issue', 'issue', issueId, updates, false, errorMessage);\n throw new LinearAPIError(`Failed to update issue: ${errorMessage}`);\n }\n }\n \n async searchIssues(filters: LinearSearchFilters): Promise<Issue[]> {\n try {\n const query = this.client.issues({\n first: filters.limit || 50,\n filter: filters.query ? {\n or: [\n { title: { containsIgnoreCase: filters.query } },\n { description: { containsIgnoreCase: filters.query } },\n ],\n } : undefined,\n });\n \n const issues = await query;\n const issueList = await issues.nodes;\n \n this.logActivity('search_issues', 'issue', 'search', { \n filters,\n count: issueList.length \n }, true);\n \n return issueList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('search_issues', 'issue', 'search', filters, false, errorMessage);\n throw new LinearAPIError(`Failed to search issues: ${errorMessage}`);\n }\n }\n \n // Comment operations\n async createComment(input: LinearCommentInput): Promise<Comment> {\n try {\n const commentPayload = await this.client.createComment({\n body: input.body,\n issueId: input.issueId,\n });\n \n const comment = await commentPayload.comment;\n if (!comment) {\n throw new Error('Failed to create comment');\n }\n \n this.logActivity('create_comment', 'comment', comment.id, { \n issueId: input.issueId,\n bodyLength: input.body.length \n }, true);\n \n return comment;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('create_comment', 'comment', 'new', input, false, errorMessage);\n throw new LinearAPIError(`Failed to create comment: ${errorMessage}`);\n }\n }\n \n // Project operations\n async getProjects(teamId?: string): Promise<Project[]> {\n try {\n // Note: Linear SDK v51 may not support direct team filtering on projects\n // Get all projects and filter manually if needed\n const query = this.client.projects({\n first: 100,\n });\n \n const projects = await query;\n let projectList = await projects.nodes;\n \n // Manual filtering by team if teamId is provided\n if (teamId) {\n const filteredProjects = await Promise.all(\n projectList.map(async (project) => {\n const projectTeams = await project.teams();\n const teamsList = await projectTeams.nodes;\n const hasTeam = teamsList.some((team: any) => team.id === teamId);\n return hasTeam ? project : null;\n })\n );\n projectList = filteredProjects.filter(Boolean) as Project[];\n }\n \n this.logActivity('list_projects', 'project', 'all', { \n count: projectList.length,\n teamId \n }, true);\n \n return projectList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_projects', 'project', 'all', { teamId }, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch projects: ${errorMessage}`);\n }\n }\n \n async getProject(projectId: string): Promise<Project> {\n try {\n const project = await this.client.project(projectId);\n this.logActivity('get_project', 'project', projectId, { \n name: project.name \n }, true);\n return project;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('get_project', 'project', projectId, {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch project: ${errorMessage}`);\n }\n }\n \n // User operations\n async getUsers(): Promise<User[]> {\n try {\n const users = await this.client.users();\n const userList = await users.nodes;\n \n this.logActivity('list_users', 'user', 'all', { \n count: userList.length \n }, true);\n \n return userList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_users', 'user', 'all', {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch users: ${errorMessage}`);\n }\n }\n \n async getCurrentUser(): Promise<User> {\n try {\n const user = await this.client.viewer;\n this.logActivity('get_current_user', 'user', user.id, { \n email: user.email,\n name: user.name \n }, true);\n return user;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('get_current_user', 'user', 'current', {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch current user: ${errorMessage}`);\n }\n }\n \n // Label operations\n async getLabels(teamId?: string): Promise<IssueLabel[]> {\n try {\n const query = this.client.issueLabels({\n first: 100,\n filter: teamId ? {\n team: { id: { eq: teamId } },\n } : undefined,\n });\n \n const labels = await query;\n const labelList = await labels.nodes;\n \n this.logActivity('list_labels', 'label', 'all', { \n count: labelList.length,\n teamId \n }, true);\n \n return labelList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_labels', 'label', 'all', { teamId }, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch labels: ${errorMessage}`);\n }\n }\n \n // Workflow state operations\n async getWorkflowStates(teamId: string): Promise<WorkflowState[]> {\n try {\n const states = await this.client.workflowStates({\n filter: {\n team: { id: { eq: teamId } },\n },\n });\n \n const stateList = await states.nodes;\n \n this.logActivity('list_workflow_states', 'team', teamId, { \n count: stateList.length \n }, true);\n \n return stateList;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error';\n this.logActivity('list_workflow_states', 'team', teamId, {}, false, errorMessage);\n throw new LinearAPIError(`Failed to fetch workflow states: ${errorMessage}`);\n }\n }\n} ","export interface LinearConfig {\n LINEAR_API_KEY: string;\n LINEAR_WORKSPACE_ID?: string;\n}\n\nexport interface LinearActivityItem {\n id: string;\n timestamp: string;\n action: string;\n resource_type: 'issue' | 'project' | 'comment' | 'label' | 'user' | 'team';\n resource_id: string;\n details: Record<string, any>;\n success: boolean;\n error?: string;\n}\n\nexport interface LinearIssueInput {\n title: string;\n description?: string;\n teamId: string;\n priority?: number; // 0 = No priority, 1 = Urgent, 2 = High, 3 = Normal, 4 = Low\n assigneeId?: string;\n labelIds?: string[];\n projectId?: string;\n stateId?: string;\n estimate?: number;\n dueDate?: Date;\n}\n\nexport interface LinearCommentInput {\n body: string;\n issueId: string;\n}\n\nexport interface LinearSearchFilters {\n state?: string[];\n assignee?: string[];\n label?: string[];\n project?: string;\n team?: string;\n priority?: number[];\n query?: string;\n limit?: number;\n}\n\n// Error classes specific to Linear\nexport class LinearAPIError extends Error {\n constructor(\n message: string,\n public status?: number,\n public response?: any\n ) {\n super(message);\n this.name = 'LinearAPIError';\n }\n}\n\nexport class LinearAuthenticationError extends LinearAPIError {\n constructor(message: string) {\n super(message, 401);\n this.name = 'LinearAuthenticationError';\n }\n}\n\nexport class LinearRateLimitError extends LinearAPIError {\n constructor(\n message: string,\n public resetTime: number\n ) {\n super(message, 429);\n this.name = 'LinearRateLimitError';\n }\n} ","import {\n Action,\n ActionResult,\n IAgentRuntime,\n Memory,\n State,\n ModelType,\n logger,\n HandlerCallback,\n} from '@elizaos/core';\nimport { LinearService } from '../services/linear';\nimport type { LinearIssueInput } from '../types';\n\nconst createIssueTemplate = `Given the user's request, extract the information needed to create a Linear issue.\n\nUser request: \"{{userMessage}}\"\n\nExtract and return ONLY a JSON object (no markdown formatting, no code blocks) with the following structure:\n{\n \"title\": \"Brief, clear issue title\",\n \"description\": \"Detailed description of the issue (optional, omit or use null if not provided)\",\n \"teamKey\": \"Team key if mentioned (e.g., ENG, PROD) - omit or use null if not mentioned\",\n \"priority\": \"Priority level if mentioned (1=urgent, 2=high, 3=normal, 4=low) - omit or use null if not mentioned\",\n \"labels\": [\"label1\", \"label2\"] (if any labels are mentioned, empty array if none),\n \"assignee\": \"Assignee username or email if mentioned - omit or use null if not mentioned\"\n}\n\nReturn only the JSON object, no other text.`;\n\nexport const createIssueAction: Action = {\n name: 'CREATE_LINEAR_ISSUE',\n description: 'Create a new issue in Linear',\n similes: ['create-linear-issue', 'new-linear-issue', 'add-linear-issue'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Create a new issue: Fix login button not working on mobile devices'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll create that issue for you in Linear.',\n actions: ['CREATE_LINEAR_ISSUE']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Create a bug report for the ENG team: API returns 500 error when updating user profile'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll create a bug report for the engineering team right away.',\n actions: ['CREATE_LINEAR_ISSUE']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n const errorMessage = 'Please provide a description for the issue.';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n // Check if the message already has structured data\n const structuredData = _options?.issueData as Partial<LinearIssueInput> | undefined;\n \n let issueData: Partial<LinearIssueInput>;\n \n if (structuredData) {\n issueData = structuredData;\n } else {\n // Use LLM to extract issue information\n const prompt = createIssueTemplate.replace('{{userMessage}}', content);\n \n const response = await runtime.useModel(ModelType.TEXT_LARGE, {\n prompt: prompt\n });\n \n if (!response) {\n throw new Error('Failed to extract issue information');\n }\n \n try {\n // Strip markdown code blocks if present\n const cleanedResponse = response.replace(/^```(?:json)?\\n?/,'').replace(/\\n?```$/,'').trim();\n const parsed = JSON.parse(cleanedResponse);\n \n // Clean up parsed data - convert empty strings to undefined for fields that need it\n issueData = {\n title: parsed.title || undefined,\n description: parsed.description || undefined,\n priority: parsed.priority ? Number(parsed.priority) : undefined,\n };\n \n // Handle team assignment\n if (parsed.teamKey) {\n const teams = await linearService.getTeams();\n const team = teams.find(t => \n t.key.toLowerCase() === parsed.teamKey.toLowerCase()\n );\n if (team) {\n issueData.teamId = team.id;\n }\n }\n \n // Handle assignee\n if (parsed.assignee && parsed.assignee !== '') {\n // Clean up assignee - remove @ symbol if present\n const cleanAssignee = parsed.assignee.replace(/^@/, '');\n \n const users = await linearService.getUsers();\n const user = users.find(u => \n u.email === cleanAssignee || \n u.name.toLowerCase().includes(cleanAssignee.toLowerCase())\n );\n if (user) {\n issueData.assigneeId = user.id;\n }\n }\n \n // Handle labels\n if (parsed.labels && Array.isArray(parsed.labels) && parsed.labels.length > 0) {\n const labels = await linearService.getLabels(issueData.teamId);\n const labelIds: string[] = [];\n \n for (const labelName of parsed.labels) {\n if (labelName && labelName !== '') {\n const label = labels.find(l => \n l.name.toLowerCase() === labelName.toLowerCase()\n );\n if (label) {\n labelIds.push(label.id);\n }\n }\n }\n \n if (labelIds.length > 0) {\n issueData.labelIds = labelIds;\n }\n }\n \n // If no team was specified, use the first available team as default\n if (!issueData.teamId) {\n const teams = await linearService.getTeams();\n if (teams.length > 0) {\n issueData.teamId = teams[0].id;\n logger.warn(`No team specified, using default team: ${teams[0].name}`);\n }\n }\n } catch (parseError) {\n logger.error('Failed to parse LLM response:', parseError);\n // Fallback to simple title extraction\n issueData = {\n title: content.length > 100 ? content.substring(0, 100) + '...' : content,\n description: content\n };\n \n // Ensure we have a teamId even in fallback case\n const teams = await linearService.getTeams();\n if (teams.length > 0) {\n issueData.teamId = teams[0].id;\n logger.warn(`Using default team for fallback: ${teams[0].name}`);\n }\n }\n }\n \n if (!issueData.title) {\n const errorMessage = 'Could not determine issue title. Please provide more details.';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n // Final check for required teamId\n if (!issueData.teamId) {\n const errorMessage = 'No Linear teams found. Please ensure at least one team exists in your Linear workspace.';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n const issue = await linearService.createIssue(issueData as LinearIssueInput);\n \n // Send success message to channel\n const successMessage = `✅ Created Linear issue: ${issue.title} (${issue.identifier})\\n\\nView it at: ${issue.url}`;\n await callback?.({\n text: successMessage,\n source: message.content.source\n });\n \n return {\n text: `Created issue: ${issue.title} (${issue.identifier})`,\n success: true,\n data: {\n issueId: issue.id,\n identifier: issue.identifier,\n url: issue.url\n }\n };\n } catch (error) {\n logger.error('Failed to create issue:', error);\n const errorMessage = `❌ Failed to create issue: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger, HandlerCallback } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const getIssueAction: Action = {\n name: 'GET_LINEAR_ISSUE',\n description: 'Get details of a specific Linear issue',\n similes: ['get-linear-issue', 'show-linear-issue', 'view-linear-issue'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me issue ENG-123'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll get the details for issue ENG-123.',\n actions: ['GET_LINEAR_ISSUE']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'What\\'s the status of BUG-456?'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'Let me check the status of BUG-456 for you.',\n actions: ['GET_LINEAR_ISSUE']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n const errorMessage = 'Please specify an issue ID.';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n // Extract issue ID from the message\n const issueMatch = content.match(/(\\w+-\\d+)/);\n if (!issueMatch) {\n const errorMessage = 'Please provide a valid issue ID (e.g., ENG-123).';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n const issueId = issueMatch[1];\n const issue = await linearService.getIssue(issueId);\n \n const assignee = await issue.assignee;\n const state = await issue.state;\n const team = await issue.team;\n const labels = await issue.labels();\n const project = await issue.project;\n \n const issueDetails = {\n id: issue.id,\n identifier: issue.identifier,\n title: issue.title,\n description: issue.description,\n priority: issue.priority,\n priorityLabel: issue.priorityLabel,\n url: issue.url,\n createdAt: issue.createdAt,\n updatedAt: issue.updatedAt,\n dueDate: issue.dueDate,\n estimate: issue.estimate,\n assignee: assignee ? {\n id: assignee.id,\n name: assignee.name,\n email: assignee.email,\n } : null,\n state: state ? {\n id: state.id,\n name: state.name,\n type: state.type,\n color: state.color,\n } : null,\n team: team ? {\n id: team.id,\n name: team.name,\n key: team.key,\n } : null,\n labels: labels.nodes.map(label => ({\n id: label.id,\n name: label.name,\n color: label.color,\n })),\n project: project ? {\n id: project.id,\n name: project.name,\n } : null,\n };\n \n // Format the response text\n let responseText = `📋 Issue ${issue.identifier}: ${issue.title}\\n`;\n responseText += `Status: ${state?.name || 'Unknown'}\\n`;\n responseText += `Priority: ${issue.priorityLabel}\\n`;\n if (assignee) {\n responseText += `Assignee: ${assignee.name}\\n`;\n }\n if (issue.dueDate) {\n responseText += `Due: ${new Date(issue.dueDate).toLocaleDateString()}\\n`;\n }\n if (issue.description) {\n responseText += `\\nDescription: ${issue.description}\\n`;\n }\n responseText += `\\nView in Linear: ${issue.url}`;\n \n // Send the formatted issue details to the channel\n await callback?.({\n text: responseText,\n source: message.content.source\n });\n \n return {\n text: responseText,\n success: true,\n data: issueDetails\n };\n } catch (error) {\n logger.error('Failed to get issue:', error);\n const errorMessage = `❌ Failed to get issue: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger, HandlerCallback } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\nimport type { LinearIssueInput } from '../types';\n\nexport const updateIssueAction: Action = {\n name: 'UPDATE_LINEAR_ISSUE',\n description: 'Update an existing Linear issue',\n similes: ['update-linear-issue', 'edit-linear-issue', 'modify-linear-issue'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Update issue ENG-123 title to \"Fix login button on all devices\"'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll update the title of issue ENG-123 for you.',\n actions: ['UPDATE_LINEAR_ISSUE']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Change the priority of BUG-456 to high'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll change the priority of BUG-456 to high.',\n actions: ['UPDATE_LINEAR_ISSUE']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n const errorMessage = 'Please provide update instructions for the issue.';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n // Extract issue ID from the message\n const issueMatch = content.match(/(\\w+-\\d+)/);\n if (!issueMatch) {\n const errorMessage = 'Please specify an issue ID (e.g., ENG-123) to update.';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n const issueId = issueMatch[1];\n \n // Parse update instructions\n const updates: Partial<LinearIssueInput> = {};\n \n // Title update\n const titleMatch = content.match(/title to [\"'](.+?)[\"']/i);\n if (titleMatch) {\n updates.title = titleMatch[1];\n }\n \n // Priority update\n const priorityMatch = content.match(/priority (?:to |as )?(\\w+)/i);\n if (priorityMatch) {\n const priorityMap: Record<string, number> = {\n 'urgent': 1,\n 'high': 2,\n 'normal': 3,\n 'medium': 3,\n 'low': 4,\n };\n const priority = priorityMap[priorityMatch[1].toLowerCase()];\n if (priority) {\n updates.priority = priority;\n }\n }\n \n // Description update\n const descMatch = content.match(/description to [\"'](.+?)[\"']/i);\n if (descMatch) {\n updates.description = descMatch[1];\n }\n \n // Status update\n const statusMatch = content.match(/status to (\\w+)/i);\n if (statusMatch) {\n // This would need to look up the state ID - simplified for now\n logger.warn('Status updates not yet implemented');\n }\n \n if (Object.keys(updates).length === 0) {\n const errorMessage = 'No valid updates found. Please specify what to update (e.g., \"Update issue ENG-123 title to \\'New Title\\'\")';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n const updatedIssue = await linearService.updateIssue(issueId, updates);\n \n const updateSummary = Object.entries(updates)\n .map(([key, value]) => `${key}: ${value}`)\n .join(', ');\n \n const successMessage = `✅ Updated issue ${updatedIssue.identifier}: ${updateSummary}\\n\\nView it at: ${updatedIssue.url}`;\n await callback?.({\n text: successMessage,\n source: message.content.source\n });\n \n return {\n text: `Updated issue ${updatedIssue.identifier}: ${updateSummary}`,\n success: true,\n data: {\n issueId: updatedIssue.id,\n identifier: updatedIssue.identifier,\n updates,\n url: updatedIssue.url\n }\n };\n } catch (error) {\n logger.error('Failed to update issue:', error);\n const errorMessage = `❌ Failed to update issue: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import {\n Action,\n ActionResult,\n IAgentRuntime,\n Memory,\n State,\n ModelType,\n logger,\n HandlerCallback,\n} from '@elizaos/core';\nimport { LinearService } from '../services/linear';\nimport type { LinearSearchFilters } from '../types';\n\nconst searchTemplate = `Extract search criteria from the user's request for Linear issues.\n\nUser request: \"{{userMessage}}\"\n\nExtract and return ONLY a JSON object (no markdown formatting, no code blocks) with these possible filters:\n{\n \"query\": \"general search text\",\n \"state\": \"filter by state name (e.g., 'In Progress', 'Done', 'Todo')\",\n \"assignee\": \"filter by assignee name or email\",\n \"priority\": \"filter by priority (1=urgent, 2=high, 3=normal, 4=low)\",\n \"team\": \"filter by team name or key\",\n \"label\": \"filter by label name\",\n \"hasAssignee\": true/false - whether issue should have an assignee,\n \"limit\": number of results to return (default 10)\n}\n\nOnly include fields that are mentioned. Return only the JSON object.`;\n\nexport const searchIssuesAction: Action = {\n name: 'SEARCH_LINEAR_ISSUES',\n description: 'Search for issues in Linear with various filters',\n similes: ['search-linear-issues', 'find-linear-issues', 'query-linear-issues'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me all open bugs'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll search for all open bug issues in Linear.',\n actions: ['SEARCH_LINEAR_ISSUES']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Find high priority issues assigned to me'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll search for high priority issues assigned to you.',\n actions: ['SEARCH_LINEAR_ISSUES']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n const errorMessage = 'Please provide search criteria for issues.';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n let filters: LinearSearchFilters = {};\n \n // Check if we have explicit filters in options\n if (_options?.filters) {\n filters = _options.filters as LinearSearchFilters;\n } else {\n // Use LLM to extract search filters\n const prompt = searchTemplate.replace('{{userMessage}}', content);\n \n const response = await runtime.useModel(ModelType.TEXT_LARGE, {\n prompt: prompt\n });\n \n if (!response) {\n // Fallback to simple keyword search\n filters = { query: content };\n } else {\n try {\n // Strip markdown code blocks if present\n const cleanedResponse = response.replace(/^```(?:json)?\\n?/,'').replace(/\\n?```$/,'').trim();\n const parsed = JSON.parse(cleanedResponse);\n filters = {\n query: parsed.query,\n state: parsed.state ? [parsed.state] : undefined,\n assignee: parsed.assignee ? [parsed.assignee] : undefined,\n priority: parsed.priority ? [parsed.priority] : undefined,\n team: parsed.team,\n label: parsed.label ? [parsed.label] : undefined,\n limit: parsed.limit\n };\n \n // Clean up undefined values\n Object.keys(filters).forEach(key => {\n if (filters[key as keyof LinearSearchFilters] === undefined) {\n delete filters[key as keyof LinearSearchFilters];\n }\n });\n } catch (parseError) {\n logger.error('Failed to parse search filters:', parseError);\n // Fallback to simple search\n filters = { query: content };\n }\n }\n }\n \n filters.limit = (_options?.limit as number) || 10;\n const issues = await linearService.searchIssues(filters);\n \n if (issues.length === 0) {\n const noResultsMessage = 'No issues found matching your search criteria.';\n await callback?.({\n text: noResultsMessage,\n source: message.content.source\n });\n return {\n text: noResultsMessage,\n success: true,\n data: {\n issues: [],\n filters,\n count: 0\n }\n };\n }\n \n const issueList = await Promise.all(issues.map(async (issue, index) => {\n const state = await issue.state;\n return `${index + 1}. ${issue.identifier}: ${issue.title} (${state?.name || 'No state'})`;\n }));\n const issueText = issueList.join('\\n');\n \n const resultMessage = `📋 Found ${issues.length} issue${issues.length === 1 ? '' : 's'}:\\n${issueText}`;\n await callback?.({\n text: resultMessage,\n source: message.content.source\n });\n \n return {\n text: `Found ${issues.length} issue${issues.length === 1 ? '' : 's'}:\\n${issueText}`,\n success: true,\n data: {\n issues: issues.map(i => ({\n id: i.id,\n identifier: i.identifier,\n title: i.title,\n description: i.description,\n url: i.url,\n state: i.state,\n priority: i.priority,\n priorityLabel: i.priorityLabel,\n assignee: i.assignee\n })),\n filters,\n count: issues.length\n }\n };\n } catch (error) {\n logger.error('Failed to search issues:', error);\n const errorMessage = `❌ Failed to search issues: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, ActionExample, logger, HandlerCallback } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const createCommentAction: Action = {\n name: 'CREATE_LINEAR_COMMENT',\n description: 'Create a comment on a Linear issue',\n similes: ['create-linear-comment', 'add-linear-comment', 'comment-on-linear-issue'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Comment on ENG-123: This has been fixed in the latest release'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll add that comment to issue ENG-123.',\n actions: ['CREATE_LINEAR_COMMENT']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Add a comment to BUG-456: Need more information from the reporter'\n }\n },\n {\n name: 'Assistant', \n content: {\n text: 'I\\'ll post that comment on BUG-456 right away.',\n actions: ['CREATE_LINEAR_COMMENT']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const content = message.content.text;\n if (!content) {\n const errorMessage = 'Please provide a message with the issue ID and comment content.';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n const issueMatch = content.match(/(?:comment on|add.*comment.*to)\\s+(\\w+-\\d+):?\\s*(.*)/i);\n \n if (!issueMatch) {\n const errorMessage = 'Please specify the issue ID and comment content. Example: \"Comment on ENG-123: This looks good\"';\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n \n const [, issueIdentifier, commentBody] = issueMatch;\n \n // Find the issue first to get its ID\n const issue = await linearService.getIssue(issueIdentifier);\n \n const comment = await linearService.createComment({\n issueId: issue.id,\n body: commentBody.trim()\n });\n \n const successMessage = `✅ Comment added to issue ${issueIdentifier}: \"${commentBody.trim()}\"`;\n await callback?.({\n text: successMessage,\n source: message.content.source\n });\n \n return {\n text: `Comment added to issue ${issueIdentifier}: \"${commentBody.trim()}\"`,\n success: true,\n data: {\n commentId: comment.id,\n issueId: issue.id\n }\n };\n } catch (error) {\n logger.error('Failed to create comment:', error);\n const errorMessage = `❌ Failed to create comment: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger, HandlerCallback } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const listTeamsAction: Action = {\n name: 'LIST_LINEAR_TEAMS',\n description: 'List all teams in Linear',\n similes: ['list-linear-teams', 'show-linear-teams', 'get-linear-teams'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me all teams'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll list all the teams in Linear for you.',\n actions: ['LIST_LINEAR_TEAMS']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'What teams are available?'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'Let me show you all the available teams.',\n actions: ['LIST_LINEAR_TEAMS']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const teams = await linearService.getTeams();\n \n if (teams.length === 0) {\n const noTeamsMessage = 'No teams found in Linear.';\n await callback?.({\n text: noTeamsMessage,\n source: message.content.source\n });\n return {\n text: noTeamsMessage,\n success: true,\n data: {\n teams: []\n }\n };\n }\n \n const teamList = teams.map((team, index) => \n `${index + 1}. ${team.name} (${team.key})${team.description ? ` - ${team.description}` : ''}`\n ).join('\\n');\n \n const resultMessage = `👥 Found ${teams.length} team${teams.length === 1 ? '' : 's'}:\\n${teamList}`;\n await callback?.({\n text: resultMessage,\n source: message.content.source\n });\n \n return {\n text: `Found ${teams.length} team${teams.length === 1 ? '' : 's'}:\\n${teamList}`,\n success: true,\n data: {\n teams: teams.map(t => ({\n id: t.id,\n name: t.name,\n key: t.key,\n description: t.description\n })),\n count: teams.length\n }\n };\n } catch (error) {\n logger.error('Failed to list teams:', error);\n const errorMessage = `❌ Failed to list teams: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger, HandlerCallback } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const listProjectsAction: Action = {\n name: 'LIST_LINEAR_PROJECTS',\n description: 'List all projects in Linear',\n similes: ['list-linear-projects', 'show-linear-projects', 'get-linear-projects'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me all projects'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll list all the projects in Linear for you.',\n actions: ['LIST_LINEAR_PROJECTS']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'What projects do we have?'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'Let me show you all the available projects.',\n actions: ['LIST_LINEAR_PROJECTS']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const projects = await linearService.getProjects();\n \n if (projects.length === 0) {\n const noProjectsMessage = 'No projects found in Linear.';\n await callback?.({\n text: noProjectsMessage,\n source: message.content.source\n });\n return {\n text: noProjectsMessage,\n success: true,\n data: {\n projects: []\n }\n };\n }\n \n // Get teams for each project\n const projectsWithDetails = await Promise.all(\n projects.map(async (project) => {\n const teamsQuery = await project.teams();\n const teams = await teamsQuery.nodes;\n return {\n ...project,\n teamsList: teams\n };\n })\n );\n \n const projectList = projectsWithDetails.map((project, index) => {\n const teamNames = project.teamsList.map((t: any) => t.name).join(', ') || 'No teams';\n return `${index + 1}. ${project.name}${project.description ? ` - ${project.description}` : ''} (Teams: ${teamNames})`;\n }).join('\\n');\n \n const resultMessage = `📁 Found ${projects.length} project${projects.length === 1 ? '' : 's'}:\\n${projectList}`;\n await callback?.({\n text: resultMessage,\n source: message.content.source\n });\n \n return {\n text: `Found ${projects.length} project${projects.length === 1 ? '' : 's'}:\\n${projectList}`,\n success: true,\n data: {\n projects: projectsWithDetails.map(p => ({\n id: p.id,\n name: p.name,\n description: p.description,\n url: p.url,\n teams: p.teamsList.map((t: any) => ({\n id: t.id,\n name: t.name,\n key: t.key\n })),\n state: p.state,\n progress: p.progress,\n startDate: p.startDate,\n targetDate: p.targetDate\n })),\n count: projects.length\n }\n };\n } catch (error) {\n logger.error('Failed to list projects:', error);\n const errorMessage = `❌ Failed to list projects: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, logger, HandlerCallback } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const getActivityAction: Action = {\n name: 'GET_LINEAR_ACTIVITY',\n description: 'Get recent Linear activity',\n similes: ['get-linear-activity', 'show-linear-activity', 'view-linear-activity'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Show me recent Linear activity'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll check the recent Linear activity for you.',\n actions: ['GET_LINEAR_ACTIVITY']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'What\\'s been happening in Linear?'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'Let me show you the recent Linear activity.',\n actions: ['GET_LINEAR_ACTIVITY']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n const activity = linearService.getActivityLog();\n \n if (activity.length === 0) {\n const noActivityMessage = 'No recent Linear activity found.';\n await callback?.({\n text: noActivityMessage,\n source: message.content.source\n });\n return {\n text: noActivityMessage,\n success: true,\n data: {\n activity: []\n }\n };\n }\n \n const activityText = activity\n .slice(0, 10) // Show last 10 activities\n .map((item, index) => {\n const description = `${item.action} ${item.resource_type} ${item.resource_id}${item.error ? ` (failed: ${item.error})` : ''}`;\n return `${index + 1}. ${description}`;\n })\n .join('\\n');\n \n const resultMessage = `📊 Recent Linear activity:\\n${activityText}`;\n await callback?.({\n text: resultMessage,\n source: message.content.source\n });\n \n return {\n text: `Recent Linear activity:\\n${activityText}`,\n success: true,\n data: {\n activity: activity.slice(0, 10),\n count: activity.length\n }\n };\n } catch (error) {\n logger.error('Failed to get Linear activity:', error);\n const errorMessage = `❌ Failed to get Linear activity: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import { Action, ActionResult, IAgentRuntime, Memory, State, ActionExample, logger, HandlerCallback } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const clearActivityAction: Action = {\n name: 'CLEAR_LINEAR_ACTIVITY',\n description: 'Clear the Linear activity log',\n similes: ['clear-linear-activity', 'reset-linear-activity', 'delete-linear-activity'],\n \n examples: [[\n {\n name: 'User',\n content: {\n text: 'Clear the Linear activity log'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll clear the Linear activity log for you.',\n actions: ['CLEAR_LINEAR_ACTIVITY']\n }\n }\n ], [\n {\n name: 'User',\n content: {\n text: 'Reset Linear activity'\n }\n },\n {\n name: 'Assistant',\n content: {\n text: 'I\\'ll reset the Linear activity log now.',\n actions: ['CLEAR_LINEAR_ACTIVITY']\n }\n }\n ]],\n \n async validate(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<boolean> {\n try {\n const apiKey = runtime.getSetting('LINEAR_API_KEY');\n return !!apiKey;\n } catch {\n return false;\n }\n },\n \n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n throw new Error('Linear service not available');\n }\n \n await linearService.clearActivityLog();\n \n const successMessage = '✅ Linear activity log has been cleared.';\n await callback?.({\n text: successMessage,\n source: message.content.source\n });\n \n return {\n text: successMessage,\n success: true\n };\n } catch (error) {\n logger.error('Failed to clear Linear activity:', error);\n const errorMessage = `❌ Failed to clear Linear activity: ${error instanceof Error ? error.message : 'Unknown error'}`;\n await callback?.({\n text: errorMessage,\n source: message.content.source\n });\n return {\n text: errorMessage,\n success: false\n };\n }\n }\n}; ","import type { IAgentRuntime, Memory, Provider, State } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const linearIssuesProvider: Provider = {\n name: 'LINEAR_ISSUES',\n description: 'Provides context about recent Linear issues',\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n return {\n text: 'Linear service is not available',\n };\n }\n \n // Get recent issues\n const issues = await linearService.searchIssues({ limit: 10 });\n \n if (issues.length === 0) {\n return {\n text: 'No recent Linear issues found',\n };\n }\n \n // Format issues for context\n const issuesList = await Promise.all(\n issues.map(async (issue: any) => {\n const [assignee, state] = await Promise.all([\n issue.assignee,\n issue.state,\n ]);\n \n return `- ${issue.identifier}: ${issue.title} (${state?.name || 'Unknown'}, ${assignee?.name || 'Unassigned'})`;\n })\n );\n \n const text = `Recent Linear Issues:\\n${issuesList.join('\\n')}`;\n \n return {\n text,\n data: {\n issues: issues.map((issue: any) => ({\n id: issue.id,\n identifier: issue.identifier,\n title: issue.title,\n })),\n },\n };\n } catch (error) {\n return {\n text: 'Error retrieving Linear issues',\n };\n }\n },\n}; ","import type { IAgentRuntime, Memory, Provider, State } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const linearTeamsProvider: Provider = {\n name: 'LINEAR_TEAMS',\n description: 'Provides context about Linear teams',\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n return {\n text: 'Linear service is not available',\n };\n }\n \n const teams = await linearService.getTeams();\n \n if (teams.length === 0) {\n return {\n text: 'No Linear teams found',\n };\n }\n \n const teamsList = teams.map((team: any) => \n `- ${team.name} (${team.key}): ${team.description || 'No description'}`\n );\n \n const text = `Linear Teams:\\n${teamsList.join('\\n')}`;\n \n return {\n text,\n data: {\n teams: teams.map((team: any) => ({\n id: team.id,\n name: team.name,\n key: team.key,\n })),\n },\n };\n } catch (error) {\n return {\n text: 'Error retrieving Linear teams',\n };\n }\n },\n}; ","import type { IAgentRuntime, Memory, Provider, State } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\n\nexport const linearProjectsProvider: Provider = {\n name: 'LINEAR_PROJECTS',\n description: 'Provides context about active Linear projects',\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n return {\n text: 'Linear service is not available',\n };\n }\n \n const projects = await linearService.getProjects();\n \n if (projects.length === 0) {\n return {\n text: 'No Linear projects found',\n };\n }\n \n // Filter active projects\n const activeProjects = projects.filter((project: any) => \n project.state === 'started' || project.state === 'planned'\n );\n \n const projectsList = activeProjects.slice(0, 10).map((project: any) => \n `- ${project.name}: ${project.state} (${project.startDate || 'No start date'} - ${project.targetDate || 'No target date'})`\n );\n \n const text = `Active Linear Projects:\\n${projectsList.join('\\n')}`;\n \n return {\n text,\n data: {\n projects: activeProjects.slice(0, 10).map((project: any) => ({\n id: project.id,\n name: project.name,\n state: project.state,\n })),\n },\n };\n } catch (error) {\n return {\n text: 'Error retrieving Linear projects',\n };\n }\n },\n}; ","import type { IAgentRuntime, Memory, Provider, State } from '@elizaos/core';\nimport { LinearService } from '../services/linear';\nimport type { LinearActivityItem } from '../types';\n\nexport const linearActivityProvider: Provider = {\n name: 'LINEAR_ACTIVITY',\n description: 'Provides context about recent Linear activity',\n get: async (runtime: IAgentRuntime, _message: Memory, _state: State) => {\n try {\n const linearService = runtime.getService<LinearService>('linear');\n if (!linearService) {\n return {\n text: 'Linear service is not available',\n };\n }\n \n const activity = linearService.getActivityLog(10);\n \n if (activity.length === 0) {\n return {\n text: 'No recent Linear activity',\n };\n }\n \n const activityList = activity.map((item: LinearActivityItem) => {\n const status = item.success ? '✓' : '✗';\n const time = new Date(item.timestamp).toLocaleTimeString();\n return `${status} ${time}: ${item.action} ${item.resource_type} ${item.resource_id}`;\n });\n \n const text = `Recent Linear Activity:\\n${activityList.join('\\n')}`;\n \n return {\n text,\n data: {\n activity: activity.slice(0, 10),\n },\n };\n } catch (error) {\n return {\n text: 'Error retrieving Linear activity',\n };\n }\n },\n}; ","import { Plugin } from '@elizaos/core';\nimport { LinearService } from './services/linear';\n\n// Import all actions\nimport { createIssueAction } from './actions/createIssue';\nimport { getIssueAction } from './actions/getIssue';\nimport { updateIssueAction } from './actions/updateIssue';\nimport { searchIssuesAction } from './actions/searchIssues';\nimport { createCommentAction } from './actions/createComment';\nimport { listTeamsAction } from './actions/listTeams';\nimport { listProjectsAction } from './actions/listProjects';\nimport { getActivityAction } from './actions/getActivity';\nimport { clearActivityAction } from './actions/clearActivity';\n\n// Import all providers\nimport { linearIssuesProvider } from './providers/issues';\nimport { linearTeamsProvider } from './providers/teams';\nimport { linearProjectsProvider } from './providers/projects';\nimport { linearActivityProvider } from './providers/activity';\n\nexport const linearPlugin: Plugin = {\n name: '@elizaos/plugin-linear',\n description: 'Plugin for integrating with Linear issue tracking system',\n services: [LinearService],\n actions: [\n createIssueAction,\n getIssueAction,\n updateIssueAction,\n searchIssuesAction,\n createCommentAction,\n listTeamsAction,\n listProjectsAction,\n getActivityAction,\n clearActivityAction,\n ],\n providers: [\n linearIssuesProvider,\n linearTeamsProvider,\n linearProjectsProvider,\n linearActivityProvider,\n ],\n};\n\n// Re-export types and service for external use\nexport * from './types';\nexport { LinearService } from './services/linear'; "],"mappings":";AAAA,SAAS,QAAQ,eAAmC;AACpD,SAAS,oBAAoF;;;AC6CtF,IAAM,iBAAN,cAA6B,MAAM;AAAA,EACxC,YACE,SACO,QACA,UACP;AACA,UAAM,OAAO;AAHN;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,4BAAN,cAAwC,eAAe;AAAA,EAC5D,YAAY,SAAiB;AAC3B,UAAM,SAAS,GAAG;AAClB,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,uBAAN,cAAmC,eAAe;AAAA,EACvD,YACE,SACO,WACP;AACA,UAAM,SAAS,GAAG;AAFX;AAGP,SAAK,OAAO;AAAA,EACd;AACF;;;AD7DO,IAAM,iBAAN,MAAM,uBAAsB,QAAQ;AAAA,EAUzC,YAAY,SAAyB;AACnC,UAAM,OAAO;AARf,iCAAwB;AAGxB,SAAQ,cAAoC,CAAC;AAQ3C,UAAM,SAAS,SAAS,WAAW,gBAAgB;AACnD,UAAM,cAAc,SAAS,WAAW,qBAAqB;AAE7D,QAAI,CAAC,QAAQ;AACX,YA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;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["logger","logger","logger","ModelType","logger","logger","logger","logger","logger","logger"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-linear",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Linear integration plugin for ElizaOS",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",