openclaw-linear 0.3.0 → 0.5.0

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.
Files changed (50) hide show
  1. package/README.md +132 -55
  2. package/dist/event-router.d.ts +6 -0
  3. package/dist/event-router.d.ts.map +1 -1
  4. package/dist/event-router.js +216 -48
  5. package/dist/event-router.js.map +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +105 -5
  8. package/dist/index.js.map +1 -1
  9. package/dist/linear-api.d.ts +13 -0
  10. package/dist/linear-api.d.ts.map +1 -0
  11. package/dist/linear-api.js +120 -0
  12. package/dist/linear-api.js.map +1 -0
  13. package/dist/tools/linear-comment-tool.d.ts +3 -0
  14. package/dist/tools/linear-comment-tool.d.ts.map +1 -0
  15. package/dist/tools/linear-comment-tool.js +113 -0
  16. package/dist/tools/linear-comment-tool.js.map +1 -0
  17. package/dist/tools/linear-issue-tool.d.ts +3 -0
  18. package/dist/tools/linear-issue-tool.d.ts.map +1 -0
  19. package/dist/tools/linear-issue-tool.js +240 -0
  20. package/dist/tools/linear-issue-tool.js.map +1 -0
  21. package/dist/tools/linear-project-tool.d.ts +3 -0
  22. package/dist/tools/linear-project-tool.d.ts.map +1 -0
  23. package/dist/tools/linear-project-tool.js +126 -0
  24. package/dist/tools/linear-project-tool.js.map +1 -0
  25. package/dist/tools/linear-relation-tool.d.ts +3 -0
  26. package/dist/tools/linear-relation-tool.d.ts.map +1 -0
  27. package/dist/tools/linear-relation-tool.js +148 -0
  28. package/dist/tools/linear-relation-tool.js.map +1 -0
  29. package/dist/tools/linear-team-tool.d.ts +3 -0
  30. package/dist/tools/linear-team-tool.d.ts.map +1 -0
  31. package/dist/tools/linear-team-tool.js +64 -0
  32. package/dist/tools/linear-team-tool.js.map +1 -0
  33. package/dist/{queue-tool.d.ts → tools/queue-tool.d.ts} +1 -1
  34. package/dist/tools/queue-tool.d.ts.map +1 -0
  35. package/dist/{queue-tool.js → tools/queue-tool.js} +19 -4
  36. package/dist/tools/queue-tool.js.map +1 -0
  37. package/dist/webhook-handler.d.ts +1 -0
  38. package/dist/webhook-handler.d.ts.map +1 -1
  39. package/dist/webhook-handler.js +1 -0
  40. package/dist/webhook-handler.js.map +1 -1
  41. package/dist/work-queue.d.ts +14 -8
  42. package/dist/work-queue.d.ts.map +1 -1
  43. package/dist/work-queue.js +112 -107
  44. package/dist/work-queue.js.map +1 -1
  45. package/openclaw.plugin.json +11 -1
  46. package/package.json +2 -2
  47. package/skills/linear/SKILL.md +126 -0
  48. package/dist/queue-tool.d.ts.map +0 -1
  49. package/dist/queue-tool.js.map +0 -1
  50. package/skills/linear-queue/SKILL.md +0 -47
package/README.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # openclaw-linear
2
2
 
3
- Linear webhook integration for OpenClaw. Receives Linear events, filters and routes them, and dispatches consolidated notifications to agents.
3
+ Linear integration for [OpenClaw](https://github.com/nichochar/openclaw). Receives Linear webhook events, routes them to agents, and provides tools for managing issues, comments, projects, teams, and relations via the Linear GraphQL API.
4
4
 
5
5
  ## Features
6
6
 
7
7
  - **Webhook handler** — receives Linear webhook events with HMAC signature verification (timing-safe), duplicate delivery detection, and body size limits
8
8
  - **Event router** — filters by team and event type, routes issue assignments and comment mentions to the configured agent
9
9
  - **Debounced dispatch** — batches events within a configurable window before dispatching
10
- - **Work queue** — deterministic queue intake writes structured items to `queue/work-queue.json` with priority sorting, deduplication, and 24h auto-cleanup of completed items — no LLM tokens spent on triage
11
- - **Crash recovery** — resets stale `in_progress` queue items to `pending` on gateway startup
10
+ - **Work queue** — deterministic queue writes structured items with priority sorting, deduplication, and 24h auto-cleanup — no LLM tokens spent on triage
11
+ - **Crash recovery** — resets stale `in_progress` queue items to `pending` on startup
12
+ - **Direct API integration** — all tools call the Linear GraphQL API directly, no external CLI binary required
12
13
 
13
14
  ## Install
14
15
 
@@ -23,23 +24,97 @@ Add the plugin to your OpenClaw config. Each OpenClaw instance runs one agent
23
24
  ```yaml
24
25
  plugins:
25
26
  linear:
26
- webhookSecret: "your-webhook-signing-secret"
27
- agentMapping: # Filter: only handle events for these Linear users
27
+ apiKey: "lin_api_..." # Linear API key (required)
28
+ webhookSecret: "your-signing-secret" # Webhook secret (required)
29
+ agentMapping: # Filter: only handle events for these Linear users
28
30
  "linear-user-uuid": "titus"
29
- teamIds: ["ENG", "OPS"] # Optional: filter to specific teams (empty = all)
30
- eventFilter: ["Issue", "Comment"] # Optional: filter event types (empty = all)
31
- debounceMs: 30000 # Optional: batch window in ms (default: 30000)
31
+ teamIds: ["ENG", "OPS"] # Optional: filter to specific teams (empty = all)
32
+ eventFilter: ["Issue", "Comment"] # Optional: filter event types (empty = all)
33
+ debounceMs: 30000 # Optional: batch window in ms (default: 30000)
34
+ stateActions: # Optional: map state types/names to queue actions
35
+ backlog: "add"
36
+ unstarted: "add"
37
+ started: "ignore"
38
+ "In Review": "remove" # State names override type matches (case-insensitive)
39
+ completed: "remove"
40
+ canceled: "remove"
32
41
  ```
33
42
 
34
43
  ### Config Fields
35
44
 
36
45
  | Field | Type | Required | Description |
37
46
  |-------|------|----------|-------------|
47
+ | `apiKey` | string | **Yes** | Linear API key for authentication. Create one at [linear.app/settings/account/security](https://linear.app/settings/account/security). |
38
48
  | `webhookSecret` | string | **Yes** | Shared secret for HMAC webhook signature verification. |
39
49
  | `agentMapping` | object | No | Maps Linear user UUIDs to agent IDs. Acts as a filter — events for unmapped users are ignored. Since each instance runs one agent, this typically has one entry. |
40
50
  | `teamIds` | string[] | No | Team keys to scope webhook processing. Empty = all teams. |
41
51
  | `eventFilter` | string[] | No | Event types to handle (`Issue`, `Comment`). Empty = all. |
42
- | `debounceMs` | integer | No | Debounce window in milliseconds. Events arriving within this window are batched into a single message. Must be positive. Default: `30000` (30s). |
52
+ | `debounceMs` | integer | No | Debounce window in milliseconds. Events arriving within this window are batched into a single dispatch. Default: `30000` (30s). |
53
+ | `stateActions` | object | No | Maps Linear state types or names to queue actions (`"add"`, `"remove"`, `"ignore"`). See [State Actions](#state-actions). |
54
+
55
+ ## Tools
56
+
57
+ The plugin provides six tools that agents can use to interact with Linear. All tools use an `action` parameter to select the operation.
58
+
59
+ ### `linear_queue` — notification inbox
60
+
61
+ Manage the queue of webhook-driven notifications.
62
+
63
+ | Action | Description |
64
+ |--------|-------------|
65
+ | `peek` | View all pending items sorted by priority |
66
+ | `pop` | Claim the highest-priority pending item |
67
+ | `drain` | Claim all pending items |
68
+ | `complete` | Finish work on a claimed item (requires `issueId`) |
69
+
70
+ ### `linear_issue` — issue management
71
+
72
+ View, search, create, update, and delete Linear issues.
73
+
74
+ | Action | Required | Optional |
75
+ |--------|----------|----------|
76
+ | `view` | `issueId` | — |
77
+ | `list` | — | `state`, `assignee`, `team`, `project`, `limit` |
78
+ | `create` | `title` | `description`, `assignee`, `state`, `priority`, `team`, `project`, `parent`, `labels` |
79
+ | `update` | `issueId` | `title`, `description`, `assignee`, `state`, `priority`, `labels`, `project` |
80
+ | `delete` | `issueId` | — |
81
+
82
+ Issues are referenced by human-readable identifiers (e.g. `ENG-123`). Names are resolved automatically — `assignee` accepts display names or emails, `state` accepts workflow state names, `team` accepts team keys, and `labels` accepts label names.
83
+
84
+ ### `linear_comment` — comments
85
+
86
+ Read, create, and update comments on issues.
87
+
88
+ | Action | Required | Optional |
89
+ |--------|----------|----------|
90
+ | `list` | `issueId` | — |
91
+ | `add` | `issueId`, `body` | `parentCommentId` |
92
+ | `update` | `commentId`, `body` | — |
93
+
94
+ ### `linear_team` — teams and members
95
+
96
+ | Action | Required |
97
+ |--------|----------|
98
+ | `list` | — |
99
+ | `members` | `team` (key, e.g. `ENG`) |
100
+
101
+ ### `linear_project` — projects
102
+
103
+ | Action | Required | Optional |
104
+ |--------|----------|----------|
105
+ | `list` | — | `team`, `status` |
106
+ | `view` | `projectId` | — |
107
+ | `create` | `name` | `team`, `description` |
108
+
109
+ ### `linear_relation` — issue relations
110
+
111
+ | Action | Required |
112
+ |--------|----------|
113
+ | `list` | `issueId` |
114
+ | `add` | `issueId`, `type`, `relatedIssueId` |
115
+ | `delete` | `relationId` |
116
+
117
+ Relation types: `blocks`, `blocked-by`, `related`, `duplicate`.
43
118
 
44
119
  ## Webhook Setup
45
120
 
@@ -65,9 +140,36 @@ plugins:
65
140
  | Issue assigned to mapped user | `wake` | `issue.assigned` |
66
141
  | Issue unassigned from mapped user | `notify` | `issue.unassigned` |
67
142
  | Issue reassigned away from mapped user | `notify` | `issue.reassigned` |
143
+ | Issue state change → `add` action | `wake` | `issue.state_readded` |
144
+ | Issue state change → `remove` action | `notify` | `issue.state_removed` |
68
145
  | @mention in comment (mapped user) | `wake` | `comment.mention` |
69
146
 
70
- `wake` events are enqueued into the debouncer and dispatched to the agent. `notify` events are logged only.
147
+ `wake` events are enqueued into the debouncer and dispatched to the agent. `notify` events write to the queue without waking.
148
+
149
+ ## State Actions
150
+
151
+ When an issue's state changes, the plugin resolves what to do based on the `stateActions` config. This lets you control which state transitions re-add issues to the queue (e.g. bounced back from testing) vs. remove them (e.g. done/canceled) vs. are ignored (e.g. in progress).
152
+
153
+ **Resolution order:** state name match → state type match → built-in default.
154
+
155
+ Linear has 6 fixed state types. Custom state names (e.g. "In Review", "QA") are team-specific but always belong to one of these types.
156
+
157
+ **Built-in defaults** (used when `stateActions` is not configured or a state isn't mapped):
158
+
159
+ | State Type | Default Action |
160
+ |---|---|
161
+ | `triage` | `ignore` |
162
+ | `backlog` | `add` |
163
+ | `unstarted` | `add` |
164
+ | `started` | `ignore` |
165
+ | `completed` | `remove` |
166
+ | `canceled` | `remove` |
167
+
168
+ **Actions:**
169
+
170
+ - `"add"` — re-add the issue to the queue as a ticket and wake the agent
171
+ - `"remove"` — remove the issue's ticket from the queue
172
+ - `"ignore"` — do nothing (default for unmapped states)
71
173
 
72
174
  ## How Dispatch Works
73
175
 
@@ -78,59 +180,34 @@ Linear webhook POST
78
180
  → Event router filters by team/type, matches user via agentMapping
79
181
  → wake actions enqueued into debouncer (keyed by agent ID)
80
182
  → After debounce window expires:
81
- → Notifications parsed and written to queue/work-queue.json (deterministic, no LLM)
82
- → Deduped against existing non-done items — skips agent dispatch if nothing new
83
- → Agent receives minimal message: "3 new Linear notification(s) queued."
183
+ → Notifications written to queue (deterministic, no LLM)
184
+ → Deduped against existing non-done items — skips dispatch if nothing new
185
+ → Agent receives: "3 new Linear notification(s) queued."
186
+ → After agent completes an item, auto-wake continues if items remain
84
187
  ```
85
188
 
86
- ## Work Queue
87
-
88
- The plugin writes structured items to `queue/work-queue.json`:
89
-
90
- ```json
91
- {
92
- "items": [
93
- {
94
- "id": "ENG-42",
95
- "issueId": "ENG-42",
96
- "event": "issue.assigned",
97
- "summary": "Fix login bug",
98
- "status": "pending",
99
- "priority": 1,
100
- "addedAt": "2026-02-14T15:45:00.000Z",
101
- "startedAt": null,
102
- "completedAt": null
103
- }
104
- ]
105
- }
106
- ```
107
-
108
- ### Priority
109
-
110
- | Priority | Event |
111
- |----------|-------|
112
- | 1 | `issue.assigned` |
113
- | 2 | `issue.reassigned` |
114
- | 3 | `comment.mention` |
115
- | 4 | `issue.unassigned` |
116
-
117
- ### Lifecycle
118
-
119
- Items progress through statuses: `pending` → `in_progress` → `done`.
189
+ ## Architecture
120
190
 
121
- - **Deduplication** — keyed by `issueId + event`, only checked against non-done items. Completed items can be re-queued (e.g. re-assignment after completion).
122
- - **Cleanup** — done items older than 24 hours are purged automatically during intake.
123
- - **Recovery** on gateway startup, any `in_progress` items are reset to `pending` to recover from crashes.
191
+ ```text
192
+ src/
193
+ ├── index.ts # Plugin entry point, activation, dispatch logic
194
+ ├── webhook-handler.ts # HMAC verification, body parsing, dedup
195
+ ├── event-router.ts # Event filtering, routing, state action resolution
196
+ ├── linear-api.ts # GraphQL client, name/ID resolution helpers
197
+ ├── work-queue.ts # Persistent JSONL queue with priority sorting
198
+ └── tools/
199
+ ├── queue-tool.ts # linear_queue — notification inbox management
200
+ ├── linear-issue-tool.ts # linear_issue — CRUD for issues
201
+ ├── linear-comment-tool.ts # linear_comment — issue comments
202
+ ├── linear-team-tool.ts # linear_team — teams and members
203
+ ├── linear-project-tool.ts # linear_project — project management
204
+ └── linear-relation-tool.ts # linear_relation — issue relations
205
+ ```
124
206
 
125
207
  ## Development
126
208
 
127
209
  ```bash
128
210
  npm install
129
211
  npm run build
130
-
131
- # Type-check without emitting
132
- npx tsc --noEmit
133
-
134
- # Run tests
135
212
  npm test
136
213
  ```
@@ -6,8 +6,11 @@ export type RouterAction = {
6
6
  detail: string;
7
7
  issueId: string;
8
8
  issueLabel: string;
9
+ identifier: string;
10
+ issuePriority: number;
9
11
  linearUserId: string;
10
12
  };
13
+ export type StateAction = "add" | "remove" | "ignore";
11
14
  export type EventRouterConfig = {
12
15
  agentMapping: Record<string, string>;
13
16
  logger: {
@@ -16,6 +19,9 @@ export type EventRouterConfig = {
16
19
  };
17
20
  eventFilter?: string[];
18
21
  teamIds?: string[];
22
+ stateActions?: Record<string, string>;
19
23
  };
24
+ export declare const DEFAULT_STATE_ACTIONS: Record<string, StateAction>;
25
+ export declare function resolveStateAction(config: EventRouterConfig, stateType: string | undefined, stateName: string | undefined): StateAction;
20
26
  export declare function createEventRouter(config: EventRouterConfig): (event: LinearWebhookPayload) => RouterAction[];
21
27
  //# sourceMappingURL=event-router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-router.d.ts","sourceRoot":"","sources":["../src/event-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IA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E,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAO7D,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,WAAW,CA+Bb;AAmTD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,IACnC,OAAO,oBAAoB,KAAG,YAAY,EAAE,CAmCnE"}
@@ -1,3 +1,39 @@
1
+ export const DEFAULT_STATE_ACTIONS = {
2
+ triage: "ignore",
3
+ backlog: "add",
4
+ unstarted: "add",
5
+ started: "ignore",
6
+ completed: "remove",
7
+ canceled: "remove",
8
+ };
9
+ export function resolveStateAction(config, stateType, stateName) {
10
+ if (config.stateActions) {
11
+ // Build lowercase lookup from config
12
+ const lookup = new Map();
13
+ for (const [key, value] of Object.entries(config.stateActions)) {
14
+ lookup.set(key.toLowerCase(), value);
15
+ }
16
+ // Check state name first (case-insensitive)
17
+ if (stateName) {
18
+ const byName = lookup.get(stateName.toLowerCase());
19
+ if (byName === "add" || byName === "remove" || byName === "ignore") {
20
+ return byName;
21
+ }
22
+ }
23
+ // Check state type
24
+ if (stateType) {
25
+ const byType = lookup.get(stateType.toLowerCase());
26
+ if (byType === "add" || byType === "remove" || byType === "ignore") {
27
+ return byType;
28
+ }
29
+ }
30
+ }
31
+ // Fall back to built-in defaults
32
+ if (stateType && stateType in DEFAULT_STATE_ACTIONS) {
33
+ return DEFAULT_STATE_ACTIONS[stateType];
34
+ }
35
+ return "ignore";
36
+ }
1
37
  /**
2
38
  * Extract mention user IDs from ProseMirror bodyData JSON.
3
39
  * Traverses the document tree looking for "mention" nodes with an `attrs.id`.
@@ -44,64 +80,187 @@ function resolveIssueLabel(data) {
44
80
  return title ? `${label}: ${title}` : label;
45
81
  }
46
82
  function handleIssueUpdate(event, config) {
47
- const changes = event.data.changes;
48
- if (!changes?.assigneeId)
49
- return [];
83
+ const updatedFrom = event.updatedFrom ?? {};
50
84
  const actions = [];
51
- const { from: oldAssignee, to: newAssignee } = changes.assigneeId;
52
85
  const issueId = String(event.data.id ?? "unknown");
53
86
  const issueLabel = resolveIssueLabel(event.data);
54
- if (newAssignee) {
55
- const agentId = config.agentMapping[newAssignee];
56
- if (agentId) {
57
- actions.push({
58
- type: "wake",
59
- agentId,
60
- event: "issue.assigned",
61
- detail: `Assigned to issue ${issueLabel}`,
62
- issueId,
63
- issueLabel,
64
- linearUserId: newAssignee,
65
- });
87
+ const identifier = event.data.identifier ?? issueId;
88
+ const issuePriority = event.data.priority ?? 0;
89
+ // --- Assignee changes ---
90
+ if ("assigneeId" in updatedFrom) {
91
+ const oldAssignee = updatedFrom.assigneeId;
92
+ const newAssignee = event.data.assigneeId;
93
+ if (newAssignee) {
94
+ const agentId = config.agentMapping[newAssignee];
95
+ if (agentId) {
96
+ actions.push({
97
+ type: "wake",
98
+ agentId,
99
+ event: "issue.assigned",
100
+ detail: `Assigned to issue ${issueLabel}`,
101
+ issueId,
102
+ issueLabel,
103
+ identifier,
104
+ issuePriority,
105
+ linearUserId: newAssignee,
106
+ });
107
+ }
108
+ else {
109
+ config.logger.info(`Unmapped Linear user ${newAssignee} assigned to ${issueId}`);
110
+ }
66
111
  }
67
- else {
68
- config.logger.info(`Unmapped Linear user ${newAssignee} assigned to ${issueId}`);
112
+ if (oldAssignee && !newAssignee) {
113
+ const agentId = config.agentMapping[oldAssignee];
114
+ if (agentId) {
115
+ actions.push({
116
+ type: "notify",
117
+ agentId,
118
+ event: "issue.unassigned",
119
+ detail: `Unassigned from issue ${issueLabel}`,
120
+ issueId,
121
+ issueLabel,
122
+ identifier,
123
+ issuePriority,
124
+ linearUserId: oldAssignee,
125
+ });
126
+ }
127
+ else {
128
+ config.logger.info(`Unmapped Linear user ${oldAssignee} unassigned from ${issueId}`);
129
+ }
69
130
  }
70
- }
71
- if (oldAssignee && !newAssignee) {
72
- const agentId = config.agentMapping[oldAssignee];
73
- if (agentId) {
74
- actions.push({
75
- type: "notify",
76
- agentId,
77
- event: "issue.unassigned",
78
- detail: `Unassigned from issue ${issueLabel}`,
79
- issueId,
80
- issueLabel,
81
- linearUserId: oldAssignee,
82
- });
131
+ // Reassignment: both old and new assignee present — notify old assignee
132
+ if (oldAssignee && newAssignee) {
133
+ const agentId = config.agentMapping[oldAssignee];
134
+ if (agentId) {
135
+ actions.push({
136
+ type: "notify",
137
+ agentId,
138
+ event: "issue.reassigned",
139
+ detail: `Reassigned away from issue ${issueLabel}`,
140
+ issueId,
141
+ issueLabel,
142
+ identifier,
143
+ issuePriority,
144
+ linearUserId: oldAssignee,
145
+ });
146
+ }
83
147
  }
84
- else {
85
- config.logger.info(`Unmapped Linear user ${oldAssignee} unassigned from ${issueId}`);
148
+ }
149
+ // --- State changes (configurable per state type/name) ---
150
+ if ("stateId" in updatedFrom) {
151
+ const state = event.data.state;
152
+ const stateType = state?.type;
153
+ const stateName = state?.name;
154
+ const action = resolveStateAction(config, stateType, stateName);
155
+ if (action === "remove" || action === "add") {
156
+ const assigneeId = event.data.assigneeId;
157
+ if (assigneeId) {
158
+ const agentId = config.agentMapping[assigneeId];
159
+ if (agentId) {
160
+ if (action === "remove") {
161
+ actions.push({
162
+ type: "notify",
163
+ agentId,
164
+ event: "issue.state_removed",
165
+ detail: `Issue ${issueLabel} moved to ${stateName ?? stateType ?? "unknown"}`,
166
+ issueId,
167
+ issueLabel,
168
+ identifier,
169
+ issuePriority,
170
+ linearUserId: assigneeId,
171
+ });
172
+ }
173
+ else {
174
+ actions.push({
175
+ type: "wake",
176
+ agentId,
177
+ event: "issue.state_readded",
178
+ detail: `Issue ${issueLabel} moved to ${stateName ?? stateType ?? "unknown"}`,
179
+ issueId,
180
+ issueLabel,
181
+ identifier,
182
+ issuePriority,
183
+ linearUserId: assigneeId,
184
+ });
185
+ }
186
+ }
187
+ }
86
188
  }
87
189
  }
88
- // Reassignment: both old and new assignee present — notify old assignee
89
- if (oldAssignee && newAssignee) {
90
- const agentId = config.agentMapping[oldAssignee];
91
- if (agentId) {
92
- actions.push({
93
- type: "notify",
94
- agentId,
95
- event: "issue.reassigned",
96
- detail: `Reassigned away from issue ${issueLabel}`,
97
- issueId,
98
- issueLabel,
99
- linearUserId: oldAssignee,
100
- });
190
+ // --- Priority changes ---
191
+ if ("priority" in updatedFrom) {
192
+ const assigneeId = event.data.assigneeId;
193
+ if (assigneeId) {
194
+ const agentId = config.agentMapping[assigneeId];
195
+ if (agentId) {
196
+ actions.push({
197
+ type: "notify",
198
+ agentId,
199
+ event: "issue.priority_changed",
200
+ detail: `Priority changed on issue ${issueLabel}`,
201
+ issueId,
202
+ issueLabel,
203
+ identifier,
204
+ issuePriority,
205
+ linearUserId: assigneeId,
206
+ });
207
+ }
101
208
  }
102
209
  }
103
210
  return actions;
104
211
  }
212
+ function handleIssueCreate(event, config) {
213
+ const assigneeId = event.data.assigneeId;
214
+ if (!assigneeId)
215
+ return [];
216
+ const agentId = config.agentMapping[assigneeId];
217
+ if (!agentId) {
218
+ config.logger.info(`Unmapped Linear user ${assigneeId} assigned to ${String(event.data.id ?? "unknown")}`);
219
+ return [];
220
+ }
221
+ const issueId = String(event.data.id ?? "unknown");
222
+ const issueLabel = resolveIssueLabel(event.data);
223
+ const identifier = event.data.identifier ?? issueId;
224
+ const issuePriority = event.data.priority ?? 0;
225
+ return [
226
+ {
227
+ type: "wake",
228
+ agentId,
229
+ event: "issue.assigned",
230
+ detail: `Assigned to issue ${issueLabel}`,
231
+ issueId,
232
+ issueLabel,
233
+ identifier,
234
+ issuePriority,
235
+ linearUserId: assigneeId,
236
+ },
237
+ ];
238
+ }
239
+ function handleIssueRemove(event, config) {
240
+ const assigneeId = event.data.assigneeId;
241
+ if (!assigneeId)
242
+ return [];
243
+ const agentId = config.agentMapping[assigneeId];
244
+ if (!agentId)
245
+ return [];
246
+ const issueId = String(event.data.id ?? "unknown");
247
+ const issueLabel = resolveIssueLabel(event.data);
248
+ const identifier = event.data.identifier ?? issueId;
249
+ const issuePriority = event.data.priority ?? 0;
250
+ return [
251
+ {
252
+ type: "notify",
253
+ agentId,
254
+ event: "issue.removed",
255
+ detail: `Issue ${issueLabel} removed`,
256
+ issueId,
257
+ issueLabel,
258
+ identifier,
259
+ issuePriority,
260
+ linearUserId: assigneeId,
261
+ },
262
+ ];
263
+ }
105
264
  function handleComment(event, config) {
106
265
  const body = event.data.body;
107
266
  if (!body)
@@ -114,6 +273,8 @@ function handleComment(event, config) {
114
273
  const issueLabel = issueRef
115
274
  ? resolveIssueLabel(issueRef)
116
275
  : issueId;
276
+ const identifier = issueRef?.identifier ?? issueId;
277
+ const issuePriority = issueRef?.priority ?? 0;
117
278
  for (const userId of mentionedIds) {
118
279
  const agentId = config.agentMapping[userId];
119
280
  if (agentId) {
@@ -124,6 +285,8 @@ function handleComment(event, config) {
124
285
  detail: `Mentioned in comment on issue ${issueLabel}\n\n> ${body}`,
125
286
  issueId,
126
287
  issueLabel,
288
+ identifier,
289
+ issuePriority,
127
290
  linearUserId: userId,
128
291
  });
129
292
  }
@@ -149,8 +312,13 @@ export function createEventRouter(config) {
149
312
  if (!match && (teamId || teamKey))
150
313
  return [];
151
314
  }
152
- if (event.type === "Issue" && event.action === "update") {
153
- return handleIssueUpdate(event, config);
315
+ if (event.type === "Issue") {
316
+ if (event.action === "update")
317
+ return handleIssueUpdate(event, config);
318
+ if (event.action === "create")
319
+ return handleIssueCreate(event, config);
320
+ if (event.action === "remove")
321
+ return handleIssueRemove(event, config);
154
322
  }
155
323
  if (event.type === "Comment" &&
156
324
  (event.action === "create" || event.action === "update")) {
@@ -1 +1 @@
1
- {"version":3,"file":"event-router.js","sourceRoot":"","sources":["../src/event-router.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,SAAS,8BAA8B,CAAC,IAAa;IACnD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AAG,IAAI,CA8ErD;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAStE;AAED,QAAA,MAAM,MAAM;;;;;;CAYX,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAwBzE,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,CAYzE;AA0FD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAqLrD;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAStE;AAED,QAAA,MAAM,MAAM;;;;;;CAYX,CAAC;AAEF,eAAe,MAAM,CAAC"}