cyrus-edge-worker 0.0.22 → 0.0.24
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/EdgeWorker.d.ts +40 -12
- package/dist/EdgeWorker.d.ts.map +1 -1
- package/dist/EdgeWorker.js +403 -192
- package/dist/EdgeWorker.js.map +1 -1
- package/dist/types.d.ts +41 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -6
package/dist/EdgeWorker.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
|
+
import { type Issue as LinearIssue } from "@linear/sdk";
|
|
2
3
|
import type { SerializableEdgeWorkerState } from "cyrus-core";
|
|
3
4
|
import type { EdgeWorkerConfig, EdgeWorkerEvents } from "./types.js";
|
|
4
5
|
export declare interface EdgeWorker {
|
|
@@ -50,8 +51,23 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
50
51
|
private handleIssueUnassignedWebhook;
|
|
51
52
|
/**
|
|
52
53
|
* Find the repository configuration for a webhook
|
|
54
|
+
* Now supports async operations for label-based and project-based routing
|
|
55
|
+
* Priority: routingLabels > projectKeys > teamKeys
|
|
53
56
|
*/
|
|
54
57
|
private findRepositoryForWebhook;
|
|
58
|
+
/**
|
|
59
|
+
* Helper method to find repository by project name
|
|
60
|
+
*/
|
|
61
|
+
private findRepositoryByProject;
|
|
62
|
+
/**
|
|
63
|
+
* Create a new Linear agent session with all necessary setup
|
|
64
|
+
* @param linearAgentActivitySessionId The Linear agent activity session ID
|
|
65
|
+
* @param issue Linear issue object
|
|
66
|
+
* @param repository Repository configuration
|
|
67
|
+
* @param agentSessionManager Agent session manager instance
|
|
68
|
+
* @returns Object containing session details and setup information
|
|
69
|
+
*/
|
|
70
|
+
private createLinearAgentSession;
|
|
55
71
|
/**
|
|
56
72
|
* Handle agent session created webhook
|
|
57
73
|
* . Can happen due to being 'delegated' or @ mentioned in a new thread
|
|
@@ -81,10 +97,6 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
81
97
|
* TODO: improve this
|
|
82
98
|
*/
|
|
83
99
|
private handleClaudeError;
|
|
84
|
-
/**
|
|
85
|
-
* Fetch complete issue details from Linear API
|
|
86
|
-
*/
|
|
87
|
-
private fetchFullIssueDetails;
|
|
88
100
|
/**
|
|
89
101
|
* Fetch issue labels for a given issue
|
|
90
102
|
*/
|
|
@@ -115,14 +127,6 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
115
127
|
* @returns The version value if found, undefined otherwise
|
|
116
128
|
*/
|
|
117
129
|
private extractVersionTag;
|
|
118
|
-
/**
|
|
119
|
-
* Convert full Linear SDK issue to CoreIssue interface for Session creation
|
|
120
|
-
*/
|
|
121
|
-
private convertLinearIssueToCore;
|
|
122
|
-
/**
|
|
123
|
-
* Sanitize branch name by removing backticks to prevent command injection
|
|
124
|
-
*/
|
|
125
|
-
private sanitizeBranchName;
|
|
126
130
|
/**
|
|
127
131
|
* Check if a branch exists locally or remotely
|
|
128
132
|
*/
|
|
@@ -131,6 +135,14 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
131
135
|
* Determine the base branch for an issue, considering parent issues
|
|
132
136
|
*/
|
|
133
137
|
private determineBaseBranch;
|
|
138
|
+
/**
|
|
139
|
+
* Convert full Linear SDK issue to CoreIssue interface for Session creation
|
|
140
|
+
*/
|
|
141
|
+
private convertLinearIssueToCore;
|
|
142
|
+
/**
|
|
143
|
+
* Sanitize branch name by removing backticks to prevent command injection
|
|
144
|
+
*/
|
|
145
|
+
private sanitizeBranchName;
|
|
134
146
|
/**
|
|
135
147
|
* Format Linear comments into a threaded structure that mirrors the Linear UI
|
|
136
148
|
* @param comments Array of Linear comments
|
|
@@ -226,6 +238,18 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
226
238
|
* Build MCP configuration with automatic Linear server injection
|
|
227
239
|
*/
|
|
228
240
|
private buildMcpConfig;
|
|
241
|
+
/**
|
|
242
|
+
* Resolve tool preset names to actual tool lists
|
|
243
|
+
*/
|
|
244
|
+
private resolveToolPreset;
|
|
245
|
+
/**
|
|
246
|
+
* Build prompt for a session - handles both new and existing sessions
|
|
247
|
+
*/
|
|
248
|
+
private buildSessionPrompt;
|
|
249
|
+
/**
|
|
250
|
+
* Build Claude runner configuration with common settings
|
|
251
|
+
*/
|
|
252
|
+
private buildClaudeRunnerConfig;
|
|
229
253
|
/**
|
|
230
254
|
* Build allowed tools list with Linear MCP tools automatically included
|
|
231
255
|
*/
|
|
@@ -262,5 +286,9 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
262
286
|
* Post instant acknowledgment thought when receiving prompted webhook
|
|
263
287
|
*/
|
|
264
288
|
private postInstantPromptedAcknowledgment;
|
|
289
|
+
/**
|
|
290
|
+
* Fetch complete issue details from Linear API
|
|
291
|
+
*/
|
|
292
|
+
fetchFullIssueDetails(issueId: string, repositoryId: string): Promise<LinearIssue | null>;
|
|
265
293
|
}
|
|
266
294
|
//# sourceMappingURL=EdgeWorker.d.ts.map
|
package/dist/EdgeWorker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeWorker.d.ts","sourceRoot":"","sources":["../src/EdgeWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"EdgeWorker.d.ts","sourceRoot":"","sources":["../src/EdgeWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,EAGN,KAAK,KAAK,IAAI,WAAW,EACzB,MAAM,aAAa,CAAC;AAQrB,OAAO,KAAK,EAaX,2BAA2B,EAG3B,MAAM,YAAY,CAAC;AAcpB,OAAO,KAAK,EACX,gBAAgB,EAChB,gBAAgB,EAGhB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,OAAO,WAAW,UAAU;IAClC,EAAE,CAAC,CAAC,SAAS,MAAM,g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