@elizaos/plugin-linear 1.2.15 → 2.0.0-alpha.1

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/README.md CHANGED
@@ -1,374 +1,83 @@
1
- # @elizaos/plugin-linear
1
+ # @elizaos/plugin-linear-ts
2
2
 
3
- A comprehensive Linear integration plugin for ElizaOS that enables issue tracking, project management, and team collaboration through the Linear API.
3
+ TypeScript implementation of the Linear integration plugin for ElizaOS.
4
4
 
5
5
  ## Features
6
6
 
7
- ### 🤖 Natural Language Understanding
8
- All actions now support advanced natural language parsing powered by LLM:
9
- - **Flexible References**: Reference issues by ID, title keywords, assignee, or recency
10
- - **Smart Filtering**: Use natural language for complex searches and filters
11
- - **Context Awareness**: Understands relative references like "my issues" or "today's activity"
12
- - **Graceful Fallbacks**: Falls back to pattern matching when LLM parsing fails
13
-
14
- ## Core Features
15
-
16
- ### 📋 Issue Management
17
- - **Create Issues**: Create new issues with title, description, priority, assignees, and labels
18
- - **Get Issue Details**: Retrieve comprehensive information about specific issues
19
- - **Update Issues**: Modify existing issues with new information
20
- - **Delete Issues**: Archive issues (move to archived state)
21
- - **Search Issues**: Find issues using various filters and search criteria
22
- - **Add Comments**: Comment on existing issues
23
-
24
- ### 👥 Team & User Management
25
- - **List Teams**: View all teams in your Linear workspace
26
- - **Get Team Details**: Retrieve specific team information
27
- - **List Users**: View all users in the workspace
28
- - **Get Current User**: Retrieve information about the authenticated user
29
-
30
- ### 📊 Project Management
31
- - **List Projects**: View all projects, optionally filtered by team
32
- - **Get Project Details**: Retrieve specific project information
33
- - **Project Status**: Track project states and timelines
34
-
35
- ### 📈 Activity Tracking
36
- - **Activity Log**: Track all Linear operations performed by the agent
37
- - **Clear Activity**: Reset the activity log
38
- - **Success/Error Tracking**: Monitor operation success rates
7
+ - **Issue Management**: Create, read, update, delete, and search issues
8
+ - **Comment Management**: Add comments to issues
9
+ - **Team Operations**: List and filter teams
10
+ - **Project Management**: List and filter projects
11
+ - **Activity Tracking**: Track and view Linear operations
12
+ - **Natural Language Understanding**: LLM-powered parsing of user requests
39
13
 
40
14
  ## Installation
41
15
 
42
16
  ```bash
43
- npm install @elizaos/plugin-linear
17
+ npm install @elizaos/plugin-linear-ts
18
+ # or
19
+ bun add @elizaos/plugin-linear-ts
44
20
  ```
45
21
 
46
22
  ## Configuration
47
23
 
48
- The plugin requires a Linear API key for authentication. You can obtain one from your [Linear settings](https://linear.app/settings/api).
49
-
50
- ### Environment Variables
51
-
52
- Create a `.env` file in your project root:
24
+ Set these environment variables:
53
25
 
54
26
  ```env
55
- # Required
56
- LINEAR_API_KEY=your_linear_api_key_here
57
-
58
- # Optional
59
- LINEAR_WORKSPACE_ID=your_workspace_id_here
60
- LINEAR_DEFAULT_TEAM_KEY=your_default_team_key_here # e.g., ENG, ELIZA, COM2
27
+ LINEAR_API_KEY=your_api_key # Required
28
+ LINEAR_WORKSPACE_ID=your_workspace # Optional
29
+ LINEAR_DEFAULT_TEAM_KEY=ENG # Optional
61
30
  ```
62
31
 
63
- ### Default Team Behavior
64
-
65
- When `LINEAR_DEFAULT_TEAM_KEY` is configured, it affects the following actions:
66
-
67
- - **Create Issue**: New issues will be assigned to the default team if no team is specified
68
- - **Search Issues**: Searches will be filtered by the default team unless:
69
- - A team filter is explicitly provided
70
- - The user asks for "all" issues
71
- - **List Projects**: Projects will be filtered by the default team unless:
72
- - A specific team is mentioned
73
- - The user asks for "all" projects
74
-
75
- This helps ensure that actions are scoped to the most relevant team by default while still allowing users to access all data when needed.
76
-
77
32
  ## Usage
78
33
 
79
- ### Register the Plugin
80
-
81
34
  ```typescript
82
- import { linearPlugin } from '@elizaos/plugin-linear';
35
+ import { linearPlugin } from "@elizaos/plugin-linear-ts";
83
36
 
84
37
  // Register with your ElizaOS agent
85
38
  agent.registerPlugin(linearPlugin);
86
39
  ```
87
40
 
88
- ### Available Actions
89
-
90
- #### Create Issue
91
- ```typescript
92
- // Natural language
93
- "Create a new issue: Fix login button not working on mobile devices"
94
-
95
- // With options
96
- {
97
- action: "CREATE_LINEAR_ISSUE",
98
- options: {
99
- title: "Fix login button",
100
- description: "The login button is not responsive on mobile devices",
101
- teamId: "team-123",
102
- priority: 2, // High
103
- assigneeId: "user-456"
104
- }
105
- }
106
- ```
107
-
108
- #### Get Issue
109
- ```typescript
110
- // Natural language examples
111
- "Show me issue ENG-123" // Direct ID
112
- "What's the status of the login bug?" // Search by title
113
- "Show me the latest high priority issue assigned to Sarah" // Complex query
114
- "Get John's most recent task" // Assignee + recency
115
-
116
- // With options
117
- {
118
- action: "GET_LINEAR_ISSUE",
119
- options: {
120
- issueId: "issue-id-or-identifier"
121
- }
122
- }
123
- ```
124
-
125
- #### Search Issues
126
- ```typescript
127
- // Natural language
128
- "Show me all high priority bugs assigned to me" // Uses default team if configured
129
- "Show me all issues across all teams" // Searches all teams
130
- "Show me issues in the ELIZA team" // Searches specific team
131
-
132
- // With options
133
- {
134
- action: "SEARCH_LINEAR_ISSUES",
135
- options: {
136
- query: "bug",
137
- priority: [1, 2], // Urgent and High
138
- state: ["in-progress", "todo"],
139
- team: "ELIZA", // Override default team
140
- limit: 20
141
- }
142
- }
143
- ```
144
-
145
- #### Update Issue
146
- ```typescript
147
- // Natural language examples
148
- "Update issue ENG-123 title to 'Fix login button on all devices'"
149
- "Move issue COM2-7 to the ELIZA team"
150
- "Change the priority of BUG-456 to high and assign to john@example.com"
151
- "Update issue PROD-789 status to in-progress"
152
-
153
- // With options
154
- {
155
- action: "UPDATE_LINEAR_ISSUE",
156
- options: {
157
- issueId: "issue-id",
158
- title: "Updated title",
159
- description: "Updated description",
160
- priority: 1, // 1=urgent, 2=high, 3=normal, 4=low
161
- teamId: "team-id", // Move to different team
162
- assigneeId: "user-id",
163
- stateId: "state-id",
164
- labelIds: ["label-id-1", "label-id-2"]
165
- }
166
- }
167
- ```
168
-
169
- #### Delete Issue
170
- ```typescript
171
- // Natural language
172
- "Delete issue ENG-123"
173
- "Remove COM2-7 from Linear"
174
- "Archive the bug report BUG-456"
175
-
176
- // With options
177
- {
178
- action: "DELETE_LINEAR_ISSUE",
179
- options: {
180
- issueId: "issue-id-or-identifier"
181
- }
182
- }
183
- ```
184
-
185
- > **Note**: Linear doesn't support permanent deletion. This action archives the issue, moving it to an archived state where it won't appear in active views.
186
-
187
- #### Add Comment
188
- ```typescript
189
- // Natural language examples
190
- "Comment on ENG-123: This has been fixed in the latest release"
191
- "Tell the login bug that we need more information from QA"
192
- "Reply to COM2-7: Thanks for the update"
193
- "Add a note to the payment issue saying it's blocked by API changes"
194
-
195
- // With options
196
- {
197
- action: "CREATE_LINEAR_COMMENT",
198
- options: {
199
- issueId: "issue-id",
200
- body: "This has been fixed in the latest release"
201
- }
202
- }
203
- ```
204
-
205
- #### List Teams
206
- ```typescript
207
- // Natural language examples
208
- "Show me all teams" // Lists all teams
209
- "Which engineering teams do we have?" // Filter by name
210
- "Show me the teams I'm part of" // Personal teams
211
- "Show me the ELIZA team details" // Specific team lookup
212
- ```
213
-
214
- #### List Projects
215
- ```typescript
216
- // Natural language
217
- "Show me all projects" // Uses default team filter if configured
218
- "Show me all projects across all teams" // Lists all projects
219
- "Show me projects for the engineering team" // Lists projects for specific team
220
-
221
- // With options
222
- {
223
- action: "LIST_LINEAR_PROJECTS",
224
- options: {
225
- teamId: "team-id"
226
- }
227
- }
228
- ```
229
-
230
- #### Get Activity
231
- ```typescript
232
- // Natural language examples
233
- "Show me recent Linear activity" // All recent activity
234
- "What happened in Linear today?" // Time-based filter
235
- "Show me what issues John created this week" // User + action + time
236
- "Activity on ENG-123" // Resource-specific activity
237
- "Show me failed operations" // Filter by success status
41
+ ## Actions
238
42
 
239
- // With options
240
- {
241
- action: "GET_LINEAR_ACTIVITY",
242
- options: {
243
- limit: 50,
244
- filter: { resource_type: "issue" }
245
- }
246
- }
247
- ```
248
-
249
- ### Providers
250
-
251
- The plugin includes several context providers that supply Linear data to the agent:
252
-
253
- #### LINEAR_ISSUES
254
- Provides context about recent Linear issues:
255
- ```typescript
256
- "Recent Linear Issues:
257
- - ENG-123: Fix login button (In Progress, John Doe)
258
- - BUG-456: Memory leak in dashboard (Todo, Unassigned)
259
- ..."
260
- ```
261
-
262
- #### LINEAR_TEAMS
263
- Provides context about Linear teams:
264
- ```typescript
265
- "Linear Teams:
266
- - Engineering (ENG): Core development team
267
- - Design (DES): Product design team
268
- ..."
269
- ```
270
-
271
- #### LINEAR_PROJECTS
272
- Provides context about active Linear projects:
273
- ```typescript
274
- "Active Linear Projects:
275
- - Q1 2024 Roadmap: started (Jan 1 - Mar 31)
276
- - Mobile App Redesign: planned (Feb 1 - Apr 30)
277
- ..."
278
- ```
279
-
280
- #### LINEAR_ACTIVITY
281
- Provides context about recent Linear activity:
282
- ```typescript
283
- "Recent Linear Activity:
284
- ✓ 2:30 PM: create_issue issue ENG-789
285
- ✗ 2:25 PM: update_issue issue BUG-456
286
- ..."
287
- ```
43
+ | Action | Description |
44
+ | ----------------------- | ------------------------- |
45
+ | `CREATE_LINEAR_ISSUE` | Create a new issue |
46
+ | `GET_LINEAR_ISSUE` | Get issue details |
47
+ | `UPDATE_LINEAR_ISSUE` | Update an existing issue |
48
+ | `DELETE_LINEAR_ISSUE` | Archive an issue |
49
+ | `SEARCH_LINEAR_ISSUES` | Search for issues |
50
+ | `CREATE_LINEAR_COMMENT` | Add a comment to an issue |
51
+ | `LIST_LINEAR_TEAMS` | List teams |
52
+ | `LIST_LINEAR_PROJECTS` | List projects |
53
+ | `GET_LINEAR_ACTIVITY` | View activity log |
54
+ | `CLEAR_LINEAR_ACTIVITY` | Clear activity log |
288
55
 
289
- ## Service API
56
+ ## Providers
290
57
 
291
- The plugin exposes a `LinearService` that can be accessed programmatically:
292
-
293
- ```typescript
294
- const linearService = runtime.getService<LinearService>('linear');
295
-
296
- // Create an issue
297
- const issue = await linearService.createIssue({
298
- title: "New feature request",
299
- description: "Detailed description",
300
- teamId: "team-123",
301
- priority: 3
302
- });
303
-
304
- // Search issues
305
- const issues = await linearService.searchIssues({
306
- query: "authentication",
307
- state: ["todo", "in-progress"],
308
- limit: 10
309
- });
310
-
311
- // Get teams
312
- const teams = await linearService.getTeams();
313
-
314
- // Activity tracking
315
- const recentActivity = linearService.getActivityLog(50);
316
- ```
317
-
318
- ## Error Handling
319
-
320
- The plugin includes custom error classes for better error handling:
321
-
322
- - `LinearAPIError`: General API errors
323
- - `LinearAuthenticationError`: Authentication failures
324
- - `LinearRateLimitError`: Rate limit exceeded
325
-
326
- ```typescript
327
- try {
328
- await linearService.createIssue(issueData);
329
- } catch (error) {
330
- if (error instanceof LinearAuthenticationError) {
331
- // Handle auth error
332
- } else if (error instanceof LinearRateLimitError) {
333
- // Handle rate limit
334
- }
335
- }
336
- ```
337
-
338
- ## Priority Levels
339
-
340
- Linear uses numeric priority levels:
341
- - 0: No priority
342
- - 1: Urgent
343
- - 2: High
344
- - 3: Normal (default)
345
- - 4: Low
58
+ | Provider | Description |
59
+ | ----------------- | ----------------------------- |
60
+ | `LINEAR_ISSUES` | Context about recent issues |
61
+ | `LINEAR_TEAMS` | Context about teams |
62
+ | `LINEAR_PROJECTS` | Context about projects |
63
+ | `LINEAR_ACTIVITY` | Context about recent activity |
346
64
 
347
65
  ## Development
348
66
 
349
- ### Building
350
67
  ```bash
68
+ # Build
351
69
  npm run build
352
- ```
353
70
 
354
- ### Testing
355
- ```bash
71
+ # Test
356
72
  npm run test
357
- ```
358
73
 
359
- ### Linting
360
- ```bash
361
- npm run lint
74
+ # Watch mode
75
+ npm run dev
362
76
  ```
363
77
 
364
78
  ## License
365
79
 
366
80
  MIT
367
81
 
368
- ## Contributing
369
-
370
- Contributions are welcome! Please feel free to submit a Pull Request.
371
82
 
372
- ## Support
373
83
 
374
- For issues and feature requests, please create an issue on the [GitHub repository](https://github.com/elizaos/eliza).