openclaw-linear 0.4.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.
- package/README.md +100 -58
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -3
- package/dist/index.js.map +1 -1
- package/dist/linear-api.d.ts +13 -0
- package/dist/linear-api.d.ts.map +1 -0
- package/dist/linear-api.js +120 -0
- package/dist/linear-api.js.map +1 -0
- package/dist/tools/linear-comment-tool.d.ts +3 -0
- package/dist/tools/linear-comment-tool.d.ts.map +1 -0
- package/dist/tools/linear-comment-tool.js +113 -0
- package/dist/tools/linear-comment-tool.js.map +1 -0
- package/dist/tools/linear-issue-tool.d.ts +3 -0
- package/dist/tools/linear-issue-tool.d.ts.map +1 -0
- package/dist/tools/linear-issue-tool.js +240 -0
- package/dist/tools/linear-issue-tool.js.map +1 -0
- package/dist/tools/linear-project-tool.d.ts +3 -0
- package/dist/tools/linear-project-tool.d.ts.map +1 -0
- package/dist/tools/linear-project-tool.js +126 -0
- package/dist/tools/linear-project-tool.js.map +1 -0
- package/dist/tools/linear-relation-tool.d.ts +3 -0
- package/dist/tools/linear-relation-tool.d.ts.map +1 -0
- package/dist/tools/linear-relation-tool.js +148 -0
- package/dist/tools/linear-relation-tool.js.map +1 -0
- package/dist/tools/linear-team-tool.d.ts +3 -0
- package/dist/tools/linear-team-tool.d.ts.map +1 -0
- package/dist/tools/linear-team-tool.js +64 -0
- package/dist/tools/linear-team-tool.js.map +1 -0
- package/dist/{queue-tool.d.ts → tools/queue-tool.d.ts} +1 -1
- package/dist/tools/queue-tool.d.ts.map +1 -0
- package/dist/{queue-tool.js → tools/queue-tool.js} +19 -4
- package/dist/tools/queue-tool.js.map +1 -0
- package/dist/work-queue.d.ts +8 -3
- package/dist/work-queue.d.ts.map +1 -1
- package/dist/work-queue.js +60 -14
- package/dist/work-queue.js.map +1 -1
- package/openclaw.plugin.json +6 -1
- package/package.json +2 -2
- package/skills/linear/SKILL.md +126 -0
- package/dist/queue-tool.d.ts.map +0 -1
- package/dist/queue-tool.js.map +0 -1
- package/skills/linear-queue/SKILL.md +0 -47
|
@@ -2,20 +2,23 @@ import { Type } from "@sinclair/typebox";
|
|
|
2
2
|
import { jsonResult } from "openclaw/plugin-sdk";
|
|
3
3
|
const QueueAction = Type.Unsafe({
|
|
4
4
|
type: "string",
|
|
5
|
-
enum: ["peek", "pop", "drain"],
|
|
5
|
+
enum: ["peek", "pop", "drain", "complete"],
|
|
6
6
|
description: "peek: view all pending items without removing them. " +
|
|
7
|
-
"pop:
|
|
8
|
-
"drain:
|
|
7
|
+
"pop: claim the highest-priority pending item. " +
|
|
8
|
+
"drain: claim all pending items. " +
|
|
9
|
+
"complete: finish work on an in-progress item (requires issueId).",
|
|
9
10
|
});
|
|
10
11
|
const QueueToolParams = Type.Object({
|
|
11
12
|
action: QueueAction,
|
|
13
|
+
issueId: Type.Optional(Type.String({ description: "Issue ID to complete (required for 'complete' action)." })),
|
|
12
14
|
});
|
|
13
15
|
export function createQueueTool(queue) {
|
|
14
16
|
return {
|
|
15
17
|
name: "linear_queue",
|
|
16
18
|
label: "Linear Queue",
|
|
17
19
|
description: "Manage the Linear notification inbox queue. " +
|
|
18
|
-
"Use 'peek' to see pending items, 'pop' to
|
|
20
|
+
"Use 'peek' to see pending items, 'pop' to claim the next item, 'drain' to claim all items, " +
|
|
21
|
+
"or 'complete' to finish work on a claimed item.",
|
|
19
22
|
parameters: QueueToolParams,
|
|
20
23
|
async execute(_toolCallId, params) {
|
|
21
24
|
switch (params.action) {
|
|
@@ -31,6 +34,18 @@ export function createQueueTool(queue) {
|
|
|
31
34
|
const items = await queue.drain();
|
|
32
35
|
return jsonResult({ count: items.length, items });
|
|
33
36
|
}
|
|
37
|
+
case "complete": {
|
|
38
|
+
if (!params.issueId) {
|
|
39
|
+
return jsonResult({ error: "issueId is required for 'complete' action" });
|
|
40
|
+
}
|
|
41
|
+
const completed = await queue.complete(params.issueId);
|
|
42
|
+
const remaining = await queue.peek();
|
|
43
|
+
return jsonResult({
|
|
44
|
+
completed,
|
|
45
|
+
issueId: params.issueId,
|
|
46
|
+
remaining: remaining.length,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
34
49
|
default:
|
|
35
50
|
return jsonResult({
|
|
36
51
|
error: `Unknown action: ${params.action}`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-tool.js","sourceRoot":"","sources":["../../src/tools/queue-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAwC;IACrE,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC;IAC1C,WAAW,EACT,sDAAsD;QACtD,gDAAgD;QAChD,kCAAkC;QAClC,kEAAkE;CACrE,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,IAAI,CAAC,QAAQ,CACpB,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC,CACvF;CACF,CAAC,CAAC;AAIH,MAAM,UAAU,eAAe,CAAC,KAAiB;IAC/C,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,8CAA8C;YAC9C,6FAA6F;YAC7F,iDAAiD;QACnD,UAAU,EAAE,eAAe;QAC3B,KAAK,CAAC,OAAO,CAAC,WAAmB,EAAE,MAAuB;YACxD,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;gBACtB,KAAK,MAAM,CAAC,CAAC,CAAC;oBACZ,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;oBACjC,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{
|
|
|
5
5
|
summary: string;
|
|
6
6
|
priority: number;
|
|
7
7
|
addedAt: string;
|
|
8
|
+
status: "pending" | "in_progress";
|
|
8
9
|
}
|
|
9
10
|
export declare const QUEUE_EVENT: Record<string, string>;
|
|
10
11
|
export interface EnqueueEntry {
|
|
@@ -23,11 +24,15 @@ export declare class InboxQueue {
|
|
|
23
24
|
constructor(path: string);
|
|
24
25
|
/** Dedup and append entries to the queue. Returns count added. */
|
|
25
26
|
enqueue(entries: EnqueueEntry[]): Promise<number>;
|
|
26
|
-
/** Return
|
|
27
|
+
/** Return pending items sorted by priority (lowest number first). Non-destructive. */
|
|
27
28
|
peek(): Promise<QueueItem[]>;
|
|
28
|
-
/**
|
|
29
|
+
/** Claim the highest-priority pending item (mark as in_progress), or null if none pending. */
|
|
29
30
|
pop(): Promise<QueueItem | null>;
|
|
30
|
-
/**
|
|
31
|
+
/** Claim all pending items (mark as in_progress), return sorted by priority. */
|
|
31
32
|
drain(): Promise<QueueItem[]>;
|
|
33
|
+
/** Remove the in_progress item matching issueId. */
|
|
34
|
+
complete(issueId: string): Promise<boolean>;
|
|
35
|
+
/** Reset all in_progress items back to pending (crash recovery). */
|
|
36
|
+
recover(): Promise<number>;
|
|
32
37
|
}
|
|
33
38
|
//# sourceMappingURL=work-queue.d.ts.map
|
package/dist/work-queue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-queue.d.ts","sourceRoot":"","sources":["../src/work-queue.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"work-queue.d.ts","sourceRoot":"","sources":["../src/work-queue.ts"],"names":[],"mappings":"AAcA,MAA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42
|
continue;
|
|
43
43
|
try {
|
|
44
|
-
|
|
44
|
+
const item = JSON.parse(trimmed);
|
|
45
|
+
if (!item.status)
|
|
46
|
+
item.status = "pending"; // backward compat
|
|
47
|
+
items.push(item);
|
|
45
48
|
}
|
|
46
49
|
catch {
|
|
47
50
|
// skip malformed lines
|
|
@@ -145,6 +148,7 @@ export class InboxQueue {
|
|
|
145
148
|
summary: entry.summary,
|
|
146
149
|
priority: mapPriority(entry.issuePriority),
|
|
147
150
|
addedAt: now,
|
|
151
|
+
status: "pending",
|
|
148
152
|
});
|
|
149
153
|
existingKeys.add(dedupKey);
|
|
150
154
|
}
|
|
@@ -157,43 +161,85 @@ export class InboxQueue {
|
|
|
157
161
|
release();
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
|
-
/** Return
|
|
164
|
+
/** Return pending items sorted by priority (lowest number first). Non-destructive. */
|
|
161
165
|
async peek() {
|
|
162
166
|
const release = await this.mutex.acquire();
|
|
163
167
|
try {
|
|
164
|
-
const items = readJsonl(this.path);
|
|
168
|
+
const items = readJsonl(this.path).filter((i) => i.status === "pending");
|
|
165
169
|
return items.sort((a, b) => a.priority - b.priority || a.addedAt.localeCompare(b.addedAt));
|
|
166
170
|
}
|
|
167
171
|
finally {
|
|
168
172
|
release();
|
|
169
173
|
}
|
|
170
174
|
}
|
|
171
|
-
/**
|
|
175
|
+
/** Claim the highest-priority pending item (mark as in_progress), or null if none pending. */
|
|
172
176
|
async pop() {
|
|
173
177
|
const release = await this.mutex.acquire();
|
|
174
178
|
try {
|
|
175
179
|
const items = readJsonl(this.path);
|
|
176
|
-
|
|
180
|
+
const pending = items
|
|
181
|
+
.filter((i) => i.status === "pending")
|
|
182
|
+
.sort((a, b) => a.priority - b.priority || a.addedAt.localeCompare(b.addedAt));
|
|
183
|
+
if (pending.length === 0)
|
|
177
184
|
return null;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
writeJsonl(this.path,
|
|
181
|
-
return
|
|
185
|
+
const claimed = pending[0];
|
|
186
|
+
claimed.status = "in_progress";
|
|
187
|
+
writeJsonl(this.path, items);
|
|
188
|
+
return claimed;
|
|
182
189
|
}
|
|
183
190
|
finally {
|
|
184
191
|
release();
|
|
185
192
|
}
|
|
186
193
|
}
|
|
187
|
-
/**
|
|
194
|
+
/** Claim all pending items (mark as in_progress), return sorted by priority. */
|
|
188
195
|
async drain() {
|
|
189
196
|
const release = await this.mutex.acquire();
|
|
190
197
|
try {
|
|
191
198
|
const items = readJsonl(this.path);
|
|
192
|
-
|
|
199
|
+
const pending = items.filter((i) => i.status === "pending");
|
|
200
|
+
if (pending.length === 0)
|
|
193
201
|
return [];
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
202
|
+
for (const item of pending) {
|
|
203
|
+
item.status = "in_progress";
|
|
204
|
+
}
|
|
205
|
+
writeJsonl(this.path, items);
|
|
206
|
+
return pending.sort((a, b) => a.priority - b.priority || a.addedAt.localeCompare(b.addedAt));
|
|
207
|
+
}
|
|
208
|
+
finally {
|
|
209
|
+
release();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/** Remove the in_progress item matching issueId. */
|
|
213
|
+
async complete(issueId) {
|
|
214
|
+
const release = await this.mutex.acquire();
|
|
215
|
+
try {
|
|
216
|
+
const items = readJsonl(this.path);
|
|
217
|
+
const idx = items.findIndex((i) => i.issueId === issueId && i.status === "in_progress");
|
|
218
|
+
if (idx === -1)
|
|
219
|
+
return false;
|
|
220
|
+
items.splice(idx, 1);
|
|
221
|
+
writeJsonl(this.path, items);
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
finally {
|
|
225
|
+
release();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/** Reset all in_progress items back to pending (crash recovery). */
|
|
229
|
+
async recover() {
|
|
230
|
+
const release = await this.mutex.acquire();
|
|
231
|
+
try {
|
|
232
|
+
const items = readJsonl(this.path);
|
|
233
|
+
let count = 0;
|
|
234
|
+
for (const item of items) {
|
|
235
|
+
if (item.status === "in_progress") {
|
|
236
|
+
item.status = "pending";
|
|
237
|
+
count++;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (count > 0)
|
|
241
|
+
writeJsonl(this.path, items);
|
|
242
|
+
return count;
|
|
197
243
|
}
|
|
198
244
|
finally {
|
|
199
245
|
release();
|
package/dist/work-queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-queue.js","sourceRoot":"","sources":["../src/work-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"work-queue.js","sourceRoot":"","sources":["../src/work-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,MAAM,CAAC,MAAM,WAAW,GAA2B;IACjD,gBAAgB,EAAE,QAAQ;IAC1B,qBAAqB,EAAE,QAAQ;IAC/B,iBAAiB,EAAE,SAAS;CAC7B,CAAC;AAEF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,qBAAqB;CACtB,CAAC,CAAC;AASH,8DAA8D;AAC9D,SAAS,WAAW,CAAC,cAAsB;IACzC,OAAO,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;AACnD,CAAC;AAED,gBAAgB;AAEhB,MAAM,OAAO,KAAK;IACR,KAAK,G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QACX,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC3C,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,IAAI,IAAI,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;oBAClC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;oBACxB,KAAK,EAAE,CAAC;gBACV,CAAC;YACH,CAAC;YACD,IAAI,KAAK,GAAG,CAAC;gBAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC5C,OAAO,KAAK,CAAC;QACf,CAAC;gBAAS,CAAC;YACT,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF"}
|
package/openclaw.plugin.json
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"properties": {
|
|
10
|
+
"apiKey": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"sensitive": true,
|
|
13
|
+
"description": "Linear API key for authentication (create at linear.app/settings/account/security)"
|
|
14
|
+
},
|
|
10
15
|
"webhookSecret": {
|
|
11
16
|
"type": "string",
|
|
12
17
|
"sensitive": true,
|
|
@@ -37,6 +42,6 @@
|
|
|
37
42
|
"description": "Map Linear state types or names to queue actions. Keys can be state types (triage, backlog, unstarted, started, completed, canceled) or state names (e.g. \"In Review\", \"Todo\"). Name matches take precedence over type matches (case-insensitive). Actions: add (re-add to queue), remove (remove from queue), ignore (do nothing). Defaults: backlog/unstarted=add, completed/canceled=remove, others=ignore."
|
|
38
43
|
}
|
|
39
44
|
},
|
|
40
|
-
"required": ["webhookSecret"]
|
|
45
|
+
"required": ["webhookSecret", "apiKey"]
|
|
41
46
|
}
|
|
42
47
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-linear",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Linear
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Linear integration for OpenClaw — webhook routing, issue management, and project tools via the Linear GraphQL API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: linear
|
|
3
|
+
description: Linear project management integration. Provides tools for processing a notification queue, managing issues, comments, teams, projects, and issue relations via the Linear GraphQL API.
|
|
4
|
+
metadata: { "openclaw": { "always": true } }
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Linear
|
|
8
|
+
|
|
9
|
+
You have Linear tools for managing issues and responding to notifications. These tools call the Linear GraphQL API directly — they handle auth, formatting, and error handling for you.
|
|
10
|
+
|
|
11
|
+
## Tools
|
|
12
|
+
|
|
13
|
+
### `linear_queue` — notification inbox
|
|
14
|
+
|
|
15
|
+
Manages the queue of Linear notifications routed to you by webhooks.
|
|
16
|
+
|
|
17
|
+
| Action | Effect |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `peek` | View all pending items sorted by priority. Non-destructive. |
|
|
20
|
+
| `pop` | Claim the highest-priority pending item (marks it `in_progress`). |
|
|
21
|
+
| `drain` | Claim all pending items (marks them `in_progress`). |
|
|
22
|
+
| `complete` | Finish work on a claimed item (requires `issueId`). Removes it from the queue. |
|
|
23
|
+
|
|
24
|
+
Queue items have this shape:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"id": "TEAM-123",
|
|
29
|
+
"issueId": "TEAM-123",
|
|
30
|
+
"event": "ticket",
|
|
31
|
+
"summary": "Issue title or comment text",
|
|
32
|
+
"priority": 1,
|
|
33
|
+
"status": "pending",
|
|
34
|
+
"addedAt": "ISO timestamp"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Event types:
|
|
39
|
+
|
|
40
|
+
| Event | Meaning |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `ticket` | You have a ticket to work on. |
|
|
43
|
+
| `mention` | You were mentioned in a comment. |
|
|
44
|
+
|
|
45
|
+
Priority maps from the Linear issue (1=Urgent, 2=High, 3=Medium, 4=Low, 5=None). Higher-priority items are popped first.
|
|
46
|
+
|
|
47
|
+
### `linear_issue` — manage issues
|
|
48
|
+
|
|
49
|
+
Manage Linear issues: view details, search/filter, create, update, and delete.
|
|
50
|
+
|
|
51
|
+
| Action | Required Params | Optional Params |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `view` | `issueId` | — |
|
|
54
|
+
| `list` | — | `state`, `assignee`, `team`, `project`, `limit` |
|
|
55
|
+
| `create` | `title` | `description`, `assignee`, `state`, `priority`, `team`, `project`, `parent`, `labels` |
|
|
56
|
+
| `update` | `issueId` | `title`, `description`, `assignee`, `state`, `priority`, `labels`, `project` |
|
|
57
|
+
| `delete` | `issueId` | — |
|
|
58
|
+
|
|
59
|
+
- `issueId` accepts human-readable identifiers like `ENG-123`
|
|
60
|
+
- `assignee` accepts display name or email
|
|
61
|
+
- `state` accepts workflow state name (e.g. `In Progress`, `Done`)
|
|
62
|
+
- `team` accepts team key (e.g. `ENG`)
|
|
63
|
+
- `priority` is numeric: 0=None, 1=Urgent, 2=High, 3=Medium, 4=Low
|
|
64
|
+
- `labels` is an array of label names
|
|
65
|
+
- `parent` accepts a parent issue identifier for creating sub-issues
|
|
66
|
+
|
|
67
|
+
### `linear_comment` — manage comments
|
|
68
|
+
|
|
69
|
+
Read, create, and update comments on Linear issues.
|
|
70
|
+
|
|
71
|
+
| Action | Required Params | Optional Params |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `list` | `issueId` | — |
|
|
74
|
+
| `add` | `issueId`, `body` | `parentCommentId` |
|
|
75
|
+
| `update` | `commentId`, `body` | — |
|
|
76
|
+
|
|
77
|
+
- `body` supports markdown
|
|
78
|
+
- `parentCommentId` threads the comment as a reply
|
|
79
|
+
|
|
80
|
+
### `linear_team` — teams and members
|
|
81
|
+
|
|
82
|
+
View teams and their members.
|
|
83
|
+
|
|
84
|
+
| Action | Required Params | Optional Params |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `list` | — | — |
|
|
87
|
+
| `members` | `team` | — |
|
|
88
|
+
|
|
89
|
+
- `team` is the team key (e.g. `ENG`)
|
|
90
|
+
|
|
91
|
+
### `linear_project` — manage projects
|
|
92
|
+
|
|
93
|
+
List, view, and create Linear projects.
|
|
94
|
+
|
|
95
|
+
| Action | Required Params | Optional Params |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| `list` | — | `team`, `status` |
|
|
98
|
+
| `view` | `projectId` | — |
|
|
99
|
+
| `create` | `name` | `team`, `description` |
|
|
100
|
+
|
|
101
|
+
### `linear_relation` — issue relations
|
|
102
|
+
|
|
103
|
+
Manage relations between Linear issues (blocks, blocked-by, related, duplicate).
|
|
104
|
+
|
|
105
|
+
| Action | Required Params | Optional Params |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| `list` | `issueId` | — |
|
|
108
|
+
| `add` | `issueId`, `type`, `relatedIssueId` | — |
|
|
109
|
+
| `delete` | `relationId` | — |
|
|
110
|
+
|
|
111
|
+
- `type` is one of: `blocks`, `blocked-by`, `related`, `duplicate`
|
|
112
|
+
|
|
113
|
+
## Processing workflow
|
|
114
|
+
|
|
115
|
+
When you receive a Linear notification:
|
|
116
|
+
|
|
117
|
+
1. **Peek** with `linear_queue { action: "peek" }` to see all pending items.
|
|
118
|
+
2. **Skip** if there are no items.
|
|
119
|
+
3. **Pop** the next item with `linear_queue { action: "pop" }`. This claims it (status becomes `in_progress`).
|
|
120
|
+
4. **Read** the issue with `linear_issue { action: "view", issueId: "<id>" }`.
|
|
121
|
+
5. **Read comments** with `linear_comment { action: "list", issueId: "<id>" }` if the event is a mention or you need discussion context.
|
|
122
|
+
6. **Act** on the item:
|
|
123
|
+
- `ticket` — do the work, then update state with `linear_issue { action: "update", ... }`.
|
|
124
|
+
- `mention` — read the thread and reply with `linear_comment { action: "add", ... }`.
|
|
125
|
+
7. **Complete** with `linear_queue { action: "complete", issueId: "<id>" }` to remove it from the queue.
|
|
126
|
+
8. **Repeat** from step 3 until pop returns null.
|
package/dist/queue-tool.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue-tool.d.ts","sourceRoot":"","sources":["../src/queue-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAiBlD,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,CA6B/D"}
|
package/dist/queue-tool.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue-tool.js","sourceRoot":"","sources":["../src/queue-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAA2B;IACxD,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;IAC9B,WAAW,EACT,sDAAsD;QACtD,oDAAoD;QACpD,qCAAqC;CACxC,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,WAAW;CACpB,CAAC,CAAC;AAIH,MAAM,UAAU,eAAe,CAAC,KAAiB;IAC/C,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,8CAA8C;YAC9C,6FAA6F;QAC/F,UAAU,EAAE,eAAe;QAC3B,KAAK,CAAC,OAAO,CAAC,WAAmB,EAAE,MAAuB;YACxD,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;gBACtB,KAAK,MAAM,CAAC,CAAC,CAAC;oBACZ,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;oBACjC,OAAO,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;gBACpD,CAAC;gBACD,KAAK,KAAK,CAAC,CAAC,CAAC;oBACX,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC;oBAC/B,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAC;gBACjF,CAAC;gBACD,KAAK,OAAO,CAAC,CAAC,CAAC;oBACb,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;oBAClC,OAAO,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;gBACpD,CAAC;gBACD;oBACE,OAAO,UAAU,CAAC;wBAChB,KAAK,EAAE,mBAAoB,MAA6B,CAAC,MAAM,EAAE;qBAClE,CAAC,CAAC;YACP,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: linear-queue
|
|
3
|
-
description: Work queue processing for Linear notifications. Guides the agent through reading, prioritizing, and completing queued Linear items.
|
|
4
|
-
metadata: { "openclaw": { "always": true } }
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Linear Work Queue
|
|
8
|
-
|
|
9
|
-
You have a `linear_queue` tool for managing Linear notifications that need your attention. The tool is the source of truth — don't parse raw notification messages yourself.
|
|
10
|
-
|
|
11
|
-
## Tool actions
|
|
12
|
-
|
|
13
|
-
| Action | Effect |
|
|
14
|
-
|---|---|
|
|
15
|
-
| `peek` | View all pending items sorted by priority. Non-destructive. |
|
|
16
|
-
| `pop` | Remove and return the highest-priority item. |
|
|
17
|
-
| `drain` | Remove and return all items sorted by priority. |
|
|
18
|
-
|
|
19
|
-
## Queue item structure
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"id": "TEAM-123",
|
|
24
|
-
"issueId": "TEAM-123",
|
|
25
|
-
"event": "ticket",
|
|
26
|
-
"summary": "Issue title or comment text",
|
|
27
|
-
"priority": 1,
|
|
28
|
-
"addedAt": "ISO timestamp"
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Event types and expected actions
|
|
33
|
-
|
|
34
|
-
| Event | Action |
|
|
35
|
-
|---|---|
|
|
36
|
-
| `ticket` | You have a ticket to work on. Read issue details and begin work. |
|
|
37
|
-
| `mention` | You were mentioned in a comment. Read and respond. |
|
|
38
|
-
|
|
39
|
-
Priority is determined by the Linear issue's priority (1=Urgent, 2=High, 3=Medium, 4=Low, 5=None). Higher-priority items are popped first.
|
|
40
|
-
|
|
41
|
-
## Processing workflow
|
|
42
|
-
|
|
43
|
-
1. **Peek** the queue with `linear_queue { action: "peek" }` to see all pending items.
|
|
44
|
-
2. **Skip** if there are no items.
|
|
45
|
-
3. **Pop** the next item with `linear_queue { action: "pop" }`.
|
|
46
|
-
4. **Act**: use the Linear tools (list-issues, update-issue, add-comment) to handle the item per the event type table above.
|
|
47
|
-
5. **Repeat** from step 3 until pop returns null.
|