@supaku/agentfactory-linear 0.1.2 → 0.3.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.
@@ -12,4 +12,5 @@ export { parseCheckboxes, updateCheckbox, updateCheckboxByText, updateCheckboxes
12
12
  export type { CheckboxItem, CheckboxUpdate } from './checkbox-utils';
13
13
  export { LinearAgentClient, createLinearAgentClient } from './agent-client';
14
14
  export { AgentSession, createAgentSession } from './agent-session';
15
+ export * from './webhook-types';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,aAAa,EAEb,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EAEpB,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAGvD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,oBAAoB,EACpB,KAAK,EACL,cAAc,EACd,SAAS,EACT,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAChB,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG5E,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,uBAAuB,GACxB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGvD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,SAAS,CAAA;AAChB,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,OAAO,EACL,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGpE,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAG3E,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,E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BAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,SAAS,CAAA;AAChB,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,OAAO,EACL,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGpE,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAG3E,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGlE,cAAc,iBAAiB,CAAA"}
package/dist/src/index.js CHANGED
@@ -14,3 +14,5 @@ export { parseCheckboxes, updateCheckbox, updateCheckboxByText, updateCheckboxes
14
14
  export { LinearAgentClient, createLinearAgentClient } from './agent-client';
15
15
  // Session
16
16
  export { AgentSession, createAgentSession } from './agent-session';
17
+ // Webhook types
18
+ export * from './webhook-types';
@@ -0,0 +1,308 @@
1
+ /**
2
+ * Linear Webhook Payload Types
3
+ *
4
+ * Types for processing Linear webhook events, including:
5
+ * - AgentSession events (created, prompted, updated, removed)
6
+ * - Issue update events
7
+ *
8
+ * @see https://linear.app/developers/webhooks
9
+ * @see https://linear.app/developers/agent-interaction
10
+ */
11
+ import type { AgentActivitySignal } from './types';
12
+ /**
13
+ * Standard webhook action types for most Linear resources
14
+ */
15
+ export type WebhookAction = 'create' | 'update' | 'remove';
16
+ /**
17
+ * AgentSession-specific webhook action types
18
+ * Note: Linear sends past-tense actions (created, updated, removed)
19
+ * - created: New session initiated by user mention or delegation
20
+ * - prompted: User sent a follow-up message to an existing session
21
+ * - updated: Session state changed
22
+ * - removed: Session was deleted
23
+ */
24
+ export type AgentSessionAction = 'created' | 'prompted' | 'updated' | 'removed';
25
+ /**
26
+ * User who initiated or is responsible for the session
27
+ */
28
+ export interface WebhookUser {
29
+ id: string;
30
+ name: string;
31
+ email?: string;
32
+ displayName?: string;
33
+ avatarUrl?: string;
34
+ }
35
+ /**
36
+ * Comment data included in webhook payloads
37
+ */
38
+ export interface WebhookComment {
39
+ id: string;
40
+ body: string;
41
+ createdAt: string;
42
+ user?: WebhookUser;
43
+ parentId?: string;
44
+ }
45
+ /**
46
+ * Issue data included in webhook payloads
47
+ */
48
+ export interface WebhookIssue {
49
+ id: string;
50
+ identifier: string;
51
+ title: string;
52
+ description?: string;
53
+ url: string;
54
+ state?: {
55
+ id: string;
56
+ name: string;
57
+ type: string;
58
+ };
59
+ team?: {
60
+ id: string;
61
+ name: string;
62
+ key: string;
63
+ };
64
+ labels?: Array<{
65
+ id: string;
66
+ name: string;
67
+ color?: string;
68
+ }>;
69
+ project?: {
70
+ id: string;
71
+ name: string;
72
+ };
73
+ parent?: {
74
+ id: string;
75
+ identifier: string;
76
+ title: string;
77
+ };
78
+ }
79
+ /**
80
+ * Base Linear webhook payload
81
+ * All webhook events contain these common fields
82
+ */
83
+ export interface LinearWebhookPayload {
84
+ /** The action that triggered this webhook */
85
+ action: WebhookAction | AgentSessionAction;
86
+ /** The type of resource this webhook is for */
87
+ type: string;
88
+ /** The resource data */
89
+ data: Record<string, unknown>;
90
+ /** URL to the resource in Linear */
91
+ url?: string;
92
+ /** ISO timestamp when the event occurred */
93
+ createdAt: string;
94
+ /** ID of the organization this webhook belongs to */
95
+ organizationId?: string;
96
+ /** Unix timestamp when the webhook was sent */
97
+ webhookTimestamp?: number;
98
+ /** Unique ID for this webhook delivery */
99
+ webhookId?: string;
100
+ }
101
+ /**
102
+ * AgentSession state values in webhook payloads.
103
+ *
104
+ * Named `LinearSessionState` to distinguish from:
105
+ * - `AgentSessionState` (Linear Agent SDK states: pending, active, error, awaitingInput, complete)
106
+ * - `AgentSessionStatus` (Redis session tracking states)
107
+ */
108
+ export type LinearSessionState = 'created' | 'running' | 'completed' | 'failed';
109
+ /**
110
+ * Base AgentSession data common to all session events
111
+ */
112
+ export interface AgentSessionData {
113
+ /** Unique session ID */
114
+ id: string;
115
+ /** ID of the issue this session is working on */
116
+ issueId: string;
117
+ /** ID of the agent assigned to this session */
118
+ agentId: string;
119
+ /** Current state of the session */
120
+ state: LinearSessionState;
121
+ /** External URL for the agent's work (e.g., PR link) */
122
+ externalUrl?: string;
123
+ /** Allow additional unknown fields from webhook payload */
124
+ [key: string]: unknown;
125
+ }
126
+ /**
127
+ * Extended AgentSession data for 'create' events
128
+ * Includes context needed to start working on an issue
129
+ */
130
+ export interface AgentSessionCreatedData extends AgentSessionData {
131
+ /**
132
+ * Formatted prompt string containing relevant context for the agent session.
133
+ * Includes issue details, comments, and guidance.
134
+ * Present only for 'create' events.
135
+ */
136
+ promptContext?: string;
137
+ /**
138
+ * Previous comments in the thread before this agent was mentioned.
139
+ * Present only for 'create' events where the session was initiated
140
+ * by mentioning the agent in a child comment of a thread.
141
+ */
142
+ previousComments?: WebhookComment[];
143
+ /**
144
+ * Guidance to inform the agent's behavior.
145
+ * Comes from configuration at workspace, parent teams, and/or current team.
146
+ * The nearest team-specific guidance takes highest precedence.
147
+ */
148
+ guidance?: string;
149
+ /**
150
+ * The human user responsible for initiating this session.
151
+ * Unset if the session was initiated via automation or by an agent user.
152
+ */
153
+ user?: WebhookUser;
154
+ /**
155
+ * Full issue data for the session
156
+ */
157
+ issue?: WebhookIssue;
158
+ /**
159
+ * The comment that triggered this session (if initiated via comment mention)
160
+ */
161
+ comment?: WebhookComment;
162
+ }
163
+ /**
164
+ * Agent activity included in prompted webhooks
165
+ * This can indicate special signals like 'stop' from the user
166
+ */
167
+ export interface WebhookAgentActivity {
168
+ /** The type of activity */
169
+ type?: string;
170
+ /** Signal modifier for the activity */
171
+ signal?: AgentActivitySignal;
172
+ /** Activity content/body */
173
+ body?: string;
174
+ }
175
+ /**
176
+ * Extended AgentSession data for 'prompted' events
177
+ * Includes the follow-up message from the user
178
+ */
179
+ export interface AgentSessionPromptedData extends AgentSessionData {
180
+ /**
181
+ * The follow-up prompt/message from the user.
182
+ * Present when user sends a message to an existing session.
183
+ */
184
+ promptContext?: string;
185
+ /**
186
+ * The user who sent the follow-up message
187
+ */
188
+ user?: WebhookUser;
189
+ /**
190
+ * The comment containing the follow-up message
191
+ */
192
+ comment?: WebhookComment;
193
+ /**
194
+ * Agent activity associated with this prompt.
195
+ * May contain a 'stop' signal if the user clicked Stop.
196
+ * @see https://linear.app/developers/agent-signals
197
+ */
198
+ agentActivity?: WebhookAgentActivity;
199
+ }
200
+ /**
201
+ * AgentSession data for 'update' events
202
+ */
203
+ export interface AgentSessionUpdatedData extends AgentSessionData {
204
+ /** Previous values before the update */
205
+ updatedFrom?: {
206
+ state?: LinearSessionState;
207
+ externalUrl?: string;
208
+ };
209
+ }
210
+ /**
211
+ * Webhook payload for AgentSession 'created' events
212
+ * Triggered when a new agent session is initiated by mention or delegation
213
+ */
214
+ export interface AgentSessionCreatedPayload extends LinearWebhookPayload {
215
+ type: 'AgentSessionEvent';
216
+ action: 'created';
217
+ data: AgentSessionCreatedData;
218
+ }
219
+ /**
220
+ * Webhook payload for AgentSession 'prompted' events
221
+ * Triggered when a user sends a follow-up message to an existing session
222
+ */
223
+ export interface AgentSessionPromptedPayload extends LinearWebhookPayload {
224
+ type: 'AgentSessionEvent';
225
+ action: 'prompted';
226
+ data: AgentSessionPromptedData;
227
+ }
228
+ /**
229
+ * Webhook payload for AgentSession 'updated' events
230
+ * Triggered when session state changes
231
+ */
232
+ export interface AgentSessionUpdatedPayload extends LinearWebhookPayload {
233
+ type: 'AgentSessionEvent';
234
+ action: 'updated';
235
+ data: AgentSessionUpdatedData;
236
+ }
237
+ /**
238
+ * Webhook payload for AgentSession 'removed' events
239
+ * Triggered when a session is deleted
240
+ */
241
+ export interface AgentSessionRemovedPayload extends LinearWebhookPayload {
242
+ type: 'AgentSessionEvent';
243
+ action: 'removed';
244
+ data: AgentSessionData;
245
+ }
246
+ /**
247
+ * Union type for all AgentSession webhook payloads
248
+ */
249
+ export type AgentSessionPayload = AgentSessionCreatedPayload | AgentSessionPromptedPayload | AgentSessionUpdatedPayload | AgentSessionRemovedPayload;
250
+ /**
251
+ * Type guard to check if a payload is an AgentSession event
252
+ */
253
+ export declare function isAgentSessionPayload(payload: LinearWebhookPayload): payload is AgentSessionPayload;
254
+ /**
255
+ * Type guard for AgentSession 'created' events
256
+ */
257
+ export declare function isAgentSessionCreated(payload: LinearWebhookPayload): payload is AgentSessionCreatedPayload;
258
+ /**
259
+ * Type guard for AgentSession 'prompted' events (follow-up messages)
260
+ */
261
+ export declare function isAgentSessionPrompted(payload: LinearWebhookPayload): payload is AgentSessionPromptedPayload;
262
+ /**
263
+ * Type guard for AgentSession 'updated' events
264
+ */
265
+ export declare function isAgentSessionUpdated(payload: LinearWebhookPayload): payload is AgentSessionUpdatedPayload;
266
+ /**
267
+ * Type guard for AgentSession 'removed' events
268
+ */
269
+ export declare function isAgentSessionRemoved(payload: LinearWebhookPayload): payload is AgentSessionRemovedPayload;
270
+ /**
271
+ * Issue state information in webhook payloads
272
+ */
273
+ export interface WebhookIssueState {
274
+ id: string;
275
+ name: string;
276
+ type: string;
277
+ }
278
+ /**
279
+ * Extended issue data for Issue update webhooks
280
+ */
281
+ export interface IssueUpdateData extends WebhookIssue {
282
+ state: WebhookIssueState;
283
+ assignee?: WebhookUser;
284
+ /** Allow additional unknown fields */
285
+ [key: string]: unknown;
286
+ }
287
+ /**
288
+ * Webhook payload for Issue update events
289
+ * @see https://linear.app/developers/webhooks
290
+ */
291
+ export interface IssueUpdatePayload extends LinearWebhookPayload {
292
+ type: 'Issue';
293
+ action: 'update';
294
+ data: IssueUpdateData;
295
+ /** Previous values before the update */
296
+ updatedFrom: {
297
+ stateId?: string;
298
+ assigneeId?: string;
299
+ [key: string]: unknown;
300
+ };
301
+ /** The actor who made the change */
302
+ actor?: WebhookUser;
303
+ }
304
+ /**
305
+ * Type guard for Issue update events
306
+ */
307
+ export declare function isIssueUpdate(payload: LinearWebhookPayload): payload is IssueUpdatePayload;
308
+ //# sourceMappingURL=webhook-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-types.d.ts","sourceRoot":"","sources":["../../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAMlD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE1D;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAA;AAE/E;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE;QACN,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;KACZ,CAA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KAAK,EAAE,iBAAiB,CAAA;IACxB,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB,sCAAsC;IACtC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,QAAQ,CAAA;IAChB,IAAI,EAAE,eAAe,CAAA;IACrB,wCAAwC;IACxC,WAAW,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACvB,CAAA;IACD,oCAAoC;IACpC,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,IAAI,kBAAkB,CAE/B"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Linear Webhook Payload Types
3
+ *
4
+ * Types for processing Linear webhook events, including:
5
+ * - AgentSession events (created, prompted, updated, removed)
6
+ * - Issue update events
7
+ *
8
+ * @see https://linear.app/developers/webhooks
9
+ * @see https://linear.app/developers/agent-interaction
10
+ */
11
+ /**
12
+ * Type guard to check if a payload is an AgentSession event
13
+ */
14
+ export function isAgentSessionPayload(payload) {
15
+ return payload.type === 'AgentSessionEvent';
16
+ }
17
+ /**
18
+ * Type guard for AgentSession 'created' events
19
+ */
20
+ export function isAgentSessionCreated(payload) {
21
+ return payload.type === 'AgentSessionEvent' && payload.action === 'created';
22
+ }
23
+ /**
24
+ * Type guard for AgentSession 'prompted' events (follow-up messages)
25
+ */
26
+ export function isAgentSessionPrompted(payload) {
27
+ return payload.type === 'AgentSessionEvent' && payload.action === 'prompted';
28
+ }
29
+ /**
30
+ * Type guard for AgentSession 'updated' events
31
+ */
32
+ export function isAgentSessionUpdated(payload) {
33
+ return payload.type === 'AgentSessionEvent' && payload.action === 'updated';
34
+ }
35
+ /**
36
+ * Type guard for AgentSession 'removed' events
37
+ */
38
+ export function isAgentSessionRemoved(payload) {
39
+ return payload.type === 'AgentSessionEvent' && payload.action === 'removed';
40
+ }
41
+ /**
42
+ * Type guard for Issue update events
43
+ */
44
+ export function isIssueUpdate(payload) {
45
+ return payload.type === 'Issue' && payload.action === 'update';
46
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supaku/agentfactory-linear",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Linear issue tracker integration for AgentFactory — status transitions, agent sessions, work routing",
6
6
  "author": "Supaku (https://supaku.com)",