@elizaos/plugin-linear 1.2.6 → 1.2.8
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 +52 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -367,14 +367,14 @@ var createIssueTemplate = `Given the user's request, extract the information nee
|
|
|
367
367
|
|
|
368
368
|
User request: "{{userMessage}}"
|
|
369
369
|
|
|
370
|
-
Extract and return a JSON object with the following structure:
|
|
370
|
+
Extract and return ONLY a JSON object (no markdown formatting, no code blocks) with the following structure:
|
|
371
371
|
{
|
|
372
372
|
"title": "Brief, clear issue title",
|
|
373
|
-
"description": "Detailed description of the issue (optional)",
|
|
374
|
-
"teamKey": "Team key if mentioned (e.g., ENG, PROD)",
|
|
375
|
-
"priority": "Priority level if mentioned (1=urgent, 2=high, 3=normal, 4=low)",
|
|
376
|
-
"labels": ["label1", "label2"] (if any labels are mentioned),
|
|
377
|
-
"assignee": "Assignee username or email if mentioned"
|
|
373
|
+
"description": "Detailed description of the issue (optional, omit or use null if not provided)",
|
|
374
|
+
"teamKey": "Team key if mentioned (e.g., ENG, PROD) - omit or use null if not mentioned",
|
|
375
|
+
"priority": "Priority level if mentioned (1=urgent, 2=high, 3=normal, 4=low) - omit or use null if not mentioned",
|
|
376
|
+
"labels": ["label1", "label2"] (if any labels are mentioned, empty array if none),
|
|
377
|
+
"assignee": "Assignee username or email if mentioned - omit or use null if not mentioned"
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
Return only the JSON object, no other text.`;
|
|
@@ -445,11 +445,12 @@ var createIssueAction = {
|
|
|
445
445
|
throw new Error("Failed to extract issue information");
|
|
446
446
|
}
|
|
447
447
|
try {
|
|
448
|
-
const
|
|
448
|
+
const cleanedResponse = response.replace(/^```(?:json)?\n?/, "").replace(/\n?```$/, "").trim();
|
|
449
|
+
const parsed = JSON.parse(cleanedResponse);
|
|
449
450
|
issueData = {
|
|
450
|
-
title: parsed.title,
|
|
451
|
-
description: parsed.description,
|
|
452
|
-
priority: parsed.priority
|
|
451
|
+
title: parsed.title || void 0,
|
|
452
|
+
description: parsed.description || void 0,
|
|
453
|
+
priority: parsed.priority ? Number(parsed.priority) : void 0
|
|
453
454
|
};
|
|
454
455
|
if (parsed.teamKey) {
|
|
455
456
|
const teams = await linearService.getTeams();
|
|
@@ -460,21 +461,51 @@ var createIssueAction = {
|
|
|
460
461
|
issueData.teamId = team.id;
|
|
461
462
|
}
|
|
462
463
|
}
|
|
463
|
-
if (parsed.assignee) {
|
|
464
|
+
if (parsed.assignee && parsed.assignee !== "") {
|
|
465
|
+
const cleanAssignee = parsed.assignee.replace(/^@/, "");
|
|
464
466
|
const users = await linearService.getUsers();
|
|
465
467
|
const user = users.find(
|
|
466
|
-
(u) => u.email ===
|
|
468
|
+
(u) => u.email === cleanAssignee || u.name.toLowerCase().includes(cleanAssignee.toLowerCase())
|
|
467
469
|
);
|
|
468
470
|
if (user) {
|
|
469
471
|
issueData.assigneeId = user.id;
|
|
470
472
|
}
|
|
471
473
|
}
|
|
474
|
+
if (parsed.labels && Array.isArray(parsed.labels) && parsed.labels.length > 0) {
|
|
475
|
+
const labels = await linearService.getLabels(issueData.teamId);
|
|
476
|
+
const labelIds = [];
|
|
477
|
+
for (const labelName of parsed.labels) {
|
|
478
|
+
if (labelName && labelName !== "") {
|
|
479
|
+
const label = labels.find(
|
|
480
|
+
(l) => l.name.toLowerCase() === labelName.toLowerCase()
|
|
481
|
+
);
|
|
482
|
+
if (label) {
|
|
483
|
+
labelIds.push(label.id);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
if (labelIds.length > 0) {
|
|
488
|
+
issueData.labelIds = labelIds;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
if (!issueData.teamId) {
|
|
492
|
+
const teams = await linearService.getTeams();
|
|
493
|
+
if (teams.length > 0) {
|
|
494
|
+
issueData.teamId = teams[0].id;
|
|
495
|
+
logger2.warn(`No team specified, using default team: ${teams[0].name}`);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
472
498
|
} catch (parseError) {
|
|
473
499
|
logger2.error("Failed to parse LLM response:", parseError);
|
|
474
500
|
issueData = {
|
|
475
501
|
title: content.length > 100 ? content.substring(0, 100) + "..." : content,
|
|
476
502
|
description: content
|
|
477
503
|
};
|
|
504
|
+
const teams = await linearService.getTeams();
|
|
505
|
+
if (teams.length > 0) {
|
|
506
|
+
issueData.teamId = teams[0].id;
|
|
507
|
+
logger2.warn(`Using default team for fallback: ${teams[0].name}`);
|
|
508
|
+
}
|
|
478
509
|
}
|
|
479
510
|
}
|
|
480
511
|
if (!issueData.title) {
|
|
@@ -483,6 +514,12 @@ var createIssueAction = {
|
|
|
483
514
|
success: false
|
|
484
515
|
};
|
|
485
516
|
}
|
|
517
|
+
if (!issueData.teamId) {
|
|
518
|
+
return {
|
|
519
|
+
text: "No Linear teams found. Please ensure at least one team exists in your Linear workspace.",
|
|
520
|
+
success: false
|
|
521
|
+
};
|
|
522
|
+
}
|
|
486
523
|
const issue = await linearService.createIssue(issueData);
|
|
487
524
|
return {
|
|
488
525
|
text: `Created issue: ${issue.title} (${issue.identifier})`,
|
|
@@ -775,7 +812,7 @@ var searchTemplate = `Extract search criteria from the user's request for Linear
|
|
|
775
812
|
|
|
776
813
|
User request: "{{userMessage}}"
|
|
777
814
|
|
|
778
|
-
Extract and return a JSON object with these possible filters:
|
|
815
|
+
Extract and return ONLY a JSON object (no markdown formatting, no code blocks) with these possible filters:
|
|
779
816
|
{
|
|
780
817
|
"query": "general search text",
|
|
781
818
|
"state": "filter by state name (e.g., 'In Progress', 'Done', 'Todo')",
|
|
@@ -854,7 +891,8 @@ var searchIssuesAction = {
|
|
|
854
891
|
filters = { query: content };
|
|
855
892
|
} else {
|
|
856
893
|
try {
|
|
857
|
-
const
|
|
894
|
+
const cleanedResponse = response.replace(/^```(?:json)?\n?/, "").replace(/\n?```$/, "").trim();
|
|
895
|
+
const parsed = JSON.parse(cleanedResponse);
|
|
858
896
|
filters = {
|
|
859
897
|
query: parsed.query,
|
|
860
898
|
state: parsed.state ? [parsed.state] : void 0,
|
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 a JSON object with the following structure:\n{\n \"title\": \"Brief, clear issue title\",\n \"description\": \"Detailed description of the issue (optional)\",\n \"teamKey\": \"Team key if mentioned (e.g., ENG, PROD)\",\n \"priority\": \"Priority level if mentioned (1=urgent, 2=high, 3=normal, 4=low)\",\n \"labels\": [\"label1\", \"label2\"] (if any labels are mentioned),\n \"assignee\": \"Assignee username or email if 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 const parsed = JSON.parse(response);\n issueData = {\n title: parsed.title,\n description: parsed.description,\n priority: parsed.priority,\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) {\n const users = await linearService.getUsers();\n const user = users.find(u => \n u.email === parsed.assignee || \n u.name.toLowerCase().includes(parsed.assignee.toLowerCase())\n );\n if (user) {\n issueData.assigneeId = user.id;\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 }\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 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 a JSON object 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 const parsed = JSON.parse(response);\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,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AAAA,EACxB,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;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"]}
|
|
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,uBAA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A,IACA;AAAA,IACA;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"]}
|