cyrus-edge-worker 0.0.23 → 0.0.25
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 -13
- package/dist/EdgeWorker.d.ts.map +1 -1
- package/dist/EdgeWorker.js +351 -174
- package/dist/EdgeWorker.js.map +1 -1
- package/dist/types.d.ts +40 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -5
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,9 +51,23 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
50
51
|
private handleIssueUnassignedWebhook;
|
|
51
52
|
/**
|
|
52
53
|
* Find the repository configuration for a webhook
|
|
53
|
-
* Now supports async operations for label-based routing
|
|
54
|
+
* Now supports async operations for label-based and project-based routing
|
|
55
|
+
* Priority: routingLabels > projectKeys > teamKeys
|
|
54
56
|
*/
|
|
55
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;
|
|
56
71
|
/**
|
|
57
72
|
* Handle agent session created webhook
|
|
58
73
|
* . Can happen due to being 'delegated' or @ mentioned in a new thread
|
|
@@ -82,10 +97,6 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
82
97
|
* TODO: improve this
|
|
83
98
|
*/
|
|
84
99
|
private handleClaudeError;
|
|
85
|
-
/**
|
|
86
|
-
* Fetch complete issue details from Linear API
|
|
87
|
-
*/
|
|
88
|
-
private fetchFullIssueDetails;
|
|
89
100
|
/**
|
|
90
101
|
* Fetch issue labels for a given issue
|
|
91
102
|
*/
|
|
@@ -116,14 +127,6 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
116
127
|
* @returns The version value if found, undefined otherwise
|
|
117
128
|
*/
|
|
118
129
|
private extractVersionTag;
|
|
119
|
-
/**
|
|
120
|
-
* Convert full Linear SDK issue to CoreIssue interface for Session creation
|
|
121
|
-
*/
|
|
122
|
-
private convertLinearIssueToCore;
|
|
123
|
-
/**
|
|
124
|
-
* Sanitize branch name by removing backticks to prevent command injection
|
|
125
|
-
*/
|
|
126
|
-
private sanitizeBranchName;
|
|
127
130
|
/**
|
|
128
131
|
* Check if a branch exists locally or remotely
|
|
129
132
|
*/
|
|
@@ -132,6 +135,14 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
132
135
|
* Determine the base branch for an issue, considering parent issues
|
|
133
136
|
*/
|
|
134
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;
|
|
135
146
|
/**
|
|
136
147
|
* Format Linear comments into a threaded structure that mirrors the Linear UI
|
|
137
148
|
* @param comments Array of Linear comments
|
|
@@ -227,6 +238,18 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
227
238
|
* Build MCP configuration with automatic Linear server injection
|
|
228
239
|
*/
|
|
229
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;
|
|
230
253
|
/**
|
|
231
254
|
* Build allowed tools list with Linear MCP tools automatically included
|
|
232
255
|
*/
|
|
@@ -263,5 +286,9 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
263
286
|
* Post instant acknowledgment thought when receiving prompted webhook
|
|
264
287
|
*/
|
|
265
288
|
private postInstantPromptedAcknowledgment;
|
|
289
|
+
/**
|
|
290
|
+
* Fetch complete issue details from Linear API
|
|
291
|
+
*/
|
|
292
|
+
fetchFullIssueDetails(issueId: string, repositoryId: string): Promise<LinearIssue | null>;
|
|
266
293
|
}
|
|
267
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,E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