cyrus-core 0.0.6 → 0.0.8
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/LICENSE +674 -21
- package/dist/CyrusAgentSession.d.ts +56 -0
- package/dist/CyrusAgentSession.d.ts.map +1 -0
- package/dist/CyrusAgentSession.js +6 -0
- package/dist/CyrusAgentSession.js.map +1 -0
- package/dist/PersistenceManager.d.ts +15 -39
- package/dist/PersistenceManager.d.ts.map +1 -1
- package/dist/PersistenceManager.js +31 -31
- package/dist/PersistenceManager.js.map +1 -1
- package/dist/index.d.ts +5 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/webhook-types.d.ts +97 -13
- package/dist/webhook-types.d.ts.map +1 -1
- package/dist/webhook-types.js +10 -4
- package/dist/webhook-types.js.map +1 -1
- package/package.json +6 -3
- package/dist/Session.d.ts +0 -96
- package/dist/Session.d.ts.map +0 -1
- package/dist/Session.js +0 -168
- package/dist/Session.js.map +0 -1
- package/dist/SessionManager.d.ts +0 -91
- package/dist/SessionManager.d.ts.map +0 -1
- package/dist/SessionManager.js +0 -222
- package/dist/SessionManager.js.map +0 -1
|
@@ -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 type { LinearDocument } from "@linear/sdk";
|
|
6
|
+
import type { 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":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,YAAY;IAC5B,EAAE,EAAE,MA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CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CyrusAgentSession.js","sourceRoot":"","sources":["../src/CyrusAgentSession.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,36 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export interface SerializableSession {
|
|
5
|
-
issueId: string;
|
|
6
|
-
issueIdentifier: string;
|
|
7
|
-
issueTitle: string;
|
|
8
|
-
branchName: string;
|
|
9
|
-
workspacePath: string;
|
|
10
|
-
isGitWorktree: boolean;
|
|
11
|
-
historyPath?: string;
|
|
12
|
-
claudeSessionId: string | null;
|
|
13
|
-
agentRootCommentId: string | null;
|
|
14
|
-
lastCommentId: string | null;
|
|
15
|
-
currentParentId: string | null;
|
|
16
|
-
startedAt: string;
|
|
17
|
-
exitedAt: string | null;
|
|
18
|
-
conversationContext: any;
|
|
19
|
-
}
|
|
1
|
+
import type { CyrusAgentSession, CyrusAgentSessionEntry } from "./CyrusAgentSession.js";
|
|
2
|
+
export type SerializedCyrusAgentSession = CyrusAgentSession;
|
|
3
|
+
export type SerializedCyrusAgentSessionEntry = CyrusAgentSessionEntry;
|
|
20
4
|
/**
|
|
21
5
|
* Serializable EdgeWorker state for persistence
|
|
22
6
|
*/
|
|
23
7
|
export interface SerializableEdgeWorkerState {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
commentToLatestAgentReply: Record<string, string>;
|
|
27
|
-
issueToCommentThreads: Record<string, string[]>;
|
|
28
|
-
issueToReplyContext: Record<string, {
|
|
29
|
-
commentId: string;
|
|
30
|
-
parentId?: string;
|
|
31
|
-
}>;
|
|
32
|
-
sessionsByCommentId: Record<string, SerializableSession>;
|
|
33
|
-
sessionsByIssueId: Record<string, SerializableSession[]>;
|
|
8
|
+
agentSessions?: Record<string, Record<string, SerializedCyrusAgentSession>>;
|
|
9
|
+
agentSessionEntries?: Record<string, Record<string, SerializedCyrusAgentSessionEntry[]>>;
|
|
34
10
|
}
|
|
35
11
|
/**
|
|
36
12
|
* Manages persistence of critical mappings to survive restarts
|
|
@@ -39,29 +15,29 @@ export declare class PersistenceManager {
|
|
|
39
15
|
private persistencePath;
|
|
40
16
|
constructor(persistencePath?: string);
|
|
41
17
|
/**
|
|
42
|
-
* Get the full path to the state file
|
|
18
|
+
* Get the full path to the single EdgeWorker state file
|
|
43
19
|
*/
|
|
44
|
-
private
|
|
20
|
+
private getEdgeWorkerStateFilePath;
|
|
45
21
|
/**
|
|
46
22
|
* Ensure the persistence directory exists
|
|
47
23
|
*/
|
|
48
24
|
private ensurePersistenceDirectory;
|
|
49
25
|
/**
|
|
50
|
-
* Save EdgeWorker state to disk
|
|
26
|
+
* Save EdgeWorker state to disk (single file for all repositories)
|
|
51
27
|
*/
|
|
52
|
-
saveEdgeWorkerState(
|
|
28
|
+
saveEdgeWorkerState(state: SerializableEdgeWorkerState): Promise<void>;
|
|
53
29
|
/**
|
|
54
|
-
* Load EdgeWorker state from disk
|
|
30
|
+
* Load EdgeWorker state from disk (single file for all repositories)
|
|
55
31
|
*/
|
|
56
|
-
loadEdgeWorkerState(
|
|
32
|
+
loadEdgeWorkerState(): Promise<SerializableEdgeWorkerState | null>;
|
|
57
33
|
/**
|
|
58
|
-
* Check if state file exists
|
|
34
|
+
* Check if EdgeWorker state file exists
|
|
59
35
|
*/
|
|
60
|
-
hasStateFile(
|
|
36
|
+
hasStateFile(): boolean;
|
|
61
37
|
/**
|
|
62
|
-
* Delete state file
|
|
38
|
+
* Delete EdgeWorker state file
|
|
63
39
|
*/
|
|
64
|
-
deleteStateFile(
|
|
40
|
+
deleteStateFile(): Promise<void>;
|
|
65
41
|
/**
|
|
66
42
|
* Convert Map to Record for serialization
|
|
67
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersistenceManager.d.ts","sourceRoot":"","sources":["../src/PersistenceManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PersistenceManager.d.ts","sourceRoot":"","sources":["../src/PersistenceManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,iBAAiB,EACjB,sBAAsB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;AAM5D,MAAM,MAAM,gCAAgC,GAAG,sBAAsB,CAAC;AAOtE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAE3C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC,CAAC;IAC5E,mBAAmB,CAAC,EAAE,MAAM,CAC3B,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,gCAAgC,EAAE,CAAC,CAClD,CAAC;CACF;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,eAAe,CAAS;gBAEpB,eAAe,CAAC,EAAE,MAAM;IAKpC;;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;CAGxC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { homedir } from
|
|
4
|
-
import {
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
5
|
/**
|
|
6
6
|
* Manages persistence of critical mappings to survive restarts
|
|
7
7
|
*/
|
|
8
8
|
export class PersistenceManager {
|
|
9
9
|
persistencePath;
|
|
10
10
|
constructor(persistencePath) {
|
|
11
|
-
this.persistencePath =
|
|
11
|
+
this.persistencePath =
|
|
12
|
+
persistencePath || join(homedir(), ".cyrus", "state");
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
|
-
* Get the full path to the state file
|
|
15
|
+
* Get the full path to the single EdgeWorker state file
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
return join(this.persistencePath,
|
|
17
|
+
getEdgeWorkerStateFilePath() {
|
|
18
|
+
return join(this.persistencePath, "edge-worker-state.json");
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Ensure the persistence directory exists
|
|
@@ -23,65 +24,64 @@ export class PersistenceManager {
|
|
|
23
24
|
await mkdir(this.persistencePath, { recursive: true });
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
* Save EdgeWorker state to disk
|
|
27
|
+
* Save EdgeWorker state to disk (single file for all repositories)
|
|
27
28
|
*/
|
|
28
|
-
async saveEdgeWorkerState(
|
|
29
|
+
async saveEdgeWorkerState(state) {
|
|
29
30
|
try {
|
|
30
31
|
await this.ensurePersistenceDirectory();
|
|
31
|
-
const stateFile = this.
|
|
32
|
+
const stateFile = this.getEdgeWorkerStateFilePath();
|
|
32
33
|
const stateData = {
|
|
33
|
-
version:
|
|
34
|
+
version: "2.0",
|
|
34
35
|
savedAt: new Date().toISOString(),
|
|
35
|
-
|
|
36
|
-
state
|
|
36
|
+
state,
|
|
37
37
|
};
|
|
38
|
-
await writeFile(stateFile, JSON.stringify(stateData, null, 2),
|
|
38
|
+
await writeFile(stateFile, JSON.stringify(stateData, null, 2), "utf8");
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
|
-
console.error(`Failed to save EdgeWorker state
|
|
41
|
+
console.error(`Failed to save EdgeWorker state:`, error);
|
|
42
42
|
throw error;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Load EdgeWorker state from disk
|
|
46
|
+
* Load EdgeWorker state from disk (single file for all repositories)
|
|
47
47
|
*/
|
|
48
|
-
async loadEdgeWorkerState(
|
|
48
|
+
async loadEdgeWorkerState() {
|
|
49
49
|
try {
|
|
50
|
-
const stateFile = this.
|
|
50
|
+
const stateFile = this.getEdgeWorkerStateFilePath();
|
|
51
51
|
if (!existsSync(stateFile)) {
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
const stateData = JSON.parse(await readFile(stateFile,
|
|
54
|
+
const stateData = JSON.parse(await readFile(stateFile, "utf8"));
|
|
55
55
|
// Validate state structure
|
|
56
|
-
if (!stateData.state ||
|
|
57
|
-
console.warn(`Invalid state file
|
|
56
|
+
if (!stateData.state || stateData.version !== "2.0") {
|
|
57
|
+
console.warn(`Invalid or outdated state file, ignoring`);
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
60
|
return stateData.state;
|
|
61
61
|
}
|
|
62
62
|
catch (error) {
|
|
63
|
-
console.error(`Failed to load EdgeWorker state
|
|
63
|
+
console.error(`Failed to load EdgeWorker state:`, error);
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
* Check if state file exists
|
|
68
|
+
* Check if EdgeWorker state file exists
|
|
69
69
|
*/
|
|
70
|
-
hasStateFile(
|
|
71
|
-
return existsSync(this.
|
|
70
|
+
hasStateFile() {
|
|
71
|
+
return existsSync(this.getEdgeWorkerStateFilePath());
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
|
-
* Delete state file
|
|
74
|
+
* Delete EdgeWorker state file
|
|
75
75
|
*/
|
|
76
|
-
async deleteStateFile(
|
|
76
|
+
async deleteStateFile() {
|
|
77
77
|
try {
|
|
78
|
-
const stateFile = this.
|
|
78
|
+
const stateFile = this.getEdgeWorkerStateFilePath();
|
|
79
79
|
if (existsSync(stateFile)) {
|
|
80
|
-
await writeFile(stateFile,
|
|
80
|
+
await writeFile(stateFile, "", "utf8"); // Clear file instead of deleting
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
catch (error) {
|
|
84
|
-
console.error(`Failed to delete state file
|
|
84
|
+
console.error(`Failed to delete EdgeWorker state file:`, error);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersistenceManager.js","sourceRoot":"","sources":["../src/PersistenceManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PersistenceManager.js","sourceRoot":"","sources":["../src/PersistenceManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC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,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAI,GAAW;QAC/B,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAI,KAAU;QAC9B,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CACD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
6
|
-
export type { LinearWebhookTeam, LinearWebhookIssue, LinearWebhookComment, LinearWebhookActor, LinearWebhookNotification, LinearIssueAssignedNotification, LinearIssueCommentMentionNotification, LinearIssueNewCommentNotification, LinearIssueUnassignedNotification, LinearWebhook, LinearIssueAssignedWebhook, LinearIssueCommentMentionWebhook, LinearIssueNewCommentWebhook, LinearIssueUnassignedWebhook } from './webhook-types.js';
|
|
7
|
-
export { isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueUnassignedWebhook } from './webhook-types.js';
|
|
1
|
+
export type { CyrusAgentSession, CyrusAgentSessionEntry, IssueMinimal, Workspace, } from "./CyrusAgentSession.js";
|
|
2
|
+
export type { SerializableEdgeWorkerState, SerializedCyrusAgentSession, SerializedCyrusAgentSessionEntry, } from "./PersistenceManager.js";
|
|
3
|
+
export { PersistenceManager } from "./PersistenceManager.js";
|
|
4
|
+
export type { LinearAgentSessionCreatedWebhook, LinearAgentSessionPromptedWebhook, LinearIssueAssignedNotification, LinearIssueAssignedWebhook, LinearIssueCommentMentionNotification, LinearIssueCommentMentionWebhook, LinearIssueNewCommentNotification, LinearIssueNewCommentWebhook, LinearIssueUnassignedNotification, LinearIssueUnassignedWebhook, LinearWebhook, LinearWebhookActor, LinearWebhookAgentActivity, LinearWebhookAgentActivityContent, LinearWebhookAgentSession, LinearWebhookComment, LinearWebhookCreator, LinearWebhookIssue, LinearWebhookNotification, LinearWebhookTeam, } from "./webhook-types.js";
|
|
5
|
+
export { isAgentSessionCreatedWebhook, isAgentSessionPromptedWebhook, isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueUnassignedWebhook, } from "./webhook-types.js";
|
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EACX,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,SAAS,GACT,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACX,2BAA2B,EAC3B,2BAA2B,EAC3B,gCAAgC,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,YAAY,EACX,gCAAgC,EAChC,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,qCAAqC,EACrC,gCAAgC,EAChC,iCAAiC,EACjC,4BAA4B,EAC5B,iCAAiC,EACjC,4BAA4B,EAC5B,aAAa,EACb,kBAAkB,EAClB,0BAA0B,EAC1B,iCAAiC,EACjC,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { Session } from './Session.js'
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
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 { isAgentSessionCreatedWebhook, isAgentSessionPromptedWebhook, isIssueAssignedWebhook, isIssueCommentMentionWebhook, isIssueNewCommentWebhook, isIssueUnassignedWebhook, } from "./webhook-types.js";
|
|
5
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,sEAAsE;AACtE,qFAAqF;AAarF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AA0B7D,OAAO,EACN,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,oBAAoB,CAAC"}
|
package/dist/webhook-types.d.ts
CHANGED
|
@@ -58,13 +58,13 @@ export interface LinearWebhookNotificationBase {
|
|
|
58
58
|
* Issue assignment notification
|
|
59
59
|
*/
|
|
60
60
|
export interface LinearIssueAssignedNotification extends LinearWebhookNotificationBase {
|
|
61
|
-
type:
|
|
61
|
+
type: "issueAssignedToYou";
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Issue comment mention notification
|
|
65
65
|
*/
|
|
66
66
|
export interface LinearIssueCommentMentionNotification extends LinearWebhookNotificationBase {
|
|
67
|
-
type:
|
|
67
|
+
type: "issueCommentMention";
|
|
68
68
|
commentId: string;
|
|
69
69
|
comment: LinearWebhookComment;
|
|
70
70
|
}
|
|
@@ -72,7 +72,7 @@ export interface LinearIssueCommentMentionNotification extends LinearWebhookNoti
|
|
|
72
72
|
* Issue new comment notification (can have parent comment for replies)
|
|
73
73
|
*/
|
|
74
74
|
export interface LinearIssueNewCommentNotification extends LinearWebhookNotificationBase {
|
|
75
|
-
type:
|
|
75
|
+
type: "issueNewComment";
|
|
76
76
|
commentId: string;
|
|
77
77
|
comment: LinearWebhookComment;
|
|
78
78
|
parentCommentId?: string;
|
|
@@ -82,7 +82,7 @@ export interface LinearIssueNewCommentNotification extends LinearWebhookNotifica
|
|
|
82
82
|
* Issue unassignment notification
|
|
83
83
|
*/
|
|
84
84
|
export interface LinearIssueUnassignedNotification extends LinearWebhookNotificationBase {
|
|
85
|
-
type:
|
|
85
|
+
type: "issueUnassignedFromYou";
|
|
86
86
|
actorId: string;
|
|
87
87
|
externalUserActorId: string | null;
|
|
88
88
|
userId: string;
|
|
@@ -98,8 +98,8 @@ export type LinearWebhookNotification = LinearIssueAssignedNotification | Linear
|
|
|
98
98
|
* Issue assignment webhook payload
|
|
99
99
|
*/
|
|
100
100
|
export interface LinearIssueAssignedWebhook {
|
|
101
|
-
type:
|
|
102
|
-
action:
|
|
101
|
+
type: "AppUserNotification";
|
|
102
|
+
action: "issueAssignedToYou";
|
|
103
103
|
createdAt: string;
|
|
104
104
|
organizationId: string;
|
|
105
105
|
oauthClientId: string;
|
|
@@ -112,8 +112,8 @@ export interface LinearIssueAssignedWebhook {
|
|
|
112
112
|
* Issue comment mention webhook payload
|
|
113
113
|
*/
|
|
114
114
|
export interface LinearIssueCommentMentionWebhook {
|
|
115
|
-
type:
|
|
116
|
-
action:
|
|
115
|
+
type: "AppUserNotification";
|
|
116
|
+
action: "issueCommentMention";
|
|
117
117
|
createdAt: string;
|
|
118
118
|
organizationId: string;
|
|
119
119
|
oauthClientId: string;
|
|
@@ -126,8 +126,8 @@ export interface LinearIssueCommentMentionWebhook {
|
|
|
126
126
|
* Issue new comment webhook payload
|
|
127
127
|
*/
|
|
128
128
|
export interface LinearIssueNewCommentWebhook {
|
|
129
|
-
type:
|
|
130
|
-
action:
|
|
129
|
+
type: "AppUserNotification";
|
|
130
|
+
action: "issueNewComment";
|
|
131
131
|
createdAt: string;
|
|
132
132
|
organizationId: string;
|
|
133
133
|
oauthClientId: string;
|
|
@@ -140,8 +140,8 @@ export interface LinearIssueNewCommentWebhook {
|
|
|
140
140
|
* Issue unassignment webhook payload
|
|
141
141
|
*/
|
|
142
142
|
export interface LinearIssueUnassignedWebhook {
|
|
143
|
-
type:
|
|
144
|
-
action:
|
|
143
|
+
type: "AppUserNotification";
|
|
144
|
+
action: "issueUnassignedFromYou";
|
|
145
145
|
createdAt: string;
|
|
146
146
|
organizationId: string;
|
|
147
147
|
oauthClientId: string;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"webhook-types.d.ts","sourceRoot":"","sources":["../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC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,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,yBAAyB,CAAC;IACxC,aAAa,EAAE,0BAA0B,CAAC;IAC1C,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GACtB,0BAA0B,GAC1B,gCAAgC,GAChC,4BAA4B,GAC5B,4BAA4B,GAC5B,gCAAgC,GAChC,iCAAiC,CAAC;AAErC;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,0BAA0B,CAEvC;AAED,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,gCAAgC,CAE7C;AAED,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,4BAA4B,CAEzC;AAED,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,4BAA4B,CAEzC;AAED,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,gCAAgC,CAE7C;AAED,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,aAAa,GACpB,OAAO,IAAI,iCAAiC,CAE9C"}
|
package/dist/webhook-types.js
CHANGED
|
@@ -6,15 +6,21 @@
|
|
|
6
6
|
* Type guards for webhook discrimination
|
|
7
7
|
*/
|
|
8
8
|
export function isIssueAssignedWebhook(webhook) {
|
|
9
|
-
return webhook.action ===
|
|
9
|
+
return webhook.action === "issueAssignedToYou";
|
|
10
10
|
}
|
|
11
11
|
export function isIssueCommentMentionWebhook(webhook) {
|
|
12
|
-
return webhook.action ===
|
|
12
|
+
return webhook.action === "issueCommentMention";
|
|
13
13
|
}
|
|
14
14
|
export function isIssueNewCommentWebhook(webhook) {
|
|
15
|
-
return webhook.action ===
|
|
15
|
+
return webhook.action === "issueNewComment";
|
|
16
16
|
}
|
|
17
17
|
export function isIssueUnassignedWebhook(webhook) {
|
|
18
|
-
return webhook.action ===
|
|
18
|
+
return webhook.action === "issueUnassignedFromYou";
|
|
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";
|
|
19
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;
|
|
1
|
+
{"version":3,"file":"webhook-types.js","sourceRoot":"","sources":["../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqRH;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACrC,OAAsB;IAEtB,OAAO,OAAO,CAAC,MAAM,KAAK,oBAAoB,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC3C,OAAsB;IAEtB,OAAO,OAAO,CAAC,MAAM,KAAK,qBAAqB,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wBAAwB,CACvC,OAAsB;IAEtB,OAAO,OAAO,CAAC,MAAM,KAAK,iBAAiB,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,wBAAwB,CACvC,OAAsB;IAEtB,OAAO,OAAO,CAAC,MAAM,KAAK,wBAAwB,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC3C,OAAsB;IAEtB,OAAO,OAAO,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC5C,OAAsB;IAEtB,OAAO,OAAO,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC;AAC9E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyrus-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
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": "^54.0.0",
|
|
13
|
+
"cyrus-claude-runner": "0.0.15"
|
|
14
|
+
},
|
|
12
15
|
"devDependencies": {
|
|
13
16
|
"@types/node": "^20.0.0",
|
|
14
17
|
"typescript": "^5.3.3",
|
|
@@ -21,7 +24,7 @@
|
|
|
21
24
|
"build": "tsc",
|
|
22
25
|
"dev": "tsc --watch",
|
|
23
26
|
"test": "vitest",
|
|
24
|
-
"test:run": "vitest run",
|
|
27
|
+
"test:run": "vitest run --passWithNoTests",
|
|
25
28
|
"typecheck": "tsc --noEmit"
|
|
26
29
|
}
|
|
27
30
|
}
|