cyrus-core 0.0.5 → 0.0.6-alpha.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.
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Agent Session types for Linear Agent Sessions integration
3
+ * These types represent the core data structures for tracking Claude Code sessions in Linear
4
+ */
5
+ import { LinearDocument } from "@linear/sdk";
6
+ import { ClaudeRunner } from "cyrus-claude-runner";
7
+ export interface IssueMinimal {
8
+ id: string;
9
+ identifier: string;
10
+ title: string;
11
+ description?: string;
12
+ branchName: string;
13
+ }
14
+ export interface Workspace {
15
+ path: string;
16
+ isGitWorktree: boolean;
17
+ historyPath?: string;
18
+ }
19
+ export interface CyrusAgentSession {
20
+ linearAgentActivitySessionId: string;
21
+ type: LinearDocument.AgentSessionType.CommentThread;
22
+ status: LinearDocument.AgentSessionStatus;
23
+ context: LinearDocument.AgentSessionType.CommentThread;
24
+ createdAt: number;
25
+ updatedAt: number;
26
+ issueId: string;
27
+ issue: IssueMinimal;
28
+ workspace: Workspace;
29
+ claudeSessionId?: string;
30
+ claudeRunner?: ClaudeRunner;
31
+ metadata?: {
32
+ model?: string;
33
+ tools?: string[];
34
+ permissionMode?: string;
35
+ apiKeySource?: string;
36
+ totalCostUsd?: number;
37
+ usage?: any;
38
+ commentId?: string;
39
+ };
40
+ }
41
+ export interface CyrusAgentSessionEntry {
42
+ claudeSessionId: string;
43
+ linearAgentActivityId?: string;
44
+ type: 'user' | 'assistant' | 'system' | 'result';
45
+ content: string;
46
+ metadata?: {
47
+ toolUseId?: string;
48
+ toolName?: string;
49
+ toolInput?: any;
50
+ parentToolUseId?: string;
51
+ timestamp: number;
52
+ durationMs?: number;
53
+ isError?: boolean;
54
+ };
55
+ }
56
+ //# sourceMappingURL=CyrusAgentSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CyrusAgentSession.d.ts","sourceRoot":"","sources":["../src/CyrusAgentSession.ts"],"names":[],"mappings":"A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C,EAAE,MAAM,CAAA;IAC9B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAChD,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,SAAS,CAAC,EAAE,GAAG,CAAA;QACf,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,SAAS,EAAE,MAAM,CAAA;QACjB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;CACF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Agent Session types for Linear Agent Sessions integration
3
+ * These types represent the core data structures for tracking Claude Code sessions in Linear
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=CyrusAgentSession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CyrusAgentSession.js","sourceRoot":"","sources":["../src/CyrusAgentSession.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,58 @@
1
+ import type { CyrusAgentSession, CyrusAgentSessionEntry } from './CyrusAgentSession.js';
2
+ export type SerializedCyrusAgentSession = CyrusAgentSession;
3
+ export type SerializedCyrusAgentSessionEntry = CyrusAgentSessionEntry;
4
+ /**
5
+ * Serializable EdgeWorker state for persistence
6
+ */
7
+ export interface SerializableEdgeWorkerState {
8
+ agentSessions?: Record<string, Record<string, SerializedCyrusAgentSession>>;
9
+ agentSessionEntries?: Record<string, Record<string, SerializedCyrusAgentSessionEntry[]>>;
10
+ }
11
+ /**
12
+ * Manages persistence of critical mappings to survive restarts
13
+ */
14
+ export declare class PersistenceManager {
15
+ private persistencePath;
16
+ constructor(persistencePath?: string);
17
+ /**
18
+ * Get the full path to the single EdgeWorker state file
19
+ */
20
+ private getEdgeWorkerStateFilePath;
21
+ /**
22
+ * Ensure the persistence directory exists
23
+ */
24
+ private ensurePersistenceDirectory;
25
+ /**
26
+ * Save EdgeWorker state to disk (single file for all repositories)
27
+ */
28
+ saveEdgeWorkerState(state: SerializableEdgeWorkerState): Promise<void>;
29
+ /**
30
+ * Load EdgeWorker state from disk (single file for all repositories)
31
+ */
32
+ loadEdgeWorkerState(): Promise<SerializableEdgeWorkerState | null>;
33
+ /**
34
+ * Check if EdgeWorker state file exists
35
+ */
36
+ hasStateFile(): boolean;
37
+ /**
38
+ * Delete EdgeWorker state file
39
+ */
40
+ deleteStateFile(): Promise<void>;
41
+ /**
42
+ * Convert Map to Record for serialization
43
+ */
44
+ static mapToRecord<T>(map: Map<string, T>): Record<string, T>;
45
+ /**
46
+ * Convert Record to Map for deserialization
47
+ */
48
+ static recordToMap<T>(record: Record<string, T>): Map<string, T>;
49
+ /**
50
+ * Convert Set to Array for serialization
51
+ */
52
+ static setToArray<T>(set: Set<T>): T[];
53
+ /**
54
+ * Convert Array to Set for deserialization
55
+ */
56
+ static arrayToSet<T>(array: T[]): Set<T>;
57
+ }
58
+ //# sourceMappingURL=PersistenceManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersistenceManager.d.ts","sourceRoot":"","sources":["../src/PersistenceManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAG,MAAM,wBAAwB,CAAA;AAIxF,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAA;AAM3D,MAAM,MAAM,gCAAgC,GAAG,sBAAsB,CAAA;AAOrE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAE1C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC,CAAA;IAC3E,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gCAAgC,EAAE,CAAC,CAAC,CAAA;CACzF;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,eAAe,CAAQ;gBAEnB,eAAe,CAAC,EAAE,MAAM;IAIpC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAIlC;;OAEG;YACW,0BAA0B;IAIxC;;OAEG;IACG,mBAAmB,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB5E;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC;IAsBxE;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAWtC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAI7D;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAIhE;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;IAItC;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;CAGzC"}
@@ -0,0 +1,111 @@
1
+ import { readFile, writeFile, mkdir } from 'fs/promises';
2
+ import { join } from 'path';
3
+ import { homedir } from 'os';
4
+ import { existsSync } from 'fs';
5
+ /**
6
+ * Manages persistence of critical mappings to survive restarts
7
+ */
8
+ export class PersistenceManager {
9
+ persistencePath;
10
+ constructor(persistencePath) {
11
+ this.persistencePath = persistencePath || join(homedir(), '.cyrus', 'state');
12
+ }
13
+ /**
14
+ * Get the full path to the single EdgeWorker state file
15
+ */
16
+ getEdgeWorkerStateFilePath() {
17
+ return join(this.persistencePath, 'edge-worker-state.json');
18
+ }
19
+ /**
20
+ * Ensure the persistence directory exists
21
+ */
22
+ async ensurePersistenceDirectory() {
23
+ await mkdir(this.persistencePath, { recursive: true });
24
+ }
25
+ /**
26
+ * Save EdgeWorker state to disk (single file for all repositories)
27
+ */
28
+ async saveEdgeWorkerState(state) {
29
+ try {
30
+ await this.ensurePersistenceDirectory();
31
+ const stateFile = this.getEdgeWorkerStateFilePath();
32
+ const stateData = {
33
+ version: '2.0',
34
+ savedAt: new Date().toISOString(),
35
+ state
36
+ };
37
+ await writeFile(stateFile, JSON.stringify(stateData, null, 2), 'utf8');
38
+ }
39
+ catch (error) {
40
+ console.error(`Failed to save EdgeWorker state:`, error);
41
+ throw error;
42
+ }
43
+ }
44
+ /**
45
+ * Load EdgeWorker state from disk (single file for all repositories)
46
+ */
47
+ async loadEdgeWorkerState() {
48
+ try {
49
+ const stateFile = this.getEdgeWorkerStateFilePath();
50
+ if (!existsSync(stateFile)) {
51
+ return null;
52
+ }
53
+ const stateData = JSON.parse(await readFile(stateFile, 'utf8'));
54
+ // Validate state structure
55
+ if (!stateData.state || stateData.version !== '2.0') {
56
+ console.warn(`Invalid or outdated state file, ignoring`);
57
+ return null;
58
+ }
59
+ return stateData.state;
60
+ }
61
+ catch (error) {
62
+ console.error(`Failed to load EdgeWorker state:`, error);
63
+ return null;
64
+ }
65
+ }
66
+ /**
67
+ * Check if EdgeWorker state file exists
68
+ */
69
+ hasStateFile() {
70
+ return existsSync(this.getEdgeWorkerStateFilePath());
71
+ }
72
+ /**
73
+ * Delete EdgeWorker state file
74
+ */
75
+ async deleteStateFile() {
76
+ try {
77
+ const stateFile = this.getEdgeWorkerStateFilePath();
78
+ if (existsSync(stateFile)) {
79
+ await writeFile(stateFile, '', 'utf8'); // Clear file instead of deleting
80
+ }
81
+ }
82
+ catch (error) {
83
+ console.error(`Failed to delete EdgeWorker state file:`, error);
84
+ }
85
+ }
86
+ /**
87
+ * Convert Map to Record for serialization
88
+ */
89
+ static mapToRecord(map) {
90
+ return Object.fromEntries(map.entries());
91
+ }
92
+ /**
93
+ * Convert Record to Map for deserialization
94
+ */
95
+ static recordToMap(record) {
96
+ return new Map(Object.entries(record));
97
+ }
98
+ /**
99
+ * Convert Set to Array for serialization
100
+ */
101
+ static setToArray(set) {
102
+ return Array.from(set);
103
+ }
104
+ /**
105
+ * Convert Array to Set for deserialization
106
+ */
107
+ static arrayToSet(array) {
108
+ return new Set(array);
109
+ }
110
+ }
111
+ //# sourceMappingURL=PersistenceManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersistenceManager.js","sourceRoot":"","sources":["../src/PersistenceManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAA;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AA2B/B;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACrB,eAAe,CAAQ;IAE/B,YAAY,eAAwB;QAClC,IAAI,CAAC,eAAe,GAAG,eAAe,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC9E,CAAC;IAED;;OAEG;IACK,0BAA0B;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAA;IAC7D,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,0BAA0B;QACtC,MAAM,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACxD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CAAC,KAAkC;QAC1D,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,0BAA0B,EAAE,CAAA;YACvC,MAAM,SAAS,GAAG,IAAI,CAAC,0B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I,CAAC;YACH,MAAM,SAAS,GAAG,IAAI,CAAC,0BAA0B,EAAE,CAAA;YACnD,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC1B,MAAM,SAAS,CAAC,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA,CAAC,iCAAiC;YAC1E,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW,CAAI,GAAmB;QACvC,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;IAC1C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW,CAAI,MAAyB;QAC7C,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IACxC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAI,GAAW;QAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAI,KAAU;QAC7B,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { Session } from './Session.js';
2
- export type { SessionOptions, Issue, Workspace, NarrativeItem } from './Session.js';
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';
1
+ export { PersistenceManager } from './PersistenceManager.js';
2
+ export type { SerializedCyrusAgentSession, SerializedCyrusAgentSessionEntry, SerializableEdgeWorkerState } from './PersistenceManager.js';
3
+ export type { CyrusAgentSession, CyrusAgentSessionEntry, IssueMinimal, Workspace } from './CyrusAgentSession.js';
4
+ export type { LinearWebhookTeam, LinearWebhookIssue, LinearWebhookComment, LinearWebhookActor, LinearWebhookNotification, LinearIssueAssignedNotification, LinearIssueCommentMentionNotification, LinearIssueNewCommentNotification, LinearIssueUnassignedNotification, LinearWebhookCreator, LinearWebhookAgentSession, LinearWebhookAgentActivity, LinearWebhookAgentActivityContent, LinearWebhook, LinearIssueAssignedWebhook, LinearIssueCommentMentionWebhook, LinearIssueNewCommentWebhook, LinearIssueUnassignedWebhook, LinearAgentSessionCreatedWebhook, LinearAgentSessionPromptedWebhook } from './webhook-types.js';
5
+ export { isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueUnassignedWebhook, isAgentSessionCreatedWebhook, isAgentSessionPromptedWebhook } from './webhook-types.js';
6
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;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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,YAAY,EAAE,2BAA2B,EAAE,gCAAgC,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AACzI,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGhH,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,+BAA+B,EAC/B,qCAAqC,EACrC,iCAAiC,EACjC,iCAAiC,EACjC,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,iCAAiC,EACjC,aAAa,EACb,0BAA0B,EAC1B,gCAAgC,EAChC,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,oBAAoB,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
- export { Session } from './Session.js';
2
- export { SessionManager } from './SessionManager.js';
3
- export { isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueUnassignedWebhook } from './webhook-types.js';
1
+ // export { Session } from './Session.js'
2
+ // export type { SessionOptions, , NarrativeItem } from './Session.js'
3
+ // export { ClaudeSessionManager as SessionManager } from './ClaudeSessionManager.js'
4
+ export { PersistenceManager } from './PersistenceManager.js';
5
+ export { isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueUnassignedWebhook, isAgentSessionCreatedWebhook, isAgentSessionPromptedWebhook } from './webhook-types.js';
4
6
  //# 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;AAoBpD,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,sEAAsE;AACtE,qFAAqF;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AA4B5D,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,oBAAoB,CAAA"}
@@ -150,10 +150,92 @@ export interface LinearIssueUnassignedWebhook {
150
150
  webhookTimestamp: number;
151
151
  webhookId: string;
152
152
  }
153
+ /**
154
+ * Creator data in agent session webhooks
155
+ */
156
+ export interface LinearWebhookCreator {
157
+ id: string;
158
+ name: string;
159
+ email: string;
160
+ avatarUrl: string;
161
+ url: string;
162
+ }
163
+ /**
164
+ * Agent Session data from webhooks
165
+ */
166
+ export interface LinearWebhookAgentSession {
167
+ id: string;
168
+ createdAt: string;
169
+ updatedAt: string;
170
+ archivedAt: string | null;
171
+ creatorId: string;
172
+ appUserId: string;
173
+ commentId: string;
174
+ issueId: string;
175
+ status: 'pending' | 'active' | 'error' | 'awaiting-input' | 'complete';
176
+ startedAt: string | null;
177
+ endedAt: string | null;
178
+ type: 'commentThread';
179
+ summary: string | null;
180
+ sourceMetadata: any | null;
181
+ organizationId: string;
182
+ creator: LinearWebhookCreator;
183
+ comment: LinearWebhookComment;
184
+ issue: LinearWebhookIssue;
185
+ }
186
+ /**
187
+ * Agent Activity content types
188
+ */
189
+ export interface LinearWebhookAgentActivityContent {
190
+ type: 'prompt' | 'observation' | 'action' | 'error' | 'elicitation' | 'response';
191
+ body: string;
192
+ }
193
+ /**
194
+ * Agent Activity data from webhooks
195
+ */
196
+ export interface LinearWebhookAgentActivity {
197
+ id: string;
198
+ createdAt: string;
199
+ updatedAt: string;
200
+ archivedAt: string | null;
201
+ agentContextId: string | null;
202
+ agentSessionId: string;
203
+ sourceCommentId: string;
204
+ content: LinearWebhookAgentActivityContent;
205
+ }
206
+ /**
207
+ * Agent Session created webhook payload
208
+ */
209
+ export interface LinearAgentSessionCreatedWebhook {
210
+ type: 'AgentSessionEvent';
211
+ action: 'created';
212
+ createdAt: string;
213
+ organizationId: string;
214
+ oauthClientId: string;
215
+ appUserId: string;
216
+ agentSession: LinearWebhookAgentSession;
217
+ webhookTimestamp: string;
218
+ webhookId: string;
219
+ }
220
+ /**
221
+ * Agent Session prompted webhook payload
222
+ */
223
+ export interface LinearAgentSessionPromptedWebhook {
224
+ type: 'AgentSessionEvent';
225
+ action: 'prompted';
226
+ createdAt: string;
227
+ organizationId: string;
228
+ oauthClientId: string;
229
+ appUserId: string;
230
+ agentSession: LinearWebhookAgentSession;
231
+ agentActivity: LinearWebhookAgentActivity;
232
+ webhookTimestamp: string;
233
+ webhookId: string;
234
+ }
153
235
  /**
154
236
  * Union of all webhook types we handle
155
237
  */
156
- export type LinearWebhook = LinearIssueAssignedWebhook | LinearIssueCommentMentionWebhook | LinearIssueNewCommentWebhook | LinearIssueUnassignedWebhook;
238
+ export type LinearWebhook = LinearIssueAssignedWebhook | LinearIssueCommentMentionWebhook | LinearIssueNewCommentWebhook | LinearIssueUnassignedWebhook | LinearAgentSessionCreatedWebhook | LinearAgentSessionPromptedWebhook;
157
239
  /**
158
240
  * Type guards for webhook discrimination
159
241
  */
@@ -161,4 +243,6 @@ export declare function isIssueAssignedWebhook(webhook: LinearWebhook): webhook
161
243
  export declare function isIssueCommentMentionWebhook(webhook: LinearWebhook): webhook is LinearIssueCommentMentionWebhook;
162
244
  export declare function isIssueNewCommentWebhook(webhook: LinearWebhook): webhook is LinearIssueNewCommentWebhook;
163
245
  export declare function isIssueUnassignedWebhook(webhook: LinearWebhook): webhook is LinearIssueUnassignedWebhook;
246
+ export declare function isAgentSessionCreatedWebhook(webhook: LinearWebhook): webhook is LinearAgentSessionCreatedWebhook;
247
+ export declare function isAgentSessionPromptedWebhook(webhook: LinearWebhook): webhook is LinearAgentSessionPromptedWebhook;
164
248
  //# sourceMappingURL=webhook-types.d.ts.map
@@ -1 +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,M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AAI,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;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,IAAI,gCAAgC,CAEhH;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,IAAI,iCAAiC,CAElH"}
@@ -17,4 +17,10 @@ export function isIssueNewCommentWebhook(webhook) {
17
17
  export function isIssueUnassignedWebhook(webhook) {
18
18
  return webhook.action === 'issueUnassignedFromYou';
19
19
  }
20
+ export function isAgentSessionCreatedWebhook(webhook) {
21
+ return webhook.type === 'AgentSessionEvent' && webhook.action === 'created';
22
+ }
23
+ export function isAgentSessionPromptedWebhook(webhook) {
24
+ return webhook.type === 'AgentSessionEvent' && webhook.action === 'prompted';
25
+ }
20
26
  //# sourceMappingURL=webhook-types.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"webhook-types.js","sourceRoot":"","sources":["../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2QH;;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;AAED,MAAM,UAAU,4BAA4B,CAAC,OAAsB;IACjE,OAAO,OAAO,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,CAAA;AAC7E,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,OAAsB;IAClE,OAAO,OAAO,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU,CAAA;AAC9E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyrus-core",
3
- "version": "0.0.5",
3
+ "version": "0.0.6-alpha.0",
4
4
  "description": "Core business logic for Cyrus",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,10 @@
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
- "dependencies": {},
11
+ "dependencies": {
12
+ "@linear/sdk": "^52.0.0",
13
+ "cyrus-claude-runner": "0.0.13-alpha.0"
14
+ },
12
15
  "devDependencies": {
13
16
  "@types/node": "^20.0.0",
14
17
  "typescript": "^5.3.3",
package/dist/Session.d.ts DELETED
@@ -1,94 +0,0 @@
1
- import type { ChildProcess } from 'child_process';
2
- export interface Issue {
3
- id: string;
4
- identifier: string;
5
- title: string;
6
- description?: string;
7
- getBranchName(): string;
8
- }
9
- export interface Workspace {
10
- path: string;
11
- isGitWorktree: boolean;
12
- historyPath?: string;
13
- }
14
- export interface SessionOptions {
15
- issue: Issue;
16
- workspace: Workspace;
17
- process?: ChildProcess | null;
18
- startedAt?: Date | string;
19
- exitCode?: number | null;
20
- exitedAt?: Date | string | null;
21
- stderrContent?: string;
22
- lastAssistantResponse?: string;
23
- lastCommentId?: string | null;
24
- conversationContext?: any;
25
- agentRootCommentId?: string | null;
26
- currentParentId?: string | null;
27
- streamingCommentId?: string | null;
28
- streamingSynthesis?: string | null;
29
- streamingNarrative?: NarrativeItem[];
30
- }
31
- export interface NarrativeItem {
32
- type: 'text' | 'tool_call';
33
- content?: string;
34
- tool?: string;
35
- timestamp: number;
36
- }
37
- /**
38
- * Represents a Claude session for an issue
39
- */
40
- export declare class Session {
41
- issue: Issue;
42
- workspace: Workspace;
43
- process: ChildProcess | null;
44
- startedAt: Date;
45
- exitCode: number | null;
46
- exitedAt: Date | null;
47
- stderrContent: string;
48
- lastAssistantResponse: string;
49
- lastCommentId: string | null;
50
- conversationContext: any;
51
- agentRootCommentId: string | null;
52
- currentParentId: string | null;
53
- streamingCommentId: string | null;
54
- streamingSynthesis: string | null;
55
- streamingNarrative: NarrativeItem[];
56
- constructor({ issue, workspace, process, startedAt, exitCode, exitedAt, stderrContent, lastAssistantResponse, lastCommentId, conversationContext, agentRootCommentId, currentParentId, streamingCommentId, streamingSynthesis, streamingNarrative, }: SessionOptions);
57
- /**
58
- * Check if this session is currently active
59
- */
60
- isActive(): boolean;
61
- /**
62
- * Check if this session has exited successfully
63
- */
64
- hasExitedSuccessfully(): boolean;
65
- /**
66
- * Check if this session has exited with an error
67
- */
68
- hasExitedWithError(): boolean;
69
- /**
70
- * Format an error message for posting to Linear
71
- */
72
- formatErrorMessage(): string;
73
- /**
74
- * Add a tool call to the narrative
75
- */
76
- addToolCall(toolName: string): void;
77
- /**
78
- * Add a text snippet to the narrative
79
- */
80
- addTextSnippet(text: string): void;
81
- /**
82
- * Extract a short preview from text content
83
- */
84
- private extractTextPreview;
85
- /**
86
- * Update the streaming synthesis based on chronological narrative
87
- */
88
- updateStreamingSynthesis(): void;
89
- /**
90
- * Reset streaming state for a new run
91
- */
92
- resetStreamingState(): void;
93
- }
94
- //# sourceMappingURL=Session.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,IAAI,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,OAAO,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,mBAAmB,CAAC,EAAE,GAAG,CAAA;IACzB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,kBAAkB,CAAC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AAkB,IAAI,OAAO;IAI7B;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAY5B;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IASnC;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAUlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;OAEG;IACH,wBAAwB,IAAI,IAAI;IA2DhC;;OAEG;IACH,mBAAmB,IAAI,IAAI;CAI5B"}
package/dist/Session.js DELETED
@@ -1,166 +0,0 @@
1
- /**
2
- * Represents a Claude session for an issue
3
- */
4
- export class Session {
5
- issue;
6
- workspace;
7
- process;
8
- startedAt;
9
- exitCode;
10
- exitedAt;
11
- stderrContent;
12
- lastAssistantResponse;
13
- lastCommentId;
14
- conversationContext;
15
- agentRootCommentId;
16
- currentParentId;
17
- streamingCommentId;
18
- streamingSynthesis;
19
- streamingNarrative;
20
- constructor({ issue, workspace, process = null, startedAt = new Date(), exitCode = null, exitedAt = null, stderrContent = '', lastAssistantResponse = '', lastCommentId = null, conversationContext = null, agentRootCommentId = null, currentParentId = null, streamingCommentId = null, streamingSynthesis = null, streamingNarrative = [], }) {
21
- this.issue = issue;
22
- this.workspace = workspace;
23
- this.process = process;
24
- this.startedAt = startedAt instanceof Date ? startedAt : new Date(startedAt);
25
- this.exitCode = exitCode;
26
- this.exitedAt = exitedAt instanceof Date ? exitedAt : exitedAt ? new Date(exitedAt) : null;
27
- this.stderrContent = stderrContent;
28
- this.lastAssistantResponse = lastAssistantResponse;
29
- this.lastCommentId = lastCommentId;
30
- this.conversationContext = conversationContext;
31
- this.agentRootCommentId = agentRootCommentId;
32
- this.currentParentId = currentParentId;
33
- this.streamingCommentId = streamingCommentId;
34
- this.streamingSynthesis = streamingSynthesis;
35
- this.streamingNarrative = streamingNarrative;
36
- }
37
- /**
38
- * Check if this session is currently active
39
- */
40
- isActive() {
41
- return this.process !== null && !this.process.killed && this.exitCode === null;
42
- }
43
- /**
44
- * Check if this session has exited successfully
45
- */
46
- hasExitedSuccessfully() {
47
- return this.exitCode === 0;
48
- }
49
- /**
50
- * Check if this session has exited with an error
51
- */
52
- hasExitedWithError() {
53
- return this.exitCode !== null && this.exitCode !== 0;
54
- }
55
- /**
56
- * Format an error message for posting to Linear
57
- */
58
- formatErrorMessage() {
59
- let errorMessage = `Claude process for issue ${this.issue.identifier} exited unexpectedly with code ${this.exitCode}.`;
60
- if (this.stderrContent) {
61
- errorMessage += `\n\n**Error details (stderr):**\n\`\`\`\n${this.stderrContent.substring(0, 1500)} ${this.stderrContent.length > 1500 ? '... (truncated)' : ''}\n\`\`\``;
62
- }
63
- return errorMessage;
64
- }
65
- /**
66
- * Add a tool call to the narrative
67
- */
68
- addToolCall(toolName) {
69
- this.streamingNarrative.push({
70
- type: 'tool_call',
71
- tool: toolName,
72
- timestamp: Date.now()
73
- });
74
- this.updateStreamingSynthesis();
75
- }
76
- /**
77
- * Add a text snippet to the narrative
78
- */
79
- addTextSnippet(text) {
80
- this.streamingNarrative.push({
81
- type: 'text',
82
- content: text,
83
- timestamp: Date.now()
84
- });
85
- this.updateStreamingSynthesis();
86
- }
87
- /**
88
- * Extract a short preview from text content
89
- */
90
- extractTextPreview(text) {
91
- if (!text || typeof text !== 'string')
92
- return '';
93
- // Remove extra whitespace and newlines
94
- const cleaned = text.replace(/\s+/g, ' ').trim();
95
- // Return first meaningful sentence or truncate at reasonable length
96
- const firstSentence = cleaned.match(/^[^.!?]*[.!?]/);
97
- if (firstSentence && firstSentence[0].length <= 100) {
98
- return firstSentence[0];
99
- }
100
- // Truncate to reasonable length
101
- return cleaned.length > 80 ? cleaned.substring(0, 77) + '...' : cleaned;
102
- }
103
- /**
104
- * Update the streaming synthesis based on chronological narrative
105
- */
106
- updateStreamingSynthesis() {
107
- const entries = [];
108
- // Process all narrative items chronologically
109
- let i = 0;
110
- while (i < this.streamingNarrative.length) {
111
- const item = this.streamingNarrative[i];
112
- if (!item) {
113
- i++;
114
- continue;
115
- }
116
- if (item.type === 'text' && item.content) {
117
- // Extract preview and add as entry
118
- const preview = this.extractTextPreview(item.content);
119
- if (preview) {
120
- entries.push(preview);
121
- }
122
- i++;
123
- }
124
- else if (item.type === 'tool_call') {
125
- // Collect all consecutive tool calls
126
- const consecutiveTools = [];
127
- let j = i;
128
- while (j < this.streamingNarrative.length) {
129
- const narrativeItem = this.streamingNarrative[j];
130
- if (!narrativeItem || narrativeItem.type !== 'tool_call') {
131
- break;
132
- }
133
- const toolName = narrativeItem.tool;
134
- if (toolName && !consecutiveTools.includes(toolName)) {
135
- consecutiveTools.push(toolName);
136
- }
137
- j++;
138
- }
139
- // Add grouped tool call summary
140
- const toolCount = consecutiveTools.length;
141
- const toolList = consecutiveTools.join(', ');
142
- entries.push(`${toolCount} tool call${toolCount > 1 ? 's' : ''}: ${toolList}`);
143
- // Move index to the next non-tool-call item
144
- i = j;
145
- }
146
- else {
147
- i++;
148
- }
149
- }
150
- // Build chronological synthesis showing all entries
151
- const synthesis = ['Getting to work...'];
152
- // Add all entries (don't truncate to show complete chronology)
153
- for (const entry of entries) {
154
- synthesis.push(entry);
155
- }
156
- this.streamingSynthesis = synthesis.join('\n\n');
157
- }
158
- /**
159
- * Reset streaming state for a new run
160
- */
161
- resetStreamingState() {
162
- this.streamingNarrative = [];
163
- this.streamingSynthesis = 'Getting to work...';
164
- }
165
- }
166
- //# sourceMappingURL=Session.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":"AAyCA;;GAEG;AACH,MAAM,OAAO,OAAO;IAClB,KAAK,CAAO;IACZ,SAAS,CAAW;IACpB,OAAO,CAAqB;IAC5B,SAAS,CAAM;IACf,QAAQ,CAAe;IACvB,QAAQ,CAAa;IACrB,aAAa,CAAQ;IACrB,qBAAqB,CAAQ;IAC7B,aAAa,CAAe;IAC5B,mBAAmB,CAAK;IACxB,kBAAkB,CAAe;IACjC,eAAe,CAAe;IAC9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AS,GAAG,CAAC,oBAAoB,CAAC,CAAA;QAExC,+DAA+D;QAC/D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC;QAED,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAClD,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAA;QAC5B,IAAI,CAAC,kBAAkB,GAAG,oBAAoB,CAAA;IAChD,CAAC;CACF"}
@@ -1,41 +0,0 @@
1
- import { Session } from './Session.js';
2
- /**
3
- * Manages active Claude sessions
4
- */
5
- export declare class SessionManager {
6
- private sessions;
7
- constructor();
8
- /**
9
- * Add a session
10
- */
11
- addSession(issueId: string, session: Session): void;
12
- /**
13
- * Get a session
14
- */
15
- getSession(issueId: string): Session | undefined;
16
- /**
17
- * Check if a session exists
18
- */
19
- hasSession(issueId: string): boolean;
20
- /**
21
- * Remove a session
22
- */
23
- removeSession(issueId: string): boolean;
24
- /**
25
- * Get all sessions
26
- */
27
- getAllSessions(): Map<string, Session>;
28
- /**
29
- * Update a session
30
- */
31
- updateSession(issueId: string, session: Session): boolean;
32
- /**
33
- * Get all active sessions
34
- */
35
- getActiveSessions(): Array<[string, Session]>;
36
- /**
37
- * Count active sessions
38
- */
39
- countActiveSessions(): number;
40
- }
41
- //# sourceMappingURL=SessionManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SessionManager.d.ts","sourceRoot":"","sources":["../src/SessionManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAsB;;IAMtC;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAInD;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAIhD;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIpC;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIvC;;OAEG;IACH,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAItC;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO;IASzD;;OAEG;IACH,iBAAiB,IAAI,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAI7C;;OAEG;IACH,mBAAmB,IAAI,MAAM;CAG9B"}
@@ -1,62 +0,0 @@
1
- /**
2
- * Manages active Claude sessions
3
- */
4
- export class SessionManager {
5
- sessions;
6
- constructor() {
7
- this.sessions = new Map();
8
- }
9
- /**
10
- * Add a session
11
- */
12
- addSession(issueId, session) {
13
- this.sessions.set(issueId, session);
14
- }
15
- /**
16
- * Get a session
17
- */
18
- getSession(issueId) {
19
- return this.sessions.get(issueId);
20
- }
21
- /**
22
- * Check if a session exists
23
- */
24
- hasSession(issueId) {
25
- return this.sessions.has(issueId);
26
- }
27
- /**
28
- * Remove a session
29
- */
30
- removeSession(issueId) {
31
- return this.sessions.delete(issueId);
32
- }
33
- /**
34
- * Get all sessions
35
- */
36
- getAllSessions() {
37
- return this.sessions;
38
- }
39
- /**
40
- * Update a session
41
- */
42
- updateSession(issueId, session) {
43
- if (!this.sessions.has(issueId)) {
44
- return false;
45
- }
46
- this.sessions.set(issueId, session);
47
- return true;
48
- }
49
- /**
50
- * Get all active sessions
51
- */
52
- getActiveSessions() {
53
- return Array.from(this.sessions.entries()).filter(([_, session]) => session.isActive());
54
- }
55
- /**
56
- * Count active sessions
57
- */
58
- countActiveSessions() {
59
- return this.getActiveSessions().length;
60
- }
61
- }
62
- //# sourceMappingURL=SessionManager.js.map
@@ -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