@calltelemetry/openclaw-linear 0.3.0 → 0.3.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 +42 -4
- package/package.json +1 -1
- package/src/tools.ts +6 -6
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ Webhook-driven Linear integration with OAuth support, multi-agent routing, and a
|
|
|
4
4
|
|
|
5
5
|
## What It Does
|
|
6
6
|
|
|
7
|
+
- **Auto-triage** — New issues are automatically estimated (story points), labeled, and prioritized with a posted assessment
|
|
7
8
|
- **Issue triage** — When an issue is assigned/delegated to the app user, an agent estimates story points, applies labels, and posts an assessment
|
|
8
9
|
- **Agent sessions** — Full plan-approve-implement-audit pipeline triggered from Linear's agent UI
|
|
9
10
|
- **@mention routing** — Comment mentions like `@qa` or `@infra` route to specific role-based agents with different expertise
|
|
@@ -21,6 +22,42 @@ That's it — the plugin is installed and enabled. Continue with the [setup step
|
|
|
21
22
|
|
|
22
23
|
> To install from a local checkout instead: `openclaw plugins install --link /path/to/linear`
|
|
23
24
|
|
|
25
|
+
## First Run
|
|
26
|
+
|
|
27
|
+
After installing, the plugin loads but **will not process any webhooks or agent tools until you authenticate**. You'll see this in the logs:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Linear agent extension registered (agent: default, token: missing)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This is normal — the plugin does not crash without auth. It registers all routes and CLI commands, but webhook handlers and tools will return errors until a token is available.
|
|
34
|
+
|
|
35
|
+
To authenticate:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Set your OAuth app credentials
|
|
39
|
+
export LINEAR_CLIENT_ID="your_client_id"
|
|
40
|
+
export LINEAR_CLIENT_SECRET="your_client_secret"
|
|
41
|
+
|
|
42
|
+
# Run the OAuth flow
|
|
43
|
+
openclaw openclaw-linear auth
|
|
44
|
+
|
|
45
|
+
# Verify
|
|
46
|
+
openclaw openclaw-linear status
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The auth flow stores tokens in `~/.openclaw/auth-profiles.json`. This file is created automatically — you do not need to create it manually. After auth, restart the gateway:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
openclaw gateway restart
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
You should now see `token: profile` in the logs:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
Linear agent extension registered (agent: default, token: profile)
|
|
59
|
+
```
|
|
60
|
+
|
|
24
61
|
## Prerequisites
|
|
25
62
|
|
|
26
63
|
- OpenClaw gateway running (systemd service)
|
|
@@ -185,7 +222,7 @@ If you prefer to manage config by hand, add the plugin path to `~/.openclaw/open
|
|
|
185
222
|
"paths": ["/path/to/linear"]
|
|
186
223
|
},
|
|
187
224
|
"entries": {
|
|
188
|
-
"linear": {
|
|
225
|
+
"openclaw-linear": {
|
|
189
226
|
"enabled": true
|
|
190
227
|
}
|
|
191
228
|
}
|
|
@@ -203,7 +240,7 @@ There are two ways to authorize the plugin with Linear.
|
|
|
203
240
|
#### Option A: CLI Flow (Recommended)
|
|
204
241
|
|
|
205
242
|
```bash
|
|
206
|
-
openclaw
|
|
243
|
+
openclaw openclaw-linear auth
|
|
207
244
|
```
|
|
208
245
|
|
|
209
246
|
This launches the OAuth flow interactively:
|
|
@@ -395,6 +432,7 @@ POST /linear/webhook
|
|
|
395
432
|
+-- AgentSessionEvent.prompted --> Resume pipeline (user approved plan)
|
|
396
433
|
+-- AppUserNotification --> Direct agent response to mention/assignment
|
|
397
434
|
+-- Comment.create --> Route @mention to role-based agent
|
|
435
|
+
+-- Issue.create --> Auto-triage new issues (estimate, labels, priority)
|
|
398
436
|
+-- Issue.update --> Triage if assigned/delegated to app user
|
|
399
437
|
```
|
|
400
438
|
|
|
@@ -449,7 +487,7 @@ Optional settings in `openclaw.json` under the plugin entry:
|
|
|
449
487
|
{
|
|
450
488
|
"plugins": {
|
|
451
489
|
"entries": {
|
|
452
|
-
"linear": {
|
|
490
|
+
"openclaw-linear": {
|
|
453
491
|
"enabled": true,
|
|
454
492
|
"clientId": "...",
|
|
455
493
|
"clientSecret": "...",
|
|
@@ -519,7 +557,7 @@ openclaw logs | grep -i "linear\|plugin\|error"
|
|
|
519
557
|
**Agent sessions not working:**
|
|
520
558
|
- OAuth tokens require `app:assignable` and `app:mentionable` scopes
|
|
521
559
|
- Personal API keys cannot create agent sessions — use OAuth
|
|
522
|
-
- Re-run `openclaw
|
|
560
|
+
- Re-run `openclaw openclaw-linear auth` to get fresh tokens
|
|
523
561
|
|
|
524
562
|
**"No defaultAgentId" error:**
|
|
525
563
|
- Set `defaultAgentId` in plugin config, OR
|
package/package.json
CHANGED
package/src/tools.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { AnyAgentTool, OpenClawPluginApi, OpenClawPluginToolContext } from "openclaw/plugin-sdk";
|
|
2
2
|
import { jsonResult } from "openclaw/plugin-sdk";
|
|
3
3
|
import { LinearClient } from "./client.js";
|
|
4
|
+
import { resolveLinearToken } from "./linear-api.js";
|
|
4
5
|
|
|
5
6
|
export function createLinearTools(api: OpenClawPluginApi, ctx: OpenClawPluginToolContext): AnyAgentTool[] {
|
|
6
7
|
const getClient = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
throw new Error("Linear access token not found. Please authenticate first.");
|
|
8
|
+
const pluginConfig = (api as any).pluginConfig as Record<string, unknown> | undefined;
|
|
9
|
+
const resolved = resolveLinearToken(pluginConfig);
|
|
10
|
+
if (!resolved.accessToken) {
|
|
11
|
+
throw new Error("Linear access token not found. Run 'openclaw openclaw-linear auth' to authenticate.");
|
|
12
12
|
}
|
|
13
|
-
return new LinearClient(
|
|
13
|
+
return new LinearClient(resolved.accessToken);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
return [
|