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.
Files changed (106) hide show
  1. package/dist/ActivityPoster.d.ts +15 -0
  2. package/dist/ActivityPoster.d.ts.map +1 -0
  3. package/dist/ActivityPoster.js +194 -0
  4. package/dist/ActivityPoster.js.map +1 -0
  5. package/dist/AgentSessionManager.d.ts +63 -21
  6. package/dist/AgentSessionManager.d.ts.map +1 -1
  7. package/dist/AgentSessionManager.js +413 -404
  8. package/dist/AgentSessionManager.js.map +1 -1
  9. package/dist/AskUserQuestionHandler.d.ts +3 -2
  10. package/dist/AskUserQuestionHandler.d.ts.map +1 -1
  11. package/dist/AskUserQuestionHandler.js +15 -12
  12. package/dist/AskUserQuestionHandler.js.map +1 -1
  13. package/dist/AttachmentService.d.ts +69 -0
  14. package/dist/AttachmentService.d.ts.map +1 -0
  15. package/dist/AttachmentService.js +369 -0
  16. package/dist/AttachmentService.js.map +1 -0
  17. package/dist/ChatSessionHandler.d.ts +87 -0
  18. package/dist/ChatSessionHandler.d.ts.map +1 -0
  19. package/dist/ChatSessionHandler.js +227 -0
  20. package/dist/ChatSessionHandler.js.map +1 -0
  21. package/dist/ConfigManager.d.ts +91 -0
  22. package/dist/ConfigManager.d.ts.map +1 -0
  23. package/dist/ConfigManager.js +229 -0
  24. package/dist/ConfigManager.js.map +1 -0
  25. package/dist/EdgeWorker.d.ts +152 -120
  26. package/dist/EdgeWorker.d.ts.map +1 -1
  27. package/dist/EdgeWorker.js +1335 -2125
  28. package/dist/EdgeWorker.js.map +1 -1
  29. package/dist/GitService.d.ts +14 -10
  30. package/dist/GitService.d.ts.map +1 -1
  31. package/dist/GitService.js +91 -12
  32. package/dist/GitService.js.map +1 -1
  33. package/dist/GlobalSessionRegistry.d.ts +142 -0
  34. package/dist/GlobalSessionRegistry.d.ts.map +1 -0
  35. package/dist/GlobalSessionRegistry.js +254 -0
  36. package/dist/GlobalSessionRegistry.js.map +1 -0
  37. package/dist/PromptBuilder.d.ts +182 -0
  38. package/dist/PromptBuilder.d.ts.map +1 -0
  39. package/dist/PromptBuilder.js +963 -0
  40. package/dist/PromptBuilder.js.map +1 -0
  41. package/dist/RepositoryRouter.d.ts +3 -2
  42. package/dist/RepositoryRouter.d.ts.map +1 -1
  43. package/dist/RepositoryRouter.js +39 -37
  44. package/dist/RepositoryRouter.js.map +1 -1
  45. package/dist/RunnerSelectionService.d.ts +71 -0
  46. package/dist/RunnerSelectionService.d.ts.map +1 -0
  47. package/dist/RunnerSelectionService.js +392 -0
  48. package/dist/RunnerSelectionService.js.map +1 -0
  49. package/dist/SharedApplicationServer.d.ts +3 -1
  50. package/dist/SharedApplicationServer.d.ts.map +1 -1
  51. package/dist/SharedApplicationServer.js +21 -17
  52. package/dist/SharedApplicationServer.js.map +1 -1
  53. package/dist/SharedWebhookServer.d.ts +3 -1
  54. package/dist/SharedWebhookServer.d.ts.map +1 -1
  55. package/dist/SharedWebhookServer.js +19 -16
  56. package/dist/SharedWebhookServer.js.map +1 -1
  57. package/dist/SlackChatAdapter.d.ts +25 -0
  58. package/dist/SlackChatAdapter.d.ts.map +1 -0
  59. package/dist/SlackChatAdapter.js +163 -0
  60. package/dist/SlackChatAdapter.js.map +1 -0
  61. package/dist/WorktreeIncludeService.d.ts +2 -9
  62. package/dist/WorktreeIncludeService.d.ts.map +1 -1
  63. package/dist/WorktreeIncludeService.js +3 -9
  64. package/dist/WorktreeIncludeService.js.map +1 -1
  65. package/dist/index.d.ts +7 -2
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +4 -0
  68. package/dist/index.js.map +1 -1
  69. package/dist/label-prompt-template.md +6 -2
  70. package/dist/procedures/ProcedureAnalyzer.d.ts +6 -4
  71. package/dist/procedures/ProcedureAnalyzer.d.ts.map +1 -1
  72. package/dist/procedures/ProcedureAnalyzer.js +32 -12
  73. package/dist/procedures/ProcedureAnalyzer.js.map +1 -1
  74. package/dist/procedures/registry.d.ts +19 -19
  75. package/dist/procedures/registry.d.ts.map +1 -1
  76. package/dist/procedures/registry.js +19 -19
  77. package/dist/procedures/registry.js.map +1 -1
  78. package/dist/procedures/types.d.ts +1 -0
  79. package/dist/procedures/types.d.ts.map +1 -1
  80. package/dist/prompt-assembly/types.d.ts +2 -0
  81. package/dist/prompt-assembly/types.d.ts.map +1 -1
  82. package/dist/prompts/graphite-orchestrator.md +4 -2
  83. package/dist/prompts/orchestrator.md +5 -3
  84. package/dist/prompts/standard-issue-assigned-user-prompt.md +7 -0
  85. package/dist/prompts/subroutines/gh-pr.md +12 -0
  86. package/dist/sinks/IActivitySink.d.ts +60 -0
  87. package/dist/sinks/IActivitySink.d.ts.map +1 -0
  88. package/dist/sinks/IActivitySink.js +2 -0
  89. package/dist/sinks/IActivitySink.js.map +1 -0
  90. package/dist/sinks/LinearActivitySink.d.ts +69 -0
  91. package/dist/sinks/LinearActivitySink.d.ts.map +1 -0
  92. package/dist/sinks/LinearActivitySink.js +111 -0
  93. package/dist/sinks/LinearActivitySink.js.map +1 -0
  94. package/dist/sinks/NoopActivitySink.d.ts +13 -0
  95. package/dist/sinks/NoopActivitySink.d.ts.map +1 -0
  96. package/dist/sinks/NoopActivitySink.js +17 -0
  97. package/dist/sinks/NoopActivitySink.js.map +1 -0
  98. package/dist/sinks/index.d.ts +9 -0
  99. package/dist/sinks/index.d.ts.map +1 -0
  100. package/dist/sinks/index.js +8 -0
  101. package/dist/sinks/index.js.map +1 -0
  102. package/label-prompt-template.md +6 -2
  103. package/package.json +17 -11
  104. package/prompts/graphite-orchestrator.md +4 -2
  105. package/prompts/orchestrator.md +5 -3
  106. package/prompts/standard-issue-assigned-user-prompt.md +7 -0
@@ -0,0 +1,60 @@
1
+ import type { AgentActivityContent } from "cyrus-core";
2
+ /**
3
+ * String literal type for activity signals.
4
+ * Maps to platform-specific signal enums (e.g., Linear's AgentActivitySignal).
5
+ */
6
+ export type ActivitySignal = "auth" | "select" | "stop" | "continue";
7
+ /**
8
+ * Options for posting an activity.
9
+ */
10
+ export interface ActivityPostOptions {
11
+ /** Whether the activity is ephemeral (disappears when replaced by next activity) */
12
+ ephemeral?: boolean;
13
+ /** Signal modifier for how the activity should be interpreted */
14
+ signal?: ActivitySignal;
15
+ /** Additional metadata for the signal */
16
+ signalMetadata?: Record<string, unknown>;
17
+ }
18
+ /**
19
+ * Result of posting an activity.
20
+ */
21
+ export interface ActivityPostResult {
22
+ /** The ID of the created activity, if available */
23
+ activityId?: string;
24
+ }
25
+ /**
26
+ * Interface for activity sinks that receive and process agent session activities.
27
+ *
28
+ * IActivitySink decouples activity posting from IIssueTrackerService, enabling
29
+ * multiple activity sinks (Linear workspaces, GitHub, etc.) to receive session
30
+ * activities based on session context.
31
+ *
32
+ * Implementations should:
33
+ * - Provide a unique identifier (workspace ID, org ID, etc.)
34
+ * - Support posting activities to agent sessions
35
+ * - Support creating new agent sessions on issues
36
+ */
37
+ export interface IActivitySink {
38
+ /**
39
+ * Unique identifier for this sink (e.g., Linear workspace ID, GitHub org ID).
40
+ * Used by GlobalSessionRegistry to route activities to the correct sink.
41
+ */
42
+ readonly id: string;
43
+ /**
44
+ * Post an activity to an existing agent session.
45
+ *
46
+ * @param sessionId - The agent session ID to post to
47
+ * @param activity - The activity content (thought, action, response, error, etc.)
48
+ * @param options - Optional settings for ephemeral, signal, signalMetadata
49
+ * @returns Promise that resolves with the result of the activity post
50
+ */
51
+ postActivity(sessionId: string, activity: AgentActivityContent, options?: ActivityPostOptions): Promise<ActivityPostResult>;
52
+ /**
53
+ * Create a new agent session on an issue.
54
+ *
55
+ * @param issueId - The issue ID to attach the session to
56
+ * @returns Promise that resolves with the created session ID
57
+ */
58
+ createAgentSession(issueId: string): Promise<string>;
59
+ }
60
+ //# sourceMappingURL=IActivitySink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IActivitySink.d.ts","sourceRoot":"","sources":["../../src/sinks/IActivitySink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,YAAY,CACX,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE/B;;;;;OAKG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IActivitySink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IActivitySink.js","sourceRoot":"","sources":["../../src/sinks/IActivitySink.ts"],"names":[],"mappings":""}
@@ -0,0 +1,69 @@
1
+ import { type AgentActivityContent, type IIssueTrackerService } from "cyrus-core";
2
+ import type { ActivityPostOptions, ActivityPostResult, IActivitySink } from "./IActivitySink.js";
3
+ /**
4
+ * Linear-specific implementation of IActivitySink.
5
+ *
6
+ * LinearActivitySink wraps an IIssueTrackerService instance to provide activity
7
+ * sink functionality for Linear workspaces. It delegates activity posting and
8
+ * session creation to the underlying issue tracker service.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const issueTracker = new LinearIssueTrackerService(linearClient, {
13
+ * workspaceId: 'workspace-123',
14
+ * // ... other OAuth config
15
+ * });
16
+ *
17
+ * const sink = new LinearActivitySink(issueTracker, 'workspace-123');
18
+ *
19
+ * // Create a session
20
+ * const sessionId = await sink.createAgentSession('issue-id-456');
21
+ *
22
+ * // Post activities
23
+ * const result = await sink.postActivity(sessionId, {
24
+ * type: 'thought',
25
+ * body: 'Analyzing the issue...'
26
+ * });
27
+ * ```
28
+ */
29
+ export declare class LinearActivitySink implements IActivitySink {
30
+ /**
31
+ * Unique identifier for this sink (Linear workspace ID).
32
+ */
33
+ readonly id: string;
34
+ private readonly issueTracker;
35
+ /**
36
+ * Create a new LinearActivitySink.
37
+ *
38
+ * @param issueTracker - The IIssueTrackerService instance to delegate to
39
+ * @param workspaceId - The Linear workspace ID (used as sink ID)
40
+ */
41
+ constructor(issueTracker: IIssueTrackerService, workspaceId: string);
42
+ /**
43
+ * Map a platform-agnostic ActivitySignal string to Linear's AgentActivitySignal enum.
44
+ */
45
+ private mapSignal;
46
+ /**
47
+ * Post an activity to an existing agent session.
48
+ *
49
+ * Wraps IIssueTrackerService.createAgentActivity() to provide a simplified
50
+ * interface for activity posting.
51
+ *
52
+ * @param sessionId - The agent session ID to post to
53
+ * @param activity - The activity content (thought, action, response, error, etc.)
54
+ * @param options - Optional settings for ephemeral, signal, signalMetadata
55
+ * @returns Promise that resolves with the activity post result
56
+ */
57
+ postActivity(sessionId: string, activity: AgentActivityContent, options?: ActivityPostOptions): Promise<ActivityPostResult>;
58
+ /**
59
+ * Create a new agent session on an issue.
60
+ *
61
+ * Wraps IIssueTrackerService.createAgentSessionOnIssue() to provide a simplified
62
+ * interface for session creation.
63
+ *
64
+ * @param issueId - The issue ID to attach the session to
65
+ * @returns Promise that resolves with the created session ID
66
+ */
67
+ createAgentSession(issueId: string): Promise<string>;
68
+ }
69
+ //# sourceMappingURL=LinearActivitySink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinearActivitySink.d.ts","sourceRoot":"","sources":["../../src/sinks/LinearActivitySink.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EACzB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACX,mBAAmB,EACnB,kBAAkB,EAElB,aAAa,EACb,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,kBAAmB,YAAW,aAAa;IACvD;;OAEG;IACH,SAAgB,EAAE,EAAE,MAAM,CAAC;IAE3B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;IAEpD;;;;;OAKG;gBACS,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM;IAKnE;;OAEG;IACH,OAAO,CAAC,SAAS;IAajB;;;;;;;;;;OAUG;IACG,YAAY,CACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC;IAmB9B;;;;;;;;OAQG;IACG,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAqB1D"}
@@ -0,0 +1,111 @@
1
+ import { AgentActivitySignal, } from "cyrus-core";
2
+ /**
3
+ * Linear-specific implementation of IActivitySink.
4
+ *
5
+ * LinearActivitySink wraps an IIssueTrackerService instance to provide activity
6
+ * sink functionality for Linear workspaces. It delegates activity posting and
7
+ * session creation to the underlying issue tracker service.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const issueTracker = new LinearIssueTrackerService(linearClient, {
12
+ * workspaceId: 'workspace-123',
13
+ * // ... other OAuth config
14
+ * });
15
+ *
16
+ * const sink = new LinearActivitySink(issueTracker, 'workspace-123');
17
+ *
18
+ * // Create a session
19
+ * const sessionId = await sink.createAgentSession('issue-id-456');
20
+ *
21
+ * // Post activities
22
+ * const result = await sink.postActivity(sessionId, {
23
+ * type: 'thought',
24
+ * body: 'Analyzing the issue...'
25
+ * });
26
+ * ```
27
+ */
28
+ export class LinearActivitySink {
29
+ /**
30
+ * Unique identifier for this sink (Linear workspace ID).
31
+ */
32
+ id;
33
+ issueTracker;
34
+ /**
35
+ * Create a new LinearActivitySink.
36
+ *
37
+ * @param issueTracker - The IIssueTrackerService instance to delegate to
38
+ * @param workspaceId - The Linear workspace ID (used as sink ID)
39
+ */
40
+ constructor(issueTracker, workspaceId) {
41
+ this.issueTracker = issueTracker;
42
+ this.id = workspaceId;
43
+ }
44
+ /**
45
+ * Map a platform-agnostic ActivitySignal string to Linear's AgentActivitySignal enum.
46
+ */
47
+ mapSignal(signal) {
48
+ switch (signal) {
49
+ case "auth":
50
+ return AgentActivitySignal.Auth;
51
+ case "select":
52
+ return AgentActivitySignal.Select;
53
+ case "stop":
54
+ return AgentActivitySignal.Stop;
55
+ case "continue":
56
+ return AgentActivitySignal.Continue;
57
+ }
58
+ }
59
+ /**
60
+ * Post an activity to an existing agent session.
61
+ *
62
+ * Wraps IIssueTrackerService.createAgentActivity() to provide a simplified
63
+ * interface for activity posting.
64
+ *
65
+ * @param sessionId - The agent session ID to post to
66
+ * @param activity - The activity content (thought, action, response, error, etc.)
67
+ * @param options - Optional settings for ephemeral, signal, signalMetadata
68
+ * @returns Promise that resolves with the activity post result
69
+ */
70
+ async postActivity(sessionId, activity, options) {
71
+ const result = await this.issueTracker.createAgentActivity({
72
+ agentSessionId: sessionId,
73
+ content: activity,
74
+ ...(options?.ephemeral !== undefined && { ephemeral: options.ephemeral }),
75
+ ...(options?.signal && { signal: this.mapSignal(options.signal) }),
76
+ ...(options?.signalMetadata && {
77
+ signalMetadata: options.signalMetadata,
78
+ }),
79
+ });
80
+ if (result.success && result.agentActivity) {
81
+ const agentActivity = await result.agentActivity;
82
+ return { activityId: agentActivity.id };
83
+ }
84
+ return {};
85
+ }
86
+ /**
87
+ * Create a new agent session on an issue.
88
+ *
89
+ * Wraps IIssueTrackerService.createAgentSessionOnIssue() to provide a simplified
90
+ * interface for session creation.
91
+ *
92
+ * @param issueId - The issue ID to attach the session to
93
+ * @returns Promise that resolves with the created session ID
94
+ */
95
+ async createAgentSession(issueId) {
96
+ const result = await this.issueTracker.createAgentSessionOnIssue({
97
+ issueId,
98
+ });
99
+ if (!result.success) {
100
+ throw new Error(`Failed to create agent session for issue ${issueId}: request was not successful`);
101
+ }
102
+ // Extract session ID from the result
103
+ // Result has `agentSession` property that may be a Promise
104
+ const session = await result.agentSession;
105
+ if (!session) {
106
+ throw new Error(`Failed to create agent session for issue ${issueId}: session is undefined`);
107
+ }
108
+ return session.id;
109
+ }
110
+ }
111
+ //# sourceMappingURL=LinearActivitySink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinearActivitySink.js","sourceRoot":"","sources":["../../src/sinks/LinearActivitySink.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,mBAAmB,GAEnB,MAAM,YAAY,CAAC;AAQpB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,kBAAkB;IAC9B;;OAEG;IACa,EAAE,CAAS;IAEV,YAAY,CAAuB;IAEpD;;;;;OAKG;IACH,YAAY,YAAkC,EAAE,WAAmB;QAClE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,EAAE,GAAG,WAAW,CAAC;IACvB,CAAC;IAED;;OAEG;IACK,SAAS,CAAC,MAAsB;QACvC,QAAQ,MAAM,EAAE,CAAC;YAChB,KAAK,MAAM;gBACV,OAAO,mBAAmB,CAAC,IAAI,CAAC;YACjC,KAAK,QAAQ;gBACZ,OAAO,mBAAmB,CAAC,MAAM,CAAC;YACnC,KAAK,MAAM;gBACV,OAAO,mBAAmB,CAAC,IAAI,CAAC;YACjC,KAAK,UAAU;gBACd,OAAO,mBAAmB,CAAC,QAAQ,CAAC;QACtC,CAAC;IACF,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,YAAY,CACjB,SAAiB,EACjB,QAA8B,EAC9B,OAA6B;QAE7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC;YAC1D,cAAc,EAAE,SAAS;YACzB,OAAO,EAAE,QAAQ;YACjB,GAAG,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;YACzE,GAAG,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAClE,GAAG,CAAC,OAAO,EAAE,cAAc,IAAI;gBAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;aACtC,CAAC;SACF,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YAC5C,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;YACjD,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC;QACzC,CAAC;QAED,OAAO,EAAE,CAAC;IACX,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,kBAAkB,CAAC,OAAe;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC;YAChE,OAAO;SACP,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACd,4CAA4C,OAAO,8BAA8B,CACjF,CAAC;QACH,CAAC;QAED,qCAAqC;QACrC,2DAA2D;QAC3D,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACd,4CAA4C,OAAO,wBAAwB,CAC3E,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC,EAAE,CAAC;IACnB,CAAC;CACD"}
@@ -0,0 +1,13 @@
1
+ import type { AgentActivityContent } from "cyrus-core";
2
+ import type { ActivityPostOptions, ActivityPostResult, IActivitySink } from "./IActivitySink.js";
3
+ /**
4
+ * A no-op activity sink that silently discards all activities.
5
+ * Used for platforms like Slack where activities are not posted to an external tracker.
6
+ */
7
+ export declare class NoopActivitySink implements IActivitySink {
8
+ readonly id: string;
9
+ constructor(id?: string);
10
+ postActivity(_sessionId: string, _activity: AgentActivityContent, _options?: ActivityPostOptions): Promise<ActivityPostResult>;
11
+ createAgentSession(_issueId: string): Promise<string>;
12
+ }
13
+ //# sourceMappingURL=NoopActivitySink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopActivitySink.d.ts","sourceRoot":"","sources":["../../src/sinks/NoopActivitySink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EACX,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,aAAa;IACrD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBAER,EAAE,SAAS;IAIjB,YAAY,CACjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,kBAAkB,CAAC;IAIxB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG3D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A no-op activity sink that silently discards all activities.
3
+ * Used for platforms like Slack where activities are not posted to an external tracker.
4
+ */
5
+ export class NoopActivitySink {
6
+ id;
7
+ constructor(id = "noop") {
8
+ this.id = id;
9
+ }
10
+ async postActivity(_sessionId, _activity, _options) {
11
+ return {};
12
+ }
13
+ async createAgentSession(_issueId) {
14
+ return "";
15
+ }
16
+ }
17
+ //# sourceMappingURL=NoopActivitySink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopActivitySink.js","sourceRoot":"","sources":["../../src/sinks/NoopActivitySink.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IACnB,EAAE,CAAS;IAEpB,YAAY,EAAE,GAAG,MAAM;QACtB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,CAAC;IAED,KAAK,CAAC,YAAY,CACjB,UAAkB,EAClB,SAA+B,EAC/B,QAA8B;QAE9B,OAAO,EAAE,CAAC;IACX,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAgB;QACxC,OAAO,EAAE,CAAC;IACX,CAAC;CACD"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Activity sinks for posting agent session activities to various platforms.
3
+ *
4
+ * @module sinks
5
+ */
6
+ export type { ActivityPostOptions, ActivityPostResult, ActivitySignal, IActivitySink, } from "./IActivitySink.js";
7
+ export { LinearActivitySink } from "./LinearActivitySink.js";
8
+ export { NoopActivitySink } from "./NoopActivitySink.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sinks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACX,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,aAAa,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Activity sinks for posting agent session activities to various platforms.
3
+ *
4
+ * @module sinks
5
+ */
6
+ export { LinearActivitySink } from "./LinearActivitySink.js";
7
+ export { NoopActivitySink } from "./NoopActivitySink.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sinks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -10,8 +10,12 @@
10
10
  <description>{{issue_description}}</description>
11
11
  <url>{{issue_url}}</url>
12
12
  <assignee>
13
- <id>{{assignee_id}}</id>
14
- <name>{{assignee_name}}</name>
13
+ <linear_id>{{assignee_id}}</linear_id>
14
+ <linear_display_name>{{assignee_name}}</linear_display_name>
15
+ <linear_profile_url>{{assignee_linear_profile_url}}</linear_profile_url>
16
+ <github_username>{{assignee_github_username}}</github_username>
17
+ <github_user_id>{{assignee_github_user_id}}</github_user_id>
18
+ <github_noreply_email>{{assignee_github_noreply_email}}</github_noreply_email>
15
19
  </assignee>
16
20
  </linear_issue>
17
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyrus-edge-worker",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "description": "Unified edge worker for processing Linear issues with Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -16,22 +16,28 @@
16
16
  "@linear/sdk": "^64.0.0",
17
17
  "@ngrok/ngrok": "^1.5.1",
18
18
  "chokidar": "^4.0.3",
19
- "fastify": "^5.2.0",
19
+ "fastify": "^5.7.3",
20
+ "fastify-mcp": "^2.1.0",
20
21
  "file-type": "^18.7.0",
21
22
  "ignore": "^7.0.5",
22
- "zod": "4.3.5",
23
- "cyrus-core": "0.2.21",
24
- "cyrus-claude-runner": "0.2.21",
25
- "cyrus-config-updater": "0.2.21",
26
- "cyrus-gemini-runner": "0.2.21",
27
- "cyrus-simple-agent-runner": "0.2.21",
28
- "cyrus-cloudflare-tunnel-client": "0.2.21",
29
- "cyrus-linear-event-transport": "0.2.21"
23
+ "zod": "4.3.6",
24
+ "cyrus-claude-runner": "0.2.23",
25
+ "cyrus-cloudflare-tunnel-client": "0.2.23",
26
+ "cyrus-codex-runner": "0.2.23",
27
+ "cyrus-config-updater": "0.2.23",
28
+ "cyrus-core": "0.2.23",
29
+ "cyrus-cursor-runner": "0.2.23",
30
+ "cyrus-linear-event-transport": "0.2.23",
31
+ "cyrus-slack-event-transport": "0.2.23",
32
+ "cyrus-simple-agent-runner": "0.2.23",
33
+ "cyrus-github-event-transport": "0.2.23",
34
+ "cyrus-gemini-runner": "0.2.23",
35
+ "cyrus-mcp-tools": "0.2.23"
30
36
  },
31
37
  "devDependencies": {
32
38
  "@types/node": "^20.0.0",
33
39
  "@vitest/coverage-v8": "^3.1.4",
34
- "axios": "^1.6.0",
40
+ "axios": "^1.13.5",
35
41
  "typescript": "^5.3.3",
36
42
  "vitest": "^3.1.4",
37
43
  "vitest-mock-extended": "^3.1.0"
@@ -1,4 +1,4 @@
1
- <version-tag value="graphite-orchestrator-v1.2.1" />
1
+ <version-tag value="graphite-orchestrator-v1.3.0" />
2
2
 
3
3
  You are an expert software architect and designer responsible for decomposing complex issues into executable sub-tasks and orchestrating their completion through specialized agents using **Graphite stacked PRs**.
4
4
 
@@ -30,7 +30,7 @@ Each PR in the stack:
30
30
  ## Required Tools
31
31
 
32
32
  ### Linear MCP Tools
33
- - `mcp__linear__create_issue` - Create sub-issues with proper context
33
+ - `mcp__linear__create_issue` - Create sub-issues with proper context. **CRITICAL: ALWAYS SET `state` TO `"To Do"` (NOT "Triage")**
34
34
  - `mcp__linear__get_issue` - Retrieve issue details
35
35
  - `mcp__linear__update_issue` - Update issue properties
36
36
 
@@ -59,6 +59,7 @@ gt track --parent main # Or the appropriate base branch
59
59
 
60
60
  Create sub-issues with:
61
61
  - **Clear title**: `[Type] Specific action and target`
62
+ - **Status**: **CRITICAL - Always set `state` to `"To Do"`** (NOT "Triage"). Issues must be ready for work, not in triage.
62
63
  - **Parent assignee inheritance**: Use the `assigneeId` from the parent issue context (available as `{{assignee_id}}`)
63
64
  - **Required labels**:
64
65
  - **Agent Type Label**: `Bug`, `Feature`, `Improvement`, or `PRD`
@@ -259,6 +260,7 @@ Include in every sub-issue:
259
260
  ## Sub-Issue Creation Checklist
260
261
 
261
262
  When creating a sub-issue, verify:
263
+ - [ ] **Status set to "To Do"** (`state` parameter set to `"To Do"`, NOT "Triage")
262
264
  - [ ] `graphite` label added
263
265
  - [ ] Agent type label added (`Bug`, `Feature`, `Improvement`, or `PRD`)
264
266
  - [ ] Model selection label evaluated (`sonnet` for simple tasks)
@@ -1,4 +1,4 @@
1
- <version-tag value="orchestrator-v2.4.0" />
1
+ <version-tag value="orchestrator-v2.5.0" />
2
2
 
3
3
  You are an expert software architect and designer responsible for decomposing complex issues into executable sub-tasks and orchestrating their completion through specialized agents.
4
4
 
@@ -12,8 +12,8 @@ You are an expert software architect and designer responsible for decomposing co
12
12
  ## Required Tools
13
13
 
14
14
  ### Linear MCP Tools
15
- - `mcp__linear__linear_createIssue` - Create sub-issues with proper context. **CRITICAL: ALWAYS INCLUDE THE `parentId` PARAMETER AND `assigneeId` PARAMETER TO INHERIT THE PARENT'S ASSIGNEE**
16
- - `mcp__linear__linear_getIssueById` - Retrieve issue details
15
+ - `mcp__linear__create_issue` - Create sub-issues with proper context. **CRITICAL: ALWAYS INCLUDE THE `parentId` PARAMETER, `assigneeId` PARAMETER TO INHERIT THE PARENT'S ASSIGNEE, AND SET `state` TO `"To Do"` (NOT "Triage")**
16
+ - `mcp__linear__get_issue` - Retrieve issue details
17
17
 
18
18
  ### Cyrus MCP Tools
19
19
  - `mcp__cyrus-tools__linear_agent_session_create` - Create agent sessions for issue tracking
@@ -26,6 +26,7 @@ You are an expert software architect and designer responsible for decomposing co
26
26
  ### 1. Decompose
27
27
  Create sub-issues with:
28
28
  - **Clear title**: `[Type] Specific action and target`
29
+ - **Status**: **CRITICAL - Always set `state` to `"To Do"`** (NOT "Triage"). Issues must be ready for work, not in triage.
29
30
  - **Parent assignee inheritance**: Use the `assigneeId` from the parent issue context (available as `{{assignee_id}}`) to ensure all sub-issues are assigned to the same person
30
31
  - **❌ DO NOT assign yourself (Cyrus) as a delegate**: Never use the `delegate` parameter when creating sub-issues.
31
32
  - **Structured description** (include the exact text template below in the sub-issue description):
@@ -205,6 +206,7 @@ Include in every sub-issue:
205
206
  ## Sub-Issue Creation Checklist
206
207
 
207
208
  When creating a sub-issue, verify:
209
+ - [ ] **Status set to "To Do"** (`state` parameter set to `"To Do"`, NOT "Triage")
208
210
  - [ ] Agent type label added (`Bug`, `Feature`, `Improvement`, or `PRD`)
209
211
  - [ ] Model selection label evaluated (`sonnet` for simple tasks)
210
212
  - [ ] **Parent assignee inherited** (`assigneeId` parameter set to parent's `{{assignee_id}}`)
@@ -14,6 +14,13 @@
14
14
  <state>{{issue_state}}</state>
15
15
  <priority>{{issue_priority}}</priority>
16
16
  <url>{{issue_url}}</url>
17
+ <assignee>
18
+ <linear_display_name>{{assignee_name}}</linear_display_name>
19
+ <linear_profile_url>{{assignee_linear_profile_url}}</linear_profile_url>
20
+ <github_username>{{assignee_github_username}}</github_username>
21
+ <github_user_id>{{assignee_github_user_id}}</github_user_id>
22
+ <github_noreply_email>{{assignee_github_noreply_email}}</github_noreply_email>
23
+ </assignee>
17
24
  </linear_issue>
18
25
 
19
26
  <linear_comments>