cyrus-core 0.2.2 → 0.2.4
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/CyrusAgentSession.d.ts +11 -8
- package/dist/CyrusAgentSession.d.ts.map +1 -1
- package/dist/CyrusAgentSession.js +1 -1
- package/dist/StreamingPrompt.d.ts +21 -0
- package/dist/StreamingPrompt.d.ts.map +1 -0
- package/dist/StreamingPrompt.js +76 -0
- package/dist/StreamingPrompt.js.map +1 -0
- package/dist/agent-runner-types.d.ts +324 -0
- package/dist/agent-runner-types.d.ts.map +1 -0
- package/dist/agent-runner-types.js +2 -0
- package/dist/agent-runner-types.js.map +1 -0
- package/dist/config-types.d.ts +4 -1
- package/dist/config-types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/issue-tracker/AgentEvent.d.ts +134 -0
- package/dist/issue-tracker/AgentEvent.d.ts.map +1 -0
- package/dist/issue-tracker/AgentEvent.js +109 -0
- package/dist/issue-tracker/AgentEvent.js.map +1 -0
- package/dist/issue-tracker/IAgentEventTransport.d.ts +146 -0
- package/dist/issue-tracker/IAgentEventTransport.d.ts.map +1 -0
- package/dist/issue-tracker/IAgentEventTransport.js +12 -0
- package/dist/issue-tracker/IAgentEventTransport.js.map +1 -0
- package/dist/issue-tracker/IIssueTrackerService.d.ts +692 -0
- package/dist/issue-tracker/IIssueTrackerService.d.ts.map +1 -0
- package/dist/issue-tracker/IIssueTrackerService.js +11 -0
- package/dist/issue-tracker/IIssueTrackerService.js.map +1 -0
- package/dist/issue-tracker/index.d.ts +59 -0
- package/dist/issue-tracker/index.d.ts.map +1 -0
- package/dist/issue-tracker/index.js +61 -0
- package/dist/issue-tracker/index.js.map +1 -0
- package/dist/issue-tracker/types.d.ts +499 -0
- package/dist/issue-tracker/types.d.ts.map +1 -0
- package/dist/issue-tracker/types.js +123 -0
- package/dist/issue-tracker/types.js.map +1 -0
- package/dist/simple-agent-runner-types.d.ts +206 -0
- package/dist/simple-agent-runner-types.d.ts.map +1 -0
- package/dist/simple-agent-runner-types.js +2 -0
- package/dist/simple-agent-runner-types.js.map +1 -0
- package/package.json +4 -3
- package/dist/webhook-types.d.ts +0 -259
- package/dist/webhook-types.d.ts.map +0 -1
- package/dist/webhook-types.js +0 -26
- package/dist/webhook-types.js.map +0 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic types for issue tracking platforms.
|
|
3
|
+
*
|
|
4
|
+
* These types provide simplified interfaces that match Linear SDK GraphQL types structure.
|
|
5
|
+
* Linear SDK is the source of truth - these types are designed to be compatible subsets
|
|
6
|
+
* of Linear's types, omitting implementation-specific fields while maintaining core
|
|
7
|
+
* data structure compatibility.
|
|
8
|
+
*
|
|
9
|
+
* Following the pattern from AgentEvent.ts, we reference Linear SDK types via JSDoc
|
|
10
|
+
* and re-export Linear enums where they exist. This makes Linear the "source of truth"
|
|
11
|
+
* while keeping interfaces manageable.
|
|
12
|
+
*
|
|
13
|
+
* @module issue-tracker/types
|
|
14
|
+
* @see {@link https://linear.app/docs/graphql/api|Linear GraphQL API Documentation}
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Standard workflow state types across platforms.
|
|
18
|
+
*/
|
|
19
|
+
export var WorkflowStateType;
|
|
20
|
+
(function (WorkflowStateType) {
|
|
21
|
+
WorkflowStateType["Triage"] = "triage";
|
|
22
|
+
WorkflowStateType["Backlog"] = "backlog";
|
|
23
|
+
WorkflowStateType["Unstarted"] = "unstarted";
|
|
24
|
+
WorkflowStateType["Started"] = "started";
|
|
25
|
+
WorkflowStateType["Completed"] = "completed";
|
|
26
|
+
WorkflowStateType["Canceled"] = "canceled";
|
|
27
|
+
})(WorkflowStateType || (WorkflowStateType = {}));
|
|
28
|
+
/**
|
|
29
|
+
* Issue priority levels (0 = no priority, 1 = urgent, 2 = high, 3 = normal, 4 = low).
|
|
30
|
+
*/
|
|
31
|
+
export var IssuePriority;
|
|
32
|
+
(function (IssuePriority) {
|
|
33
|
+
IssuePriority[IssuePriority["NoPriority"] = 0] = "NoPriority";
|
|
34
|
+
IssuePriority[IssuePriority["Urgent"] = 1] = "Urgent";
|
|
35
|
+
IssuePriority[IssuePriority["High"] = 2] = "High";
|
|
36
|
+
IssuePriority[IssuePriority["Normal"] = 3] = "Normal";
|
|
37
|
+
IssuePriority[IssuePriority["Low"] = 4] = "Low";
|
|
38
|
+
})(IssuePriority || (IssuePriority = {}));
|
|
39
|
+
/**
|
|
40
|
+
* Agent session status enumeration.
|
|
41
|
+
*
|
|
42
|
+
* Re-exported from Linear SDK. Linear SDK is the source of truth.
|
|
43
|
+
* Note: Linear uses "awaitingInput" while we historically used "awaiting-input".
|
|
44
|
+
* We now use Linear's enum directly for consistency.
|
|
45
|
+
*
|
|
46
|
+
* @see {@link LinearSDK.AgentSessionStatus} - Linear's AgentSessionStatus enum
|
|
47
|
+
*/
|
|
48
|
+
import { AgentSessionStatus } from "@linear/sdk";
|
|
49
|
+
export { AgentSessionStatus };
|
|
50
|
+
/**
|
|
51
|
+
* Agent session type/context enumeration.
|
|
52
|
+
*
|
|
53
|
+
* Re-exported from Linear SDK. Linear SDK is the source of truth.
|
|
54
|
+
*
|
|
55
|
+
* @see {@link LinearSDK.AgentSessionType} - Linear's AgentSessionType enum
|
|
56
|
+
*/
|
|
57
|
+
import { AgentSessionType } from "@linear/sdk";
|
|
58
|
+
export { AgentSessionType };
|
|
59
|
+
/**
|
|
60
|
+
* Agent activity type enumeration.
|
|
61
|
+
*
|
|
62
|
+
* Re-exported from Linear SDK. Linear SDK is the source of truth.
|
|
63
|
+
* This is aliased as AgentActivityContentType for backward compatibility.
|
|
64
|
+
*
|
|
65
|
+
* @see {@link LinearSDK.AgentActivityType} - Linear's AgentActivityType enum
|
|
66
|
+
*/
|
|
67
|
+
import { AgentActivityType } from "@linear/sdk";
|
|
68
|
+
export { AgentActivityType };
|
|
69
|
+
/**
|
|
70
|
+
* Legacy alias for AgentActivityType.
|
|
71
|
+
* @deprecated Use AgentActivityType instead
|
|
72
|
+
*/
|
|
73
|
+
export const AgentActivityContentType = AgentActivityType;
|
|
74
|
+
/**
|
|
75
|
+
* Agent activity signal enumeration.
|
|
76
|
+
*
|
|
77
|
+
* Re-exported from Linear SDK. Linear SDK is the source of truth.
|
|
78
|
+
*
|
|
79
|
+
* @see {@link LinearSDK.AgentActivitySignal} - Linear's AgentActivitySignal enum
|
|
80
|
+
*/
|
|
81
|
+
import { AgentActivitySignal } from "@linear/sdk";
|
|
82
|
+
export { AgentActivitySignal };
|
|
83
|
+
/**
|
|
84
|
+
* Type guard to check if webhook is an agent session created event.
|
|
85
|
+
*/
|
|
86
|
+
export function isAgentSessionCreatedWebhook(webhook) {
|
|
87
|
+
return webhook.type === "AgentSessionEvent" && webhook.action === "created";
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Type guard to check if webhook is an agent session prompted event.
|
|
91
|
+
*/
|
|
92
|
+
export function isAgentSessionPromptedWebhook(webhook) {
|
|
93
|
+
return webhook.type === "AgentSessionEvent" && webhook.action === "prompted";
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Type guard to check if webhook is an issue assigned notification.
|
|
97
|
+
*/
|
|
98
|
+
export function isIssueAssignedWebhook(webhook) {
|
|
99
|
+
return (webhook.type === "AppUserNotification" &&
|
|
100
|
+
webhook.action === "issueAssignedToYou");
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Type guard to check if webhook is an issue comment mention notification.
|
|
104
|
+
*/
|
|
105
|
+
export function isIssueCommentMentionWebhook(webhook) {
|
|
106
|
+
return (webhook.type === "AppUserNotification" &&
|
|
107
|
+
webhook.action === "issueCommentMention");
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Type guard to check if webhook is an issue new comment notification.
|
|
111
|
+
*/
|
|
112
|
+
export function isIssueNewCommentWebhook(webhook) {
|
|
113
|
+
return (webhook.type === "AppUserNotification" &&
|
|
114
|
+
webhook.action === "issueNewComment");
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Type guard to check if webhook is an issue unassigned notification.
|
|
118
|
+
*/
|
|
119
|
+
export function isIssueUnassignedWebhook(webhook) {
|
|
120
|
+
return (webhook.type === "AppUserNotification" &&
|
|
121
|
+
webhook.action === "issueUnassignedFromYou");
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/issue-tracker/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA0FH;;GAEG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC5B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,4CAAuB,CAAA;IACvB,0CAAqB,CAAA;AACtB,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACxB,6DAAc,CAAA;IACd,qDAAU,CAAA;IACV,iDAAQ,CAAA;IACR,qDAAU,CAAA;IACV,+CAAO,CAAA;AACR,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB;AAyCD;;;;;;;;GAQG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAG9B;;;;;;GAMG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAmB5B;;;;;;;GAOG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAG7B;;;GAGG;AACH,M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ner Interface
|
|
4
|
+
*
|
|
5
|
+
* This interface provides a provider-agnostic abstraction for simple agent runners
|
|
6
|
+
* that return enumerated responses. It follows the same pattern as IAgentRunner,
|
|
7
|
+
* where type aliases point to provider-specific SDK types (currently Claude SDK).
|
|
8
|
+
*
|
|
9
|
+
* Simple agent runners are specialized agents that:
|
|
10
|
+
* - Accept a constrained set of valid responses (enumerated type T)
|
|
11
|
+
* - Run until they produce one of the valid responses
|
|
12
|
+
* - Validate the response before returning
|
|
13
|
+
* - Provide progress events during execution
|
|
14
|
+
*
|
|
15
|
+
* ## Architecture Pattern
|
|
16
|
+
*
|
|
17
|
+
* This abstraction uses type aliasing to external SDK types rather than creating
|
|
18
|
+
* new types. This approach:
|
|
19
|
+
* - Maintains compatibility with existing simple-agent-runner code
|
|
20
|
+
* - Allows gradual migration to provider-agnostic code
|
|
21
|
+
* - Enables adapter pattern implementations for other providers
|
|
22
|
+
* - Preserves type safety and IDE autocomplete
|
|
23
|
+
*
|
|
24
|
+
* ## Usage Example
|
|
25
|
+
*
|
|
26
|
+
* ```typescript
|
|
27
|
+
* type IssueAction = "fix" | "skip" | "clarify";
|
|
28
|
+
*
|
|
29
|
+
* const config: ISimpleAgentRunnerConfig<IssueAction> = {
|
|
30
|
+
* validResponses: ["fix", "skip", "clarify"] as const,
|
|
31
|
+
* systemPrompt: "You analyze issues and decide what to do",
|
|
32
|
+
* cyrusHome: "/home/user/.cyrus",
|
|
33
|
+
* onProgress: (event) => {
|
|
34
|
+
* if (event.type === "response-detected") {
|
|
35
|
+
* console.log(`Agent wants to: ${event.candidateResponse}`);
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* const runner = new SimpleAgentRunner(config);
|
|
41
|
+
* const result = await runner.query("What should I do with this bug?");
|
|
42
|
+
* console.log(`Decision: ${result.response}`); // "fix" | "skip" | "clarify"
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see {@link ISimpleAgentRunnerConfig} for configuration options
|
|
46
|
+
* @see {@link ISimpleAgentResult} for result structure
|
|
47
|
+
* @see {@link IAgentProgressEvent} for progress event types
|
|
48
|
+
*/
|
|
49
|
+
export interface ISimpleAgentRunner<T extends string> {
|
|
50
|
+
/**
|
|
51
|
+
* Query the agent and get an enumerated response
|
|
52
|
+
*
|
|
53
|
+
* This method runs a complete agent session and returns one of the
|
|
54
|
+
* predefined valid responses. The agent will continue running until
|
|
55
|
+
* it produces a valid response or times out.
|
|
56
|
+
*
|
|
57
|
+
* @param question - The question or prompt to send to the agent
|
|
58
|
+
* @param options - Optional configuration for this specific query
|
|
59
|
+
* @returns A result containing the validated response and session metadata
|
|
60
|
+
* @throws Error if the agent times out or fails to produce a valid response
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const result = await runner.query(
|
|
65
|
+
* "Should we merge this PR?",
|
|
66
|
+
* { context: "CI passed, 2 approvals", allowFileReading: true }
|
|
67
|
+
* );
|
|
68
|
+
* console.log(`Decision: ${result.response}`); // "approve" | "reject" | "request-changes"
|
|
69
|
+
* console.log(`Cost: $${result.costUSD}`);
|
|
70
|
+
* console.log(`Duration: ${result.durationMs}ms`);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
query(question: string, options?: ISimpleAgentQueryOptions): Promise<ISimpleAgentResult<T>>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Progress events emitted during agent execution
|
|
77
|
+
*
|
|
78
|
+
* These events allow monitoring the agent's progress as it works toward
|
|
79
|
+
* producing a valid response. Useful for logging, UI updates, or debugging.
|
|
80
|
+
*
|
|
81
|
+
* Event types:
|
|
82
|
+
* - `started`: Session has begun (includes sessionId)
|
|
83
|
+
* - `thinking`: Agent is processing (includes reasoning text)
|
|
84
|
+
* - `tool-use`: Agent is using a tool (includes tool name and input)
|
|
85
|
+
* - `response-detected`: Agent produced a candidate response (may be invalid)
|
|
86
|
+
* - `validating`: Checking if response is valid
|
|
87
|
+
*/
|
|
88
|
+
export type IAgentProgressEvent = {
|
|
89
|
+
type: "started";
|
|
90
|
+
sessionId: string | null;
|
|
91
|
+
} | {
|
|
92
|
+
type: "thinking";
|
|
93
|
+
text: string;
|
|
94
|
+
} | {
|
|
95
|
+
type: "tool-use";
|
|
96
|
+
toolName: string;
|
|
97
|
+
input: unknown;
|
|
98
|
+
} | {
|
|
99
|
+
type: "response-detected";
|
|
100
|
+
candidateResponse: string;
|
|
101
|
+
} | {
|
|
102
|
+
type: "validating";
|
|
103
|
+
response: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Configuration for Simple Agent Runner
|
|
107
|
+
*
|
|
108
|
+
* Defines how the simple agent runner should behave, including valid responses,
|
|
109
|
+
* prompts, timeouts, and progress callbacks.
|
|
110
|
+
*
|
|
111
|
+
* @template T - The enumerated string type for valid responses
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* type Priority = "low" | "medium" | "high" | "critical";
|
|
116
|
+
*
|
|
117
|
+
* const config: ISimpleAgentRunnerConfig<Priority> = {
|
|
118
|
+
* validResponses: ["low", "medium", "high", "critical"] as const,
|
|
119
|
+
* systemPrompt: "Analyze the issue and determine priority level",
|
|
120
|
+
* maxTurns: 10,
|
|
121
|
+
* timeoutMs: 60000,
|
|
122
|
+
* model: "sonnet",
|
|
123
|
+
* cyrusHome: "/home/user/.cyrus",
|
|
124
|
+
* onProgress: (event) => {
|
|
125
|
+
* console.log(`Agent progress: ${event.type}`);
|
|
126
|
+
* }
|
|
127
|
+
* };
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export interface ISimpleAgentRunnerConfig<T extends string> {
|
|
131
|
+
/** Valid response options that the agent must choose from */
|
|
132
|
+
validResponses: readonly T[];
|
|
133
|
+
/** System prompt to guide the agent's behavior */
|
|
134
|
+
systemPrompt?: string;
|
|
135
|
+
/** Maximum number of turns before timeout */
|
|
136
|
+
maxTurns?: number;
|
|
137
|
+
/** Timeout in milliseconds for the entire operation */
|
|
138
|
+
timeoutMs?: number;
|
|
139
|
+
/** Model to use (e.g., "sonnet", "haiku") */
|
|
140
|
+
model?: string;
|
|
141
|
+
/** Fallback model if primary is unavailable */
|
|
142
|
+
fallbackModel?: string;
|
|
143
|
+
/** Working directory for agent execution */
|
|
144
|
+
workingDirectory?: string;
|
|
145
|
+
/** Cyrus home directory */
|
|
146
|
+
cyrusHome: string;
|
|
147
|
+
/** Optional callback for progress events */
|
|
148
|
+
onProgress?: (event: IAgentProgressEvent) => void;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Result from a Simple Agent Runner query
|
|
152
|
+
*
|
|
153
|
+
* Contains the validated response along with session metadata including
|
|
154
|
+
* messages, duration, cost, and session ID.
|
|
155
|
+
*
|
|
156
|
+
* @template T - The enumerated string type for valid responses
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const result: ISimpleAgentResult<"approve" | "reject"> = {
|
|
161
|
+
* response: "approve",
|
|
162
|
+
* messages: [...], // All SDK messages from the session
|
|
163
|
+
* sessionId: "claude-session-123",
|
|
164
|
+
* durationMs: 5432,
|
|
165
|
+
* costUSD: 0.0234
|
|
166
|
+
* };
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
export interface ISimpleAgentResult<T extends string> {
|
|
170
|
+
/** The validated response from the agent */
|
|
171
|
+
response: T;
|
|
172
|
+
/** All SDK messages from the session */
|
|
173
|
+
messages: SDKMessage[];
|
|
174
|
+
/** Session ID for debugging/logging */
|
|
175
|
+
sessionId: string | null;
|
|
176
|
+
/** Duration of execution in milliseconds */
|
|
177
|
+
durationMs: number;
|
|
178
|
+
/** Cost in USD (if available) */
|
|
179
|
+
costUSD?: number;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Options for a Simple Agent Runner query
|
|
183
|
+
*
|
|
184
|
+
* Provides additional configuration that can be specified per-query
|
|
185
|
+
* to customize behavior beyond the runner's base configuration.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* const options: ISimpleAgentQueryOptions = {
|
|
190
|
+
* context: "User has premium subscription, last login was 2 days ago",
|
|
191
|
+
* allowFileReading: true,
|
|
192
|
+
* allowedDirectories: ["/home/user/project/src"]
|
|
193
|
+
* };
|
|
194
|
+
*
|
|
195
|
+
* const result = await runner.query("Should we send a reminder email?", options);
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
export interface ISimpleAgentQueryOptions {
|
|
199
|
+
/** Additional context to provide to the agent */
|
|
200
|
+
context?: string;
|
|
201
|
+
/** Allow the agent to use file reading tools */
|
|
202
|
+
allowFileReading?: boolean;
|
|
203
|
+
/** Allowed directories for file operations */
|
|
204
|
+
allowedDirectories?: string[];
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=simple-agent-runner-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-agent-runner-types.d.ts","sourceRoot":"","sources":["../src/simple-agent-runner-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,MAAM;IACnD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CACJ,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mBAAmB,GAC5B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,UAAU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MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,wBAAwB;IACxC,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-agent-runner-types.js","sourceRoot":"","sources":["../src/simple-agent-runner-types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyrus-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Core business logic for Cyrus",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@
|
|
13
|
-
"
|
|
12
|
+
"@anthropic-ai/claude-agent-sdk": "^0.1.52",
|
|
13
|
+
"@linear/sdk": "^64.0.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/node": "^20.0.0",
|
|
17
|
+
"fastify": "^5.6.1",
|
|
17
18
|
"typescript": "^5.3.3",
|
|
18
19
|
"vitest": "^1.1.0"
|
|
19
20
|
},
|
package/dist/webhook-types.d.ts
DELETED
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Linear webhook types based on actual webhook payloads
|
|
3
|
-
* These are the exact structures Linear sends in webhooks
|
|
4
|
-
*/
|
|
5
|
-
import type { LinearDocument } from "@linear/sdk";
|
|
6
|
-
/**
|
|
7
|
-
* Linear team data from webhooks
|
|
8
|
-
*/
|
|
9
|
-
export interface LinearWebhookTeam {
|
|
10
|
-
id: string;
|
|
11
|
-
key: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Linear issue data from webhooks
|
|
16
|
-
*/
|
|
17
|
-
export interface LinearWebhookIssue {
|
|
18
|
-
id: string;
|
|
19
|
-
title: string;
|
|
20
|
-
teamId: string;
|
|
21
|
-
team: LinearWebhookTeam;
|
|
22
|
-
identifier: string;
|
|
23
|
-
url: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Linear comment data from webhooks
|
|
27
|
-
*/
|
|
28
|
-
export interface LinearWebhookComment {
|
|
29
|
-
id: string;
|
|
30
|
-
body: string;
|
|
31
|
-
userId: string;
|
|
32
|
-
issueId: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Linear actor (user) data from webhooks
|
|
36
|
-
*/
|
|
37
|
-
export interface LinearWebhookActor {
|
|
38
|
-
id: string;
|
|
39
|
-
name: string;
|
|
40
|
-
email: string;
|
|
41
|
-
url: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Base notification structure common to all webhook notifications
|
|
45
|
-
*/
|
|
46
|
-
export interface LinearWebhookNotificationBase {
|
|
47
|
-
id: string;
|
|
48
|
-
createdAt: string;
|
|
49
|
-
updatedAt: string;
|
|
50
|
-
archivedAt: string | null;
|
|
51
|
-
actorId: string;
|
|
52
|
-
externalUserActorId: string | null;
|
|
53
|
-
userId: string;
|
|
54
|
-
issueId: string;
|
|
55
|
-
issue: LinearWebhookIssue;
|
|
56
|
-
actor: LinearWebhookActor;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Issue assignment notification
|
|
60
|
-
*/
|
|
61
|
-
export interface LinearIssueAssignedNotification extends LinearWebhookNotificationBase {
|
|
62
|
-
type: "issueAssignedToYou";
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Issue comment mention notification
|
|
66
|
-
*/
|
|
67
|
-
export interface LinearIssueCommentMentionNotification extends LinearWebhookNotificationBase {
|
|
68
|
-
type: "issueCommentMention";
|
|
69
|
-
commentId: string;
|
|
70
|
-
comment: LinearWebhookComment;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Issue new comment notification (can have parent comment for replies)
|
|
74
|
-
*/
|
|
75
|
-
export interface LinearIssueNewCommentNotification extends LinearWebhookNotificationBase {
|
|
76
|
-
type: "issueNewComment";
|
|
77
|
-
commentId: string;
|
|
78
|
-
comment: LinearWebhookComment;
|
|
79
|
-
parentCommentId?: string;
|
|
80
|
-
parentComment?: LinearWebhookComment;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Issue unassignment notification
|
|
84
|
-
*/
|
|
85
|
-
export interface LinearIssueUnassignedNotification extends LinearWebhookNotificationBase {
|
|
86
|
-
type: "issueUnassignedFromYou";
|
|
87
|
-
actorId: string;
|
|
88
|
-
externalUserActorId: string | null;
|
|
89
|
-
userId: string;
|
|
90
|
-
issueId: string;
|
|
91
|
-
issue: LinearWebhookIssue;
|
|
92
|
-
actor: LinearWebhookActor;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Union of all notification types
|
|
96
|
-
*/
|
|
97
|
-
export type LinearWebhookNotification = LinearIssueAssignedNotification | LinearIssueCommentMentionNotification | LinearIssueNewCommentNotification | LinearIssueUnassignedNotification;
|
|
98
|
-
/**
|
|
99
|
-
* Issue assignment webhook payload
|
|
100
|
-
*/
|
|
101
|
-
export interface LinearIssueAssignedWebhook {
|
|
102
|
-
type: "AppUserNotification";
|
|
103
|
-
action: "issueAssignedToYou";
|
|
104
|
-
createdAt: string;
|
|
105
|
-
organizationId: string;
|
|
106
|
-
oauthClientId: string;
|
|
107
|
-
appUserId: string;
|
|
108
|
-
notification: LinearIssueAssignedNotification;
|
|
109
|
-
webhookTimestamp: number;
|
|
110
|
-
webhookId: string;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Issue comment mention webhook payload
|
|
114
|
-
*/
|
|
115
|
-
export interface LinearIssueCommentMentionWebhook {
|
|
116
|
-
type: "AppUserNotification";
|
|
117
|
-
action: "issueCommentMention";
|
|
118
|
-
createdAt: string;
|
|
119
|
-
organizationId: string;
|
|
120
|
-
oauthClientId: string;
|
|
121
|
-
appUserId: string;
|
|
122
|
-
notification: LinearIssueCommentMentionNotification;
|
|
123
|
-
webhookTimestamp: number;
|
|
124
|
-
webhookId: string;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Issue new comment webhook payload
|
|
128
|
-
*/
|
|
129
|
-
export interface LinearIssueNewCommentWebhook {
|
|
130
|
-
type: "AppUserNotification";
|
|
131
|
-
action: "issueNewComment";
|
|
132
|
-
createdAt: string;
|
|
133
|
-
organizationId: string;
|
|
134
|
-
oauthClientId: string;
|
|
135
|
-
appUserId: string;
|
|
136
|
-
notification: LinearIssueNewCommentNotification;
|
|
137
|
-
webhookTimestamp: number;
|
|
138
|
-
webhookId: string;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Issue unassignment webhook payload
|
|
142
|
-
*/
|
|
143
|
-
export interface LinearIssueUnassignedWebhook {
|
|
144
|
-
type: "AppUserNotification";
|
|
145
|
-
action: "issueUnassignedFromYou";
|
|
146
|
-
createdAt: string;
|
|
147
|
-
organizationId: string;
|
|
148
|
-
oauthClientId: string;
|
|
149
|
-
appUserId: string;
|
|
150
|
-
notification: LinearIssueUnassignedNotification;
|
|
151
|
-
webhookTimestamp: number;
|
|
152
|
-
webhookId: string;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Creator data in agent session webhooks
|
|
156
|
-
*/
|
|
157
|
-
export interface LinearWebhookCreator {
|
|
158
|
-
id: string;
|
|
159
|
-
name: string;
|
|
160
|
-
email: string;
|
|
161
|
-
avatarUrl: string;
|
|
162
|
-
url: string;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Agent guidance types - re-exported from @linear/sdk for convenience
|
|
166
|
-
*/
|
|
167
|
-
export type LinearWebhookGuidanceRule = LinearDocument.GuidanceRuleWebhookPayload;
|
|
168
|
-
export type LinearWebhookOrganizationOrigin = LinearDocument.OrganizationOriginWebhookPayload;
|
|
169
|
-
export type LinearWebhookTeamOrigin = LinearDocument.TeamOriginWebhookPayload;
|
|
170
|
-
export type LinearWebhookTeamWithParent = LinearDocument.TeamWithParentWebhookPayload;
|
|
171
|
-
/**
|
|
172
|
-
* Agent Session data from webhooks
|
|
173
|
-
*/
|
|
174
|
-
export interface LinearWebhookAgentSession {
|
|
175
|
-
id: string;
|
|
176
|
-
createdAt: string;
|
|
177
|
-
updatedAt: string;
|
|
178
|
-
archivedAt: string | null;
|
|
179
|
-
creatorId: string;
|
|
180
|
-
appUserId: string;
|
|
181
|
-
commentId: string;
|
|
182
|
-
issueId: string;
|
|
183
|
-
status: "pending" | "active" | "error" | "awaiting-input" | "complete";
|
|
184
|
-
startedAt: string | null;
|
|
185
|
-
endedAt: string | null;
|
|
186
|
-
type: "commentThread";
|
|
187
|
-
summary: string | null;
|
|
188
|
-
sourceMetadata: any | null;
|
|
189
|
-
organizationId: string;
|
|
190
|
-
creator: LinearWebhookCreator;
|
|
191
|
-
comment: LinearWebhookComment;
|
|
192
|
-
issue: LinearWebhookIssue;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Agent Activity content types
|
|
196
|
-
*/
|
|
197
|
-
export interface LinearWebhookAgentActivityContent {
|
|
198
|
-
type: "prompt" | "observation" | "action" | "error" | "elicitation" | "response";
|
|
199
|
-
body: string;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Agent Activity data from webhooks
|
|
203
|
-
*/
|
|
204
|
-
export interface LinearWebhookAgentActivity {
|
|
205
|
-
id: string;
|
|
206
|
-
createdAt: string;
|
|
207
|
-
updatedAt: string;
|
|
208
|
-
archivedAt: string | null;
|
|
209
|
-
agentContextId: string | null;
|
|
210
|
-
agentSessionId: string;
|
|
211
|
-
sourceCommentId: string;
|
|
212
|
-
content: LinearWebhookAgentActivityContent;
|
|
213
|
-
signal?: "stop";
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Agent Session created webhook payload
|
|
217
|
-
*/
|
|
218
|
-
export interface LinearAgentSessionCreatedWebhook {
|
|
219
|
-
type: "AgentSessionEvent";
|
|
220
|
-
action: "created";
|
|
221
|
-
createdAt: string;
|
|
222
|
-
organizationId: string;
|
|
223
|
-
oauthClientId: string;
|
|
224
|
-
appUserId: string;
|
|
225
|
-
agentSession: LinearWebhookAgentSession;
|
|
226
|
-
guidance?: LinearWebhookGuidanceRule[];
|
|
227
|
-
webhookTimestamp: string;
|
|
228
|
-
webhookId: string;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Agent Session prompted webhook payload
|
|
232
|
-
*/
|
|
233
|
-
export interface LinearAgentSessionPromptedWebhook {
|
|
234
|
-
type: "AgentSessionEvent";
|
|
235
|
-
action: "prompted";
|
|
236
|
-
createdAt: string;
|
|
237
|
-
organizationId: string;
|
|
238
|
-
oauthClientId: string;
|
|
239
|
-
appUserId: string;
|
|
240
|
-
agentSession: LinearWebhookAgentSession;
|
|
241
|
-
agentActivity: LinearWebhookAgentActivity;
|
|
242
|
-
guidance?: LinearWebhookGuidanceRule[];
|
|
243
|
-
webhookTimestamp: string;
|
|
244
|
-
webhookId: string;
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Union of all webhook types we handle
|
|
248
|
-
*/
|
|
249
|
-
export type LinearWebhook = LinearIssueAssignedWebhook | LinearIssueCommentMentionWebhook | LinearIssueNewCommentWebhook | LinearIssueUnassignedWebhook | LinearAgentSessionCreatedWebhook | LinearAgentSessionPromptedWebhook;
|
|
250
|
-
/**
|
|
251
|
-
* Type guards for webhook discrimination
|
|
252
|
-
*/
|
|
253
|
-
export declare function isIssueAssignedWebhook(webhook: LinearWebhook): webhook is LinearIssueAssignedWebhook;
|
|
254
|
-
export declare function isIssueCommentMentionWebhook(webhook: LinearWebhook): webhook is LinearIssueCommentMentionWebhook;
|
|
255
|
-
export declare function isIssueNewCommentWebhook(webhook: LinearWebhook): webhook is LinearIssueNewCommentWebhook;
|
|
256
|
-
export declare function isIssueUnassignedWebhook(webhook: LinearWebhook): webhook is LinearIssueUnassignedWebhook;
|
|
257
|
-
export declare function isAgentSessionCreatedWebhook(webhook: LinearWebhook): webhook is LinearAgentSessionCreatedWebhook;
|
|
258
|
-
export declare function isAgentSessionPromptedWebhook(webhook: LinearWebhook): webhook is LinearAgentSessionPromptedWebhook;
|
|
259
|
-
//# sourceMappingURL=webhook-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-types.d.ts","sourceRoot":"","sources":["../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,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zB,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
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
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
|
-
}
|
|
26
|
-
//# sourceMappingURL=webhook-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-types.js","sourceRoot":"","sources":["../src/webhook-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqSH;;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"}
|