cyrus-core 0.0.1 → 0.0.3

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/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { Session } from './Session.js';
2
2
  export type { SessionOptions, Issue, Workspace, NarrativeItem } from './Session.js';
3
3
  export { SessionManager } from './SessionManager.js';
4
+ export type { LinearWebhookTeam, LinearWebhookIssue, LinearWebhookComment, LinearWebhookActor, LinearWebhookNotification, LinearIssueAssignedNotification, LinearIssueCommentMentionNotification, LinearIssueNewCommentNotification, LinearIssueUnassignedNotification, LinearWebhook, LinearIssueAssignedWebhook, LinearIssueCommentMentionWebhook, LinearIssueNewCommentWebhook, LinearIssueUnassignedWebhook } from './webhook-types.js';
5
+ export { isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueUnassignedWebhook } from './webhook-types.js';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGpD,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,+BAA+B,EAC/B,qCAAqC,EACrC,iCAAiC,EACjC,iCAAiC,EACjC,aAAa,EACb,0BAA0B,EAC1B,gCAAgC,EAChC,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,oBAAoB,CAAA"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { Session } from './Session.js';
2
2
  export { SessionManager } from './SessionManager.js';
3
+ export { isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueUnassignedWebhook } from './webhook-types.js';
3
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAoBpD,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Linear webhook types based on actual webhook payloads
3
+ * These are the exact structures Linear sends in webhooks
4
+ */
5
+ /**
6
+ * Linear team data from webhooks
7
+ */
8
+ export interface LinearWebhookTeam {
9
+ id: string;
10
+ key: string;
11
+ name: string;
12
+ }
13
+ /**
14
+ * Linear issue data from webhooks
15
+ */
16
+ export interface LinearWebhookIssue {
17
+ id: string;
18
+ title: string;
19
+ teamId: string;
20
+ team: LinearWebhookTeam;
21
+ identifier: string;
22
+ url: string;
23
+ }
24
+ /**
25
+ * Linear comment data from webhooks
26
+ */
27
+ export interface LinearWebhookComment {
28
+ id: string;
29
+ body: string;
30
+ userId: string;
31
+ issueId: string;
32
+ }
33
+ /**
34
+ * Linear actor (user) data from webhooks
35
+ */
36
+ export interface LinearWebhookActor {
37
+ id: string;
38
+ name: string;
39
+ email: string;
40
+ url: string;
41
+ }
42
+ /**
43
+ * Base notification structure common to all webhook notifications
44
+ */
45
+ export interface LinearWebhookNotificationBase {
46
+ id: string;
47
+ createdAt: string;
48
+ updatedAt: string;
49
+ archivedAt: string | null;
50
+ actorId: string;
51
+ externalUserActorId: string | null;
52
+ userId: string;
53
+ issueId: string;
54
+ issue: LinearWebhookIssue;
55
+ actor: LinearWebhookActor;
56
+ }
57
+ /**
58
+ * Issue assignment notification
59
+ */
60
+ export interface LinearIssueAssignedNotification extends LinearWebhookNotificationBase {
61
+ type: 'issueAssignedToYou';
62
+ }
63
+ /**
64
+ * Issue comment mention notification
65
+ */
66
+ export interface LinearIssueCommentMentionNotification extends LinearWebhookNotificationBase {
67
+ type: 'issueCommentMention';
68
+ commentId: string;
69
+ comment: LinearWebhookComment;
70
+ }
71
+ /**
72
+ * Issue new comment notification (can have parent comment for replies)
73
+ */
74
+ export interface LinearIssueNewCommentNotification extends LinearWebhookNotificationBase {
75
+ type: 'issueNewComment';
76
+ commentId: string;
77
+ comment: LinearWebhookComment;
78
+ parentCommentId?: string;
79
+ parentComment?: LinearWebhookComment;
80
+ }
81
+ /**
82
+ * Issue unassignment notification
83
+ */
84
+ export interface LinearIssueUnassignedNotification extends LinearWebhookNotificationBase {
85
+ type: 'issueUnassignedFromYou';
86
+ actorId: string;
87
+ externalUserActorId: string | null;
88
+ userId: string;
89
+ issueId: string;
90
+ issue: LinearWebhookIssue;
91
+ actor: LinearWebhookActor;
92
+ }
93
+ /**
94
+ * Union of all notification types
95
+ */
96
+ export type LinearWebhookNotification = LinearIssueAssignedNotification | LinearIssueCommentMentionNotification | LinearIssueNewCommentNotification | LinearIssueUnassignedNotification;
97
+ /**
98
+ * Issue assignment webhook payload
99
+ */
100
+ export interface LinearIssueAssignedWebhook {
101
+ type: 'AppUserNotification';
102
+ action: 'issueAssignedToYou';
103
+ createdAt: string;
104
+ organizationId: string;
105
+ oauthClientId: string;
106
+ appUserId: string;
107
+ notification: LinearIssueAssignedNotification;
108
+ webhookTimestamp: number;
109
+ webhookId: string;
110
+ }
111
+ /**
112
+ * Issue comment mention webhook payload
113
+ */
114
+ export interface LinearIssueCommentMentionWebhook {
115
+ type: 'AppUserNotification';
116
+ action: 'issueCommentMention';
117
+ createdAt: string;
118
+ organizationId: string;
119
+ oauthClientId: string;
120
+ appUserId: string;
121
+ notification: LinearIssueCommentMentionNotification;
122
+ webhookTimestamp: number;
123
+ webhookId: string;
124
+ }
125
+ /**
126
+ * Issue new comment webhook payload
127
+ */
128
+ export interface LinearIssueNewCommentWebhook {
129
+ type: 'AppUserNotification';
130
+ action: 'issueNewComment';
131
+ createdAt: string;
132
+ organizationId: string;
133
+ oauthClientId: string;
134
+ appUserId: string;
135
+ notification: LinearIssueNewCommentNotification;
136
+ webhookTimestamp: number;
137
+ webhookId: string;
138
+ }
139
+ /**
140
+ * Issue unassignment webhook payload
141
+ */
142
+ export interface LinearIssueUnassignedWebhook {
143
+ type: 'AppUserNotification';
144
+ action: 'issueUnassignedFromYou';
145
+ createdAt: string;
146
+ organizationId: string;
147
+ oauthClientId: string;
148
+ appUserId: string;
149
+ notification: LinearIssueUnassignedNotification;
150
+ webhookTimestamp: number;
151
+ webhookId: string;
152
+ }
153
+ /**
154
+ * Union of all webhook types we handle
155
+ */
156
+ export type LinearWebhook = LinearIssueAssignedWebhook | LinearIssueCommentMentionWebhook | LinearIssueNewCommentWebhook | LinearIssueUnassignedWebhook;
157
+ /**
158
+ * Type guards for webhook discrimination
159
+ */
160
+ export declare function isIssueAssignedWebhook(webhook: LinearWebhook): webhook is LinearIssueAssignedWebhook;
161
+ export declare function isIssueCommentMentionWebhook(webhook: LinearWebhook): webhook is LinearIssueCommentMentionWebhook;
162
+ export declare function isIssueNewCommentWebhook(webhook: LinearWebhook): webhook is LinearIssueNewCommentWebhook;
163
+ export declare function isIssueUnassignedWebhook(webhook: LinearWebhook): webhook is LinearIssueUnassignedWebhook;
164
+ //# 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;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,iBAAiB,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,MAAM,EAAE,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AO,IAAI,0BAA0B,CAEpG;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,IAAI,gCAAgC,CAEhH;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,IAAI,4BAA4B,CAExG;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,IAAI,4BAA4B,CAExG"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Linear webhook types based on actual webhook payloads
3
+ * These are the exact structures Linear sends in webhooks
4
+ */
5
+ /**
6
+ * Type guards for webhook discrimination
7
+ */
8
+ export function isIssueAssignedWebhook(webhook) {
9
+ return webhook.action === 'issueAssignedToYou';
10
+ }
11
+ export function isIssueCommentMentionWebhook(webhook) {
12
+ return webhook.action === 'issueCommentMention';
13
+ }
14
+ export function isIssueNewCommentWebhook(webhook) {
15
+ return webhook.action === 'issueNewComment';
16
+ }
17
+ export function isIssueUnassignedWebhook(webhook) {
18
+ return webhook.action === 'issueUnassignedFromYou';
19
+ }
20
+ //# sourceMappingURL=webhook-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-types.js","sourceRoot":"","sources":["../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiLH;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAsB;IAC3D,OAAO,OAAO,CAAC,MAAM,KAAK,oBAAoB,CAAA;AAChD,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAAsB;IACjE,OAAO,OAAO,CAAC,MAAM,KAAK,qBAAqB,CAAA;AACjD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAsB;IAC7D,OAAO,OAAO,CAAC,MAAM,KAAK,iBAAiB,CAAA;AAC7C,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAsB;IAC7D,OAAO,OAAO,CAAC,MAAM,KAAK,wBAAwB,CAAA;AACpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyrus-core",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Core business logic for Cyrus",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",