cyrus-edge-worker 0.2.21 → 0.2.23
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/ActivityPoster.d.ts +15 -0
- package/dist/ActivityPoster.d.ts.map +1 -0
- package/dist/ActivityPoster.js +194 -0
- package/dist/ActivityPoster.js.map +1 -0
- package/dist/AgentSessionManager.d.ts +63 -21
- package/dist/AgentSessionManager.d.ts.map +1 -1
- package/dist/AgentSessionManager.js +413 -404
- package/dist/AgentSessionManager.js.map +1 -1
- package/dist/AskUserQuestionHandler.d.ts +3 -2
- package/dist/AskUserQuestionHandler.d.ts.map +1 -1
- package/dist/AskUserQuestionHandler.js +15 -12
- package/dist/AskUserQuestionHandler.js.map +1 -1
- package/dist/AttachmentService.d.ts +69 -0
- package/dist/AttachmentService.d.ts.map +1 -0
- package/dist/AttachmentService.js +369 -0
- package/dist/AttachmentService.js.map +1 -0
- package/dist/ChatSessionHandler.d.ts +87 -0
- package/dist/ChatSessionHandler.d.ts.map +1 -0
- package/dist/ChatSessionHandler.js +227 -0
- package/dist/ChatSessionHandler.js.map +1 -0
- package/dist/ConfigManager.d.ts +91 -0
- package/dist/ConfigManager.d.ts.map +1 -0
- package/dist/ConfigManager.js +229 -0
- package/dist/ConfigManager.js.map +1 -0
- package/dist/EdgeWorker.d.ts +152 -120
- package/dist/EdgeWorker.d.ts.map +1 -1
- package/dist/EdgeWorker.js +1335 -2125
- package/dist/EdgeWorker.js.map +1 -1
- package/dist/GitService.d.ts +14 -10
- package/dist/GitService.d.ts.map +1 -1
- package/dist/GitService.js +91 -12
- package/dist/GitService.js.map +1 -1
- package/dist/GlobalSessionRegistry.d.ts +142 -0
- package/dist/GlobalSessionRegistry.d.ts.map +1 -0
- package/dist/GlobalSessionRegistry.js +254 -0
- package/dist/GlobalSessionRegistry.js.map +1 -0
- package/dist/PromptBuilder.d.ts +182 -0
- package/dist/PromptBuilder.d.ts.map +1 -0
- package/dist/PromptBuilder.js +963 -0
- package/dist/PromptBuilder.js.map +1 -0
- package/dist/RepositoryRouter.d.ts +3 -2
- package/dist/RepositoryRouter.d.ts.map +1 -1
- package/dist/RepositoryRouter.js +39 -37
- package/dist/RepositoryRouter.js.map +1 -1
- package/dist/RunnerSelectionService.d.ts +71 -0
- package/dist/RunnerSelectionService.d.ts.map +1 -0
- package/dist/RunnerSelectionService.js +392 -0
- package/dist/RunnerSelectionService.js.map +1 -0
- package/dist/SharedApplicationServer.d.ts +3 -1
- package/dist/SharedApplicationServer.d.ts.map +1 -1
- package/dist/SharedApplicationServer.js +21 -17
- package/dist/SharedApplicationServer.js.map +1 -1
- package/dist/SharedWebhookServer.d.ts +3 -1
- package/dist/SharedWebhookServer.d.ts.map +1 -1
- package/dist/SharedWebhookServer.js +19 -16
- package/dist/SharedWebhookServer.js.map +1 -1
- package/dist/SlackChatAdapter.d.ts +25 -0
- package/dist/SlackChatAdapter.d.ts.map +1 -0
- package/dist/SlackChatAdapter.js +163 -0
- package/dist/SlackChatAdapter.js.map +1 -0
- package/dist/WorktreeIncludeService.d.ts +2 -9
- package/dist/WorktreeIncludeService.d.ts.map +1 -1
- package/dist/WorktreeIncludeService.js +3 -9
- package/dist/WorktreeIncludeService.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/label-prompt-template.md +6 -2
- package/dist/procedures/ProcedureAnalyzer.d.ts +6 -4
- package/dist/procedures/ProcedureAnalyzer.d.ts.map +1 -1
- package/dist/procedures/ProcedureAnalyzer.js +32 -12
- package/dist/procedures/ProcedureAnalyzer.js.map +1 -1
- package/dist/procedures/registry.d.ts +19 -19
- package/dist/procedures/registry.d.ts.map +1 -1
- package/dist/procedures/registry.js +19 -19
- package/dist/procedures/registry.js.map +1 -1
- package/dist/procedures/types.d.ts +1 -0
- package/dist/procedures/types.d.ts.map +1 -1
- package/dist/prompt-assembly/types.d.ts +2 -0
- package/dist/prompt-assembly/types.d.ts.map +1 -1
- package/dist/prompts/graphite-orchestrator.md +4 -2
- package/dist/prompts/orchestrator.md +5 -3
- package/dist/prompts/standard-issue-assigned-user-prompt.md +7 -0
- package/dist/prompts/subroutines/gh-pr.md +12 -0
- package/dist/sinks/IActivitySink.d.ts +60 -0
- package/dist/sinks/IActivitySink.d.ts.map +1 -0
- package/dist/sinks/IActivitySink.js +2 -0
- package/dist/sinks/IActivitySink.js.map +1 -0
- package/dist/sinks/LinearActivitySink.d.ts +69 -0
- package/dist/sinks/LinearActivitySink.d.ts.map +1 -0
- package/dist/sinks/LinearActivitySink.js +111 -0
- package/dist/sinks/LinearActivitySink.js.map +1 -0
- package/dist/sinks/NoopActivitySink.d.ts +13 -0
- package/dist/sinks/NoopActivitySink.d.ts.map +1 -0
- package/dist/sinks/NoopActivitySink.js +17 -0
- package/dist/sinks/NoopActivitySink.js.map +1 -0
- package/dist/sinks/index.d.ts +9 -0
- package/dist/sinks/index.d.ts.map +1 -0
- package/dist/sinks/index.js +8 -0
- package/dist/sinks/index.js.map +1 -0
- package/label-prompt-template.md +6 -2
- package/package.json +17 -11
- package/prompts/graphite-orchestrator.md +4 -2
- package/prompts/orchestrator.md +5 -3
- package/prompts/standard-issue-assigned-user-prompt.md +7 -0
package/dist/EdgeWorker.d.ts
CHANGED
|
@@ -19,14 +19,18 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
19
19
|
private agentSessionManagers;
|
|
20
20
|
private issueTrackers;
|
|
21
21
|
private linearEventTransport;
|
|
22
|
+
private gitHubEventTransport;
|
|
23
|
+
private slackEventTransport;
|
|
24
|
+
private chatSessionHandler;
|
|
25
|
+
private gitHubCommentService;
|
|
22
26
|
private cliRPCServer;
|
|
23
27
|
private configUpdater;
|
|
24
28
|
private persistenceManager;
|
|
25
29
|
private sharedApplicationServer;
|
|
26
30
|
private cyrusHome;
|
|
31
|
+
private globalSessionRegistry;
|
|
27
32
|
private childToParentAgentSession;
|
|
28
33
|
private procedureAnalyzer;
|
|
29
|
-
private configWatcher?;
|
|
30
34
|
private configPath?;
|
|
31
35
|
/** @internal - Exposed for testing only */
|
|
32
36
|
repositoryRouter: RepositoryRouter;
|
|
@@ -36,6 +40,17 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
36
40
|
private askUserQuestionHandler;
|
|
37
41
|
/** User access control for whitelisting/blacklisting Linear users */
|
|
38
42
|
private userAccessControl;
|
|
43
|
+
private logger;
|
|
44
|
+
private attachmentService;
|
|
45
|
+
private runnerSelectionService;
|
|
46
|
+
private activityPoster;
|
|
47
|
+
private configManager;
|
|
48
|
+
private promptBuilder;
|
|
49
|
+
private readonly cyrusToolsMcpEndpoint;
|
|
50
|
+
private cyrusToolsMcpRegistered;
|
|
51
|
+
private cyrusToolsMcpContexts;
|
|
52
|
+
private cyrusToolsMcpRequestContext;
|
|
53
|
+
private cyrusToolsMcpSessions;
|
|
39
54
|
constructor(config: EdgeWorkerConfig);
|
|
40
55
|
/**
|
|
41
56
|
* Start the edge worker
|
|
@@ -55,6 +70,47 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
55
70
|
* This endpoint is used by dashboards to display the installed CLI version
|
|
56
71
|
*/
|
|
57
72
|
private registerVersionEndpoint;
|
|
73
|
+
/**
|
|
74
|
+
* Register the GitHub event transport for receiving forwarded GitHub webhooks from CYHOST.
|
|
75
|
+
* This creates a /github-webhook endpoint that handles @cyrusagent mentions on GitHub PRs.
|
|
76
|
+
*/
|
|
77
|
+
private registerGitHubEventTransport;
|
|
78
|
+
/**
|
|
79
|
+
* Register the Slack event transport for receiving forwarded Slack webhooks from CYHOST.
|
|
80
|
+
* This creates a /slack-webhook endpoint that handles @mention events from Slack.
|
|
81
|
+
*/
|
|
82
|
+
private registerSlackEventTransport;
|
|
83
|
+
/**
|
|
84
|
+
* Handle a GitHub webhook event (forwarded from CYHOST).
|
|
85
|
+
*
|
|
86
|
+
* This creates a new session for the GitHub PR comment, checks out the PR branch
|
|
87
|
+
* via git worktree, and processes the comment as a task prompt.
|
|
88
|
+
*/
|
|
89
|
+
private handleGitHubWebhook;
|
|
90
|
+
/**
|
|
91
|
+
* Find a repository configuration that matches a GitHub repository URL.
|
|
92
|
+
* Matches against the githubUrl field in repository config.
|
|
93
|
+
*/
|
|
94
|
+
private findRepositoryByGitHubUrl;
|
|
95
|
+
/**
|
|
96
|
+
* Fetch the PR branch ref for an issue_comment webhook.
|
|
97
|
+
* For issue_comment events, the branch ref is not in the payload
|
|
98
|
+
* and must be fetched from the GitHub API.
|
|
99
|
+
*/
|
|
100
|
+
private fetchPRBranchRef;
|
|
101
|
+
/**
|
|
102
|
+
* Create a git worktree for a GitHub PR branch.
|
|
103
|
+
* If the worktree already exists for this branch, reuse it.
|
|
104
|
+
*/
|
|
105
|
+
private createGitHubWorkspace;
|
|
106
|
+
/**
|
|
107
|
+
* Build a system prompt for a GitHub PR comment session.
|
|
108
|
+
*/
|
|
109
|
+
private buildGitHubSystemPrompt;
|
|
110
|
+
/**
|
|
111
|
+
* Post a reply back to the GitHub PR comment after the session completes.
|
|
112
|
+
*/
|
|
113
|
+
private postGitHubReply;
|
|
58
114
|
/**
|
|
59
115
|
* Compute the current status of the Cyrus process
|
|
60
116
|
* @returns "idle" if the process can be safely restarted, "busy" if work is in progress
|
|
@@ -87,26 +143,6 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
87
143
|
* Handle validation loop rerun - re-run the verifications subroutine
|
|
88
144
|
*/
|
|
89
145
|
private handleValidationLoopRerun;
|
|
90
|
-
/**
|
|
91
|
-
* Start watching config file for changes
|
|
92
|
-
*/
|
|
93
|
-
private startConfigWatcher;
|
|
94
|
-
/**
|
|
95
|
-
* Handle configuration file changes
|
|
96
|
-
*/
|
|
97
|
-
private handleConfigChange;
|
|
98
|
-
/**
|
|
99
|
-
* Safely load configuration from file with validation
|
|
100
|
-
*/
|
|
101
|
-
private loadConfigSafely;
|
|
102
|
-
/**
|
|
103
|
-
* Detect changes between current and new repository configurations
|
|
104
|
-
*/
|
|
105
|
-
private detectRepositoryChanges;
|
|
106
|
-
/**
|
|
107
|
-
* Deep equality check for repository configs
|
|
108
|
-
*/
|
|
109
|
-
private deepEqual;
|
|
110
146
|
/**
|
|
111
147
|
* Add new repositories to the running EdgeWorker
|
|
112
148
|
*/
|
|
@@ -131,6 +167,49 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
131
167
|
* Handle webhook events from proxy - main router for all webhooks
|
|
132
168
|
*/
|
|
133
169
|
private handleWebhook;
|
|
170
|
+
/**
|
|
171
|
+
* Handle unified internal messages from the message bus.
|
|
172
|
+
* This is the new entry point for processing events from all platforms.
|
|
173
|
+
*
|
|
174
|
+
* Note: For now, this runs in parallel with legacy webhook handlers.
|
|
175
|
+
* Once migration is complete, legacy handlers will be removed.
|
|
176
|
+
*/
|
|
177
|
+
private handleMessage;
|
|
178
|
+
/**
|
|
179
|
+
* Handle session start message (unified handler for session creation).
|
|
180
|
+
*
|
|
181
|
+
* This is a placeholder that logs the message for now.
|
|
182
|
+
* TODO: Migrate logic from handleAgentSessionCreatedWebhook and handleGitHubWebhook.
|
|
183
|
+
*/
|
|
184
|
+
private handleSessionStartMessage;
|
|
185
|
+
/**
|
|
186
|
+
* Handle user prompt message (unified handler for mid-session prompts).
|
|
187
|
+
*
|
|
188
|
+
* This is a placeholder that logs the message for now.
|
|
189
|
+
* TODO: Migrate logic from handleUserPromptedAgentActivity (branch 3).
|
|
190
|
+
*/
|
|
191
|
+
private handleUserPromptMessage;
|
|
192
|
+
/**
|
|
193
|
+
* Handle stop signal message (unified handler for session termination).
|
|
194
|
+
*
|
|
195
|
+
* This is a placeholder that logs the message for now.
|
|
196
|
+
* TODO: Migrate logic from handleUserPromptedAgentActivity (branch 1).
|
|
197
|
+
*/
|
|
198
|
+
private handleStopSignalMessage;
|
|
199
|
+
/**
|
|
200
|
+
* Handle content update message (unified handler for issue/PR content changes).
|
|
201
|
+
*
|
|
202
|
+
* This is a placeholder that logs the message for now.
|
|
203
|
+
* TODO: Migrate logic from handleIssueContentUpdate.
|
|
204
|
+
*/
|
|
205
|
+
private handleContentUpdateMessage;
|
|
206
|
+
/**
|
|
207
|
+
* Handle unassign message (unified handler for task unassignment).
|
|
208
|
+
*
|
|
209
|
+
* This is a placeholder that logs the message for now.
|
|
210
|
+
* TODO: Migrate logic from handleIssueUnassignedWebhook.
|
|
211
|
+
*/
|
|
212
|
+
private handleUnassignMessage;
|
|
134
213
|
/**
|
|
135
214
|
* Handle issue unassignment webhook
|
|
136
215
|
*/
|
|
@@ -168,7 +247,7 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
168
247
|
private getIssueTrackerForWorkspace;
|
|
169
248
|
/**
|
|
170
249
|
* Create a new Linear agent session with all necessary setup
|
|
171
|
-
* @param
|
|
250
|
+
* @param sessionId The Linear agent activity session ID
|
|
172
251
|
* @param issue Linear issue object
|
|
173
252
|
* @param repository Repository configuration
|
|
174
253
|
* @param agentSessionManager Agent session manager instance
|
|
@@ -255,16 +334,28 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
255
334
|
*/
|
|
256
335
|
private fetchIssueLabels;
|
|
257
336
|
/**
|
|
258
|
-
*
|
|
259
|
-
*
|
|
337
|
+
* Resolve default model for a given runner from config with sensible built-in defaults.
|
|
338
|
+
* Supports legacy config keys for backwards compatibility.
|
|
339
|
+
*/
|
|
340
|
+
private getDefaultModelForRunner;
|
|
341
|
+
/**
|
|
342
|
+
* Resolve default fallback model for a given runner from config with sensible built-in defaults.
|
|
343
|
+
* Supports legacy Claude fallback key for backwards compatibility.
|
|
344
|
+
*/
|
|
345
|
+
private getDefaultFallbackModelForRunner;
|
|
346
|
+
/**
|
|
347
|
+
* Determine runner type and model using labels + issue description tags.
|
|
260
348
|
*
|
|
261
|
-
*
|
|
262
|
-
* -
|
|
263
|
-
* -
|
|
349
|
+
* Supported description tags:
|
|
350
|
+
* - [agent=claude|gemini|codex|cursor]
|
|
351
|
+
* - [model=<model-name>]
|
|
264
352
|
*
|
|
265
|
-
*
|
|
353
|
+
* Precedence:
|
|
354
|
+
* - Description tags override labels.
|
|
355
|
+
* - Agent selection and model selection are independent.
|
|
356
|
+
* - If agent is not explicit, model can infer runner type.
|
|
266
357
|
*/
|
|
267
|
-
private
|
|
358
|
+
private determineRunnerSelection;
|
|
268
359
|
/**
|
|
269
360
|
* Determine system prompt based on issue labels and repository configuration
|
|
270
361
|
*/
|
|
@@ -278,19 +369,6 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
278
369
|
* @returns Formatted prompt string
|
|
279
370
|
*/
|
|
280
371
|
private buildLabelBasedPrompt;
|
|
281
|
-
/**
|
|
282
|
-
* Generate routing context for orchestrator mode
|
|
283
|
-
*
|
|
284
|
-
* This provides the orchestrator with information about available repositories
|
|
285
|
-
* and how to route sub-issues to them. The context includes:
|
|
286
|
-
* - List of configured repositories in the workspace
|
|
287
|
-
* - Routing rules for each repository (labels, teams, projects)
|
|
288
|
-
* - Instructions on using description tags for explicit routing
|
|
289
|
-
*
|
|
290
|
-
* @param currentRepository The repository handling the current orchestrator issue
|
|
291
|
-
* @returns XML-formatted routing context string, or empty string if no routing info available
|
|
292
|
-
*/
|
|
293
|
-
private generateRoutingContext;
|
|
294
372
|
/**
|
|
295
373
|
* Build prompt for mention-triggered sessions
|
|
296
374
|
* @param issue Full Linear issue object
|
|
@@ -301,63 +379,10 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
301
379
|
* @returns The constructed prompt and optional version tag
|
|
302
380
|
*/
|
|
303
381
|
private buildMentionPrompt;
|
|
304
|
-
/**
|
|
305
|
-
* Extract version tag from template content
|
|
306
|
-
* @param templateContent The template content to parse
|
|
307
|
-
* @returns The version value if found, undefined otherwise
|
|
308
|
-
*/
|
|
309
|
-
private extractVersionTag;
|
|
310
|
-
/**
|
|
311
|
-
* Format agent guidance rules as markdown for injection into prompts
|
|
312
|
-
* @param guidance Array of guidance rules from Linear
|
|
313
|
-
* @returns Formatted markdown string with guidance, or empty string if no guidance
|
|
314
|
-
*/
|
|
315
|
-
private formatAgentGuidance;
|
|
316
|
-
/**
|
|
317
|
-
* Determine the base branch for an issue, considering parent issues and blocked-by relationships
|
|
318
|
-
*
|
|
319
|
-
* Priority order:
|
|
320
|
-
* 1. If issue has graphite label AND has a "blocked by" relationship, use the blocking issue's branch
|
|
321
|
-
* (This enables Graphite stacking where each sub-issue branches off the previous)
|
|
322
|
-
* 2. If issue has a parent, use the parent's branch
|
|
323
|
-
* 3. Fall back to repository's default base branch
|
|
324
|
-
*/
|
|
325
|
-
private determineBaseBranch;
|
|
326
382
|
/**
|
|
327
383
|
* Convert full Linear SDK issue to CoreIssue interface for Session creation
|
|
328
384
|
*/
|
|
329
385
|
private convertLinearIssueToCore;
|
|
330
|
-
/**
|
|
331
|
-
* Fetch issues that block this issue (i.e., issues this one is "blocked by")
|
|
332
|
-
* Uses the inverseRelations field with type "blocks"
|
|
333
|
-
*
|
|
334
|
-
* Linear relations work like this:
|
|
335
|
-
* - When Issue A "blocks" Issue B, a relation is created with:
|
|
336
|
-
* - issue = A (the blocker)
|
|
337
|
-
* - relatedIssue = B (the blocked one)
|
|
338
|
-
* - type = "blocks"
|
|
339
|
-
*
|
|
340
|
-
* So to find "who blocks Issue B", we need inverseRelations (where B is the relatedIssue)
|
|
341
|
-
* and look for type === "blocks", then get the `issue` field (the blocker).
|
|
342
|
-
*
|
|
343
|
-
* @param issue The issue to fetch blocking issues for
|
|
344
|
-
* @returns Array of issues that block this one, or empty array if none
|
|
345
|
-
*/
|
|
346
|
-
private fetchBlockingIssues;
|
|
347
|
-
/**
|
|
348
|
-
* Check if an issue has the graphite label
|
|
349
|
-
*
|
|
350
|
-
* @param issue The issue to check
|
|
351
|
-
* @param repository The repository configuration
|
|
352
|
-
* @returns True if the issue has the graphite label
|
|
353
|
-
*/
|
|
354
|
-
private hasGraphiteLabel;
|
|
355
|
-
/**
|
|
356
|
-
* Format Linear comments into a threaded structure that mirrors the Linear UI
|
|
357
|
-
* @param comments Array of Linear comments
|
|
358
|
-
* @returns Formatted string showing comment threads
|
|
359
|
-
*/
|
|
360
|
-
private formatCommentThreads;
|
|
361
386
|
/**
|
|
362
387
|
* Build a prompt for Claude using the improved XML-style template
|
|
363
388
|
* @param issue Full Linear issue
|
|
@@ -409,10 +434,6 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
409
434
|
/**
|
|
410
435
|
* Format todos as Linear checklist markdown
|
|
411
436
|
*/
|
|
412
|
-
/**
|
|
413
|
-
* Extract attachment URLs from text (issue description or comment)
|
|
414
|
-
*/
|
|
415
|
-
private extractAttachmentUrls;
|
|
416
437
|
/**
|
|
417
438
|
* Download attachments from Linear issue
|
|
418
439
|
* @param issue Linear issue object from webhook data
|
|
@@ -420,10 +441,6 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
420
441
|
* @param workspacePath Path to workspace directory
|
|
421
442
|
*/
|
|
422
443
|
private downloadIssueAttachments;
|
|
423
|
-
/**
|
|
424
|
-
* Download a single attachment from Linear
|
|
425
|
-
*/
|
|
426
|
-
private downloadAttachment;
|
|
427
444
|
/**
|
|
428
445
|
* Download attachments from a specific comment
|
|
429
446
|
* @param commentBody The body text of the comment
|
|
@@ -432,26 +449,23 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
432
449
|
* @param existingAttachmentCount Current number of attachments already downloaded
|
|
433
450
|
*/
|
|
434
451
|
private downloadCommentAttachments;
|
|
435
|
-
/**
|
|
436
|
-
* Count existing images in the attachments directory
|
|
437
|
-
*/
|
|
438
|
-
private countExistingImages;
|
|
439
452
|
/**
|
|
440
453
|
* Generate attachment manifest for new comment attachments
|
|
441
454
|
*/
|
|
442
455
|
private generateNewAttachmentManifest;
|
|
456
|
+
private registerCyrusToolsMcpEndpoint;
|
|
457
|
+
private createCyrusToolsOptions;
|
|
458
|
+
private handleChildSessionMapping;
|
|
459
|
+
private handleFeedbackDeliveryToChildSession;
|
|
460
|
+
private buildCyrusToolsMcpContextId;
|
|
461
|
+
private getCyrusToolsMcpUrl;
|
|
462
|
+
private pruneCyrusToolsMcpContexts;
|
|
443
463
|
/**
|
|
444
|
-
*
|
|
445
|
-
*/
|
|
446
|
-
private generateAttachmentManifest;
|
|
447
|
-
/**
|
|
448
|
-
* Build MCP configuration with automatic Linear server injection and inline cyrus tools
|
|
464
|
+
* Build MCP configuration with automatic Linear server injection and cyrus-tools over Fastify MCP.
|
|
449
465
|
*/
|
|
450
466
|
private buildMcpConfig;
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
*/
|
|
454
|
-
private resolveToolPreset;
|
|
467
|
+
private getCyrusToolsMcpAuthorizationHeaderValue;
|
|
468
|
+
private isCyrusToolsMcpAuthorizationValid;
|
|
455
469
|
/**
|
|
456
470
|
* Build the complete prompt for a session - shows full prompt assembly in one place
|
|
457
471
|
*
|
|
@@ -503,6 +517,12 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
503
517
|
* Adapter method for prompt assembly - routes to appropriate issue context builder
|
|
504
518
|
*/
|
|
505
519
|
private buildIssueContextForPromptAssembly;
|
|
520
|
+
/**
|
|
521
|
+
* Resolve the default runner type for SimpleRunner (classification) use.
|
|
522
|
+
* Uses config.defaultRunner if set, otherwise auto-detects from API keys,
|
|
523
|
+
* falling back to "claude".
|
|
524
|
+
*/
|
|
525
|
+
private resolveDefaultSimpleRunnerType;
|
|
506
526
|
/**
|
|
507
527
|
* Build agent runner configuration with common settings.
|
|
508
528
|
* Also determines which runner type to use based on labels.
|
|
@@ -569,6 +589,14 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
569
589
|
* Restore EdgeWorker mappings from serialized state
|
|
570
590
|
*/
|
|
571
591
|
restoreMappings(state: SerializableEdgeWorkerState): void;
|
|
592
|
+
/**
|
|
593
|
+
* Post an activity directly via an issue tracker instance.
|
|
594
|
+
* Consolidates try/catch and success/error logging for EdgeWorker call sites
|
|
595
|
+
* that already have the issueTracker and agentSessionId resolved.
|
|
596
|
+
*
|
|
597
|
+
* @returns The activity ID when resolved, `null` otherwise.
|
|
598
|
+
*/
|
|
599
|
+
private postActivityDirect;
|
|
572
600
|
/**
|
|
573
601
|
* Post instant acknowledgment thought when agent session is created
|
|
574
602
|
*/
|
|
@@ -578,7 +606,7 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
578
606
|
*/
|
|
579
607
|
private postParentResumeAcknowledgment;
|
|
580
608
|
/**
|
|
581
|
-
* Post repository selection activity
|
|
609
|
+
* Post repository selection activity
|
|
582
610
|
* Shows which method was used to select the repository (auto-routing or user selection)
|
|
583
611
|
*/
|
|
584
612
|
private postRepositorySelectionActivity;
|
|
@@ -597,7 +625,7 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
597
625
|
*
|
|
598
626
|
* @param session The Cyrus agent session
|
|
599
627
|
* @param repository Repository configuration
|
|
600
|
-
* @param
|
|
628
|
+
* @param sessionId Linear agent activity session ID
|
|
601
629
|
* @param agentSessionManager Agent session manager instance
|
|
602
630
|
* @param promptBody The prompt text to send
|
|
603
631
|
* @param attachmentManifest Optional attachment manifest to append
|
|
@@ -616,17 +644,21 @@ export declare class EdgeWorker extends EventEmitter {
|
|
|
616
644
|
* This is the core logic for handling prompted agent activities
|
|
617
645
|
* @param session The Cyrus agent session
|
|
618
646
|
* @param repository The repository configuration
|
|
619
|
-
* @param
|
|
647
|
+
* @param sessionId The Linear agent session ID
|
|
620
648
|
* @param agentSessionManager The agent session manager
|
|
621
649
|
* @param promptBody The prompt text to send
|
|
622
650
|
* @param attachmentManifest Optional attachment manifest
|
|
623
651
|
* @param isNewSession Whether this is a new session
|
|
624
652
|
*/
|
|
625
|
-
resumeAgentSession(session: CyrusAgentSession, repository: RepositoryConfig,
|
|
653
|
+
resumeAgentSession(session: CyrusAgentSession, repository: RepositoryConfig, sessionId: string, agentSessionManager: AgentSessionManager, promptBody: string, attachmentManifest?: string, isNewSession?: boolean, additionalAllowedDirectories?: string[], maxTurns?: number, commentAuthor?: string, commentTimestamp?: string): Promise<void>;
|
|
626
654
|
/**
|
|
627
655
|
* Post instant acknowledgment thought when receiving prompted webhook
|
|
628
656
|
*/
|
|
629
657
|
private postInstantPromptedAcknowledgment;
|
|
658
|
+
/**
|
|
659
|
+
* Get the platform type for a repository's issue tracker.
|
|
660
|
+
*/
|
|
661
|
+
private getRepositoryPlatform;
|
|
630
662
|
/**
|
|
631
663
|
* Fetch complete issue details from Linear API
|
|
632
664
|
*/
|
package/dist/EdgeWorker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeWorker.d.ts","sourceRoot":"","sources":["../src/EdgeWorker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EdgeWorker.d.ts","sourceRoot":"","sources":["../src/EdgeWorker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAc3C,OAAO,KAAK,EAOX,iBAAiB,EACjB,gBAAgB,EAMhB,KAAK,EAIL,gBAAgB,EAChB,2BAA2B,EAW3B,MAAM,YAAY,CAAC;AA0DpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAqB/D,OAAO,EACN,gBAAgB,EAEhB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGrE,MAAM,CAAC,OAAO,WAAW,UAAU;IAClC,EAAE,CAAC,CAAC,SAAS,MAAM,gBAAgB,EAClC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC3B,IAAI,CAAC;IACR,IAAI,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACpC,KAAK,EAAE,CAAC,EACR,GAAG,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GACtC,OAAO,CAAC;CACX;AAcD;;;;;GAKG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,YAAY,CAA4C;IAChE,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