@hailer/mcp 0.1.16 → 0.2.1

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 (202) hide show
  1. package/dist/app.js +24 -20
  2. package/dist/core.d.ts +33 -9
  3. package/dist/core.js +279 -147
  4. package/dist/mcp/UserContextCache.js +18 -0
  5. package/dist/mcp/hailer-clients.d.ts +9 -1
  6. package/dist/mcp/hailer-clients.js +13 -3
  7. package/dist/mcp/signal-handler.js +1 -1
  8. package/dist/mcp/tool-registry.d.ts +3 -1
  9. package/dist/mcp/tool-registry.js +4 -1
  10. package/dist/mcp/tools/activity.js +43 -34
  11. package/dist/mcp/tools/bot-config/constants.d.ts +23 -0
  12. package/dist/mcp/tools/bot-config/constants.js +94 -0
  13. package/dist/mcp/tools/{bot-config.d.ts → bot-config/core.d.ts} +6 -6
  14. package/dist/mcp/tools/{bot-config.js → bot-config/core.js} +15 -15
  15. package/dist/mcp/tools/bot-config/index.d.ts +10 -0
  16. package/dist/mcp/tools/bot-config/index.js +59 -0
  17. package/dist/mcp/tools/bot-config/tools.d.ts +7 -0
  18. package/dist/mcp/tools/bot-config/tools.js +15 -0
  19. package/dist/mcp/tools/bot-config/types.d.ts +50 -0
  20. package/dist/mcp/tools/bot-config/types.js +6 -0
  21. package/dist/mcp/tools/bug-fixer-tools.d.ts +21 -0
  22. package/dist/mcp/tools/{giuseppe-tools.js → bug-fixer-tools.js} +61 -61
  23. package/dist/mcp/tools/user.js +10 -29
  24. package/dist/mcp/tools/workflow.js +36 -2
  25. package/dist/mcp/utils/data-transformers.d.ts +0 -8
  26. package/dist/mcp/utils/data-transformers.js +0 -28
  27. package/dist/mcp/utils/index.d.ts +4 -1
  28. package/dist/mcp/utils/index.js +17 -3
  29. package/dist/mcp/utils/pagination.d.ts +40 -0
  30. package/dist/mcp/utils/pagination.js +55 -0
  31. package/dist/mcp/utils/response-builder.d.ts +53 -0
  32. package/dist/mcp/utils/response-builder.js +110 -0
  33. package/dist/mcp/utils/tool-helpers.d.ts +0 -8
  34. package/dist/mcp/utils/tool-helpers.js +0 -24
  35. package/dist/mcp/utils/types.d.ts +1 -33
  36. package/dist/mcp/webhook-handler.d.ts +2 -2
  37. package/dist/mcp/webhook-handler.js +5 -3
  38. package/dist/mcp-server.d.ts +2 -2
  39. package/dist/mcp-server.js +167 -140
  40. package/package.json +1 -1
  41. package/REFACTOR_STATUS.md +0 -127
  42. package/dist/agents/bot-manager.d.ts +0 -48
  43. package/dist/agents/bot-manager.js +0 -254
  44. package/dist/agents/factory.d.ts +0 -150
  45. package/dist/agents/factory.js +0 -650
  46. package/dist/agents/giuseppe/ai.d.ts +0 -83
  47. package/dist/agents/giuseppe/ai.js +0 -466
  48. package/dist/agents/giuseppe/bot.d.ts +0 -110
  49. package/dist/agents/giuseppe/bot.js +0 -780
  50. package/dist/agents/giuseppe/config.d.ts +0 -25
  51. package/dist/agents/giuseppe/config.js +0 -227
  52. package/dist/agents/giuseppe/files.d.ts +0 -52
  53. package/dist/agents/giuseppe/files.js +0 -338
  54. package/dist/agents/giuseppe/git.d.ts +0 -48
  55. package/dist/agents/giuseppe/git.js +0 -298
  56. package/dist/agents/giuseppe/index.d.ts +0 -97
  57. package/dist/agents/giuseppe/index.js +0 -258
  58. package/dist/agents/giuseppe/lsp.d.ts +0 -113
  59. package/dist/agents/giuseppe/lsp.js +0 -485
  60. package/dist/agents/giuseppe/monitor.d.ts +0 -118
  61. package/dist/agents/giuseppe/monitor.js +0 -621
  62. package/dist/agents/giuseppe/prompt.d.ts +0 -5
  63. package/dist/agents/giuseppe/prompt.js +0 -94
  64. package/dist/agents/giuseppe/registries/pending-classification.d.ts +0 -28
  65. package/dist/agents/giuseppe/registries/pending-classification.js +0 -50
  66. package/dist/agents/giuseppe/registries/pending-fix.d.ts +0 -30
  67. package/dist/agents/giuseppe/registries/pending-fix.js +0 -42
  68. package/dist/agents/giuseppe/registries/pending.d.ts +0 -27
  69. package/dist/agents/giuseppe/registries/pending.js +0 -49
  70. package/dist/agents/giuseppe/specialist.d.ts +0 -47
  71. package/dist/agents/giuseppe/specialist.js +0 -237
  72. package/dist/agents/giuseppe/types.d.ts +0 -123
  73. package/dist/agents/giuseppe/types.js +0 -9
  74. package/dist/agents/hailer-expert/index.d.ts +0 -8
  75. package/dist/agents/hailer-expert/index.js +0 -14
  76. package/dist/agents/hal/daemon.d.ts +0 -142
  77. package/dist/agents/hal/daemon.js +0 -1103
  78. package/dist/agents/hal/definitions.d.ts +0 -55
  79. package/dist/agents/hal/definitions.js +0 -263
  80. package/dist/agents/hal/index.d.ts +0 -3
  81. package/dist/agents/hal/index.js +0 -8
  82. package/dist/agents/index.d.ts +0 -18
  83. package/dist/agents/index.js +0 -48
  84. package/dist/agents/shared/base.d.ts +0 -216
  85. package/dist/agents/shared/base.js +0 -846
  86. package/dist/agents/shared/services/agent-registry.d.ts +0 -107
  87. package/dist/agents/shared/services/agent-registry.js +0 -629
  88. package/dist/agents/shared/services/conversation-manager.d.ts +0 -50
  89. package/dist/agents/shared/services/conversation-manager.js +0 -136
  90. package/dist/agents/shared/services/mcp-client.d.ts +0 -56
  91. package/dist/agents/shared/services/mcp-client.js +0 -124
  92. package/dist/agents/shared/services/message-classifier.d.ts +0 -37
  93. package/dist/agents/shared/services/message-classifier.js +0 -187
  94. package/dist/agents/shared/services/message-formatter.d.ts +0 -89
  95. package/dist/agents/shared/services/message-formatter.js +0 -371
  96. package/dist/agents/shared/services/session-logger.d.ts +0 -106
  97. package/dist/agents/shared/services/session-logger.js +0 -446
  98. package/dist/agents/shared/services/tool-executor.d.ts +0 -41
  99. package/dist/agents/shared/services/tool-executor.js +0 -169
  100. package/dist/agents/shared/services/workspace-schema-cache.d.ts +0 -125
  101. package/dist/agents/shared/services/workspace-schema-cache.js +0 -578
  102. package/dist/agents/shared/specialist.d.ts +0 -91
  103. package/dist/agents/shared/specialist.js +0 -399
  104. package/dist/agents/shared/tool-schema-loader.d.ts +0 -62
  105. package/dist/agents/shared/tool-schema-loader.js +0 -232
  106. package/dist/agents/shared/types.d.ts +0 -327
  107. package/dist/agents/shared/types.js +0 -121
  108. package/dist/client/agents/base.d.ts +0 -207
  109. package/dist/client/agents/base.js +0 -744
  110. package/dist/client/agents/definitions.d.ts +0 -53
  111. package/dist/client/agents/definitions.js +0 -263
  112. package/dist/client/agents/orchestrator.d.ts +0 -141
  113. package/dist/client/agents/orchestrator.js +0 -1062
  114. package/dist/client/agents/specialist.d.ts +0 -86
  115. package/dist/client/agents/specialist.js +0 -340
  116. package/dist/client/bot-entrypoint.d.ts +0 -7
  117. package/dist/client/bot-entrypoint.js +0 -103
  118. package/dist/client/bot-manager.d.ts +0 -44
  119. package/dist/client/bot-manager.js +0 -173
  120. package/dist/client/bot-runner.d.ts +0 -35
  121. package/dist/client/bot-runner.js +0 -188
  122. package/dist/client/chat-agent-daemon.d.ts +0 -464
  123. package/dist/client/chat-agent-daemon.js +0 -1774
  124. package/dist/client/daemon-factory.d.ts +0 -106
  125. package/dist/client/daemon-factory.js +0 -301
  126. package/dist/client/factory.d.ts +0 -111
  127. package/dist/client/factory.js +0 -314
  128. package/dist/client/index.d.ts +0 -17
  129. package/dist/client/index.js +0 -38
  130. package/dist/client/multi-bot-manager.d.ts +0 -42
  131. package/dist/client/multi-bot-manager.js +0 -161
  132. package/dist/client/orchestrator-daemon.d.ts +0 -87
  133. package/dist/client/orchestrator-daemon.js +0 -444
  134. package/dist/client/server.d.ts +0 -8
  135. package/dist/client/server.js +0 -251
  136. package/dist/client/services/agent-registry.d.ts +0 -108
  137. package/dist/client/services/agent-registry.js +0 -630
  138. package/dist/client/services/conversation-manager.d.ts +0 -50
  139. package/dist/client/services/conversation-manager.js +0 -136
  140. package/dist/client/services/mcp-client.d.ts +0 -48
  141. package/dist/client/services/mcp-client.js +0 -105
  142. package/dist/client/services/message-classifier.d.ts +0 -37
  143. package/dist/client/services/message-classifier.js +0 -187
  144. package/dist/client/services/message-formatter.d.ts +0 -84
  145. package/dist/client/services/message-formatter.js +0 -353
  146. package/dist/client/services/session-logger.d.ts +0 -106
  147. package/dist/client/services/session-logger.js +0 -446
  148. package/dist/client/services/tool-executor.d.ts +0 -41
  149. package/dist/client/services/tool-executor.js +0 -169
  150. package/dist/client/services/workspace-schema-cache.d.ts +0 -149
  151. package/dist/client/services/workspace-schema-cache.js +0 -732
  152. package/dist/client/specialist-daemon.d.ts +0 -77
  153. package/dist/client/specialist-daemon.js +0 -197
  154. package/dist/client/specialists.d.ts +0 -53
  155. package/dist/client/specialists.js +0 -178
  156. package/dist/client/tool-schema-loader.d.ts +0 -62
  157. package/dist/client/tool-schema-loader.js +0 -232
  158. package/dist/client/types.d.ts +0 -327
  159. package/dist/client/types.js +0 -121
  160. package/dist/commands/seed-config.d.ts +0 -9
  161. package/dist/commands/seed-config.js +0 -372
  162. package/dist/lib/context-manager.d.ts +0 -111
  163. package/dist/lib/context-manager.js +0 -431
  164. package/dist/lib/prompt-length-manager.d.ts +0 -81
  165. package/dist/lib/prompt-length-manager.js +0 -457
  166. package/dist/mcp/tools/giuseppe-tools.d.ts +0 -21
  167. package/dist/modules/bug-reports/bug-config.d.ts +0 -25
  168. package/dist/modules/bug-reports/bug-config.js +0 -187
  169. package/dist/modules/bug-reports/bug-monitor.d.ts +0 -108
  170. package/dist/modules/bug-reports/bug-monitor.js +0 -510
  171. package/dist/modules/bug-reports/giuseppe-agent.d.ts +0 -58
  172. package/dist/modules/bug-reports/giuseppe-agent.js +0 -467
  173. package/dist/modules/bug-reports/giuseppe-ai.d.ts +0 -83
  174. package/dist/modules/bug-reports/giuseppe-ai.js +0 -466
  175. package/dist/modules/bug-reports/giuseppe-bot.d.ts +0 -110
  176. package/dist/modules/bug-reports/giuseppe-bot.js +0 -804
  177. package/dist/modules/bug-reports/giuseppe-daemon.d.ts +0 -80
  178. package/dist/modules/bug-reports/giuseppe-daemon.js +0 -617
  179. package/dist/modules/bug-reports/giuseppe-files.d.ts +0 -64
  180. package/dist/modules/bug-reports/giuseppe-files.js +0 -375
  181. package/dist/modules/bug-reports/giuseppe-git.d.ts +0 -48
  182. package/dist/modules/bug-reports/giuseppe-git.js +0 -298
  183. package/dist/modules/bug-reports/giuseppe-lsp.d.ts +0 -113
  184. package/dist/modules/bug-reports/giuseppe-lsp.js +0 -485
  185. package/dist/modules/bug-reports/giuseppe-prompt.d.ts +0 -5
  186. package/dist/modules/bug-reports/giuseppe-prompt.js +0 -94
  187. package/dist/modules/bug-reports/index.d.ts +0 -77
  188. package/dist/modules/bug-reports/index.js +0 -215
  189. package/dist/modules/bug-reports/pending-classification-registry.d.ts +0 -28
  190. package/dist/modules/bug-reports/pending-classification-registry.js +0 -50
  191. package/dist/modules/bug-reports/pending-fix-registry.d.ts +0 -30
  192. package/dist/modules/bug-reports/pending-fix-registry.js +0 -42
  193. package/dist/modules/bug-reports/pending-registry.d.ts +0 -27
  194. package/dist/modules/bug-reports/pending-registry.js +0 -49
  195. package/dist/modules/bug-reports/types.d.ts +0 -123
  196. package/dist/modules/bug-reports/types.js +0 -9
  197. package/dist/routes/agents.d.ts +0 -44
  198. package/dist/routes/agents.js +0 -311
  199. package/dist/services/agent-credential-store.d.ts +0 -73
  200. package/dist/services/agent-credential-store.js +0 -212
  201. package/dist/services/bug-monitor.d.ts +0 -23
  202. package/dist/services/bug-monitor.js +0 -275
@@ -1,215 +0,0 @@
1
- "use strict";
2
- /**
3
- * Bug Reports Module
4
- *
5
- * Self-contained module for bug monitoring and auto-fixing.
6
- * No hardcoded IDs - discovers workflow by name pattern.
7
- *
8
- * Usage:
9
- * import { BugReportsModule } from './modules/bug-reports';
10
- *
11
- * const module = new BugReportsModule(userContext);
12
- * await module.start();
13
- *
14
- * Configuration (in order of precedence):
15
- * 1. Hailer "MCP Config" workflow activity named "Bug Reports Config"
16
- * 2. Environment variables (BUG_MONITOR_*)
17
- * 3. Default values
18
- */
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.GIUSEPPE_SYSTEM_PROMPT = exports.GiuseppeFiles = exports.GiuseppeGit = exports.GiuseppeAI = exports.pendingClassificationRegistry = exports.pendingFixRegistry = exports.PendingRegistry = exports.getDefaultConfig = exports.discoverWorkflow = exports.loadConfig = exports.GiuseppeBot = exports.GiuseppeAgent = exports.BugMonitor = exports.BugReportsModule = void 0;
21
- const logger_1 = require("../../lib/logger");
22
- const bug_monitor_1 = require("./bug-monitor");
23
- const giuseppe_agent_1 = require("./giuseppe-agent");
24
- const bug_config_1 = require("./bug-config");
25
- const discussion_lock_1 = require("../../lib/discussion-lock");
26
- const logger = (0, logger_1.createLogger)({ component: 'bug-reports-module' });
27
- class BugReportsModule {
28
- userContext;
29
- monitor;
30
- giuseppe;
31
- config;
32
- started = false;
33
- constructor(userContext) {
34
- this.userContext = userContext;
35
- }
36
- /**
37
- * Register a bot user ID to ignore messages from
38
- * Call this before start() to ensure all bots are registered
39
- */
40
- registerBotUser(userId) {
41
- if (this.monitor) {
42
- this.monitor.registerBotUser(userId);
43
- }
44
- else {
45
- // Store for later if monitor not created yet
46
- this._pendingBotUsers = this._pendingBotUsers || [];
47
- this._pendingBotUsers.push(userId);
48
- }
49
- }
50
- _pendingBotUsers;
51
- /**
52
- * Register a handler for when Giuseppe is disabled but a bug is found
53
- * Call this before start() to ensure handler is registered
54
- */
55
- onGiuseppeDisabled(handler) {
56
- if (this.monitor) {
57
- this.monitor.onGiuseppeDisabled(handler);
58
- }
59
- else {
60
- // Store for later if monitor not created yet
61
- this._pendingGiuseppeDisabledHandlers = this._pendingGiuseppeDisabledHandlers || [];
62
- this._pendingGiuseppeDisabledHandlers.push(handler);
63
- }
64
- }
65
- _pendingGiuseppeDisabledHandlers;
66
- /**
67
- * Start the bug reports module
68
- */
69
- async start() {
70
- if (this.started) {
71
- logger.warn('BugReportsModule already started');
72
- return;
73
- }
74
- logger.info('Starting Bug Reports Module...');
75
- try {
76
- // Load configuration
77
- this.config = await (0, bug_config_1.loadConfig)(this.userContext);
78
- if (!this.config.enabled) {
79
- logger.info('Bug Reports Module is disabled');
80
- return;
81
- }
82
- // Create monitor
83
- this.monitor = new bug_monitor_1.BugMonitor(this.userContext);
84
- // Register any pending bot users
85
- if (this._pendingBotUsers) {
86
- for (const userId of this._pendingBotUsers) {
87
- this.monitor.registerBotUser(userId);
88
- }
89
- this._pendingBotUsers = undefined;
90
- }
91
- // Register any pending giuseppe disabled handlers
92
- if (this._pendingGiuseppeDisabledHandlers) {
93
- for (const handler of this._pendingGiuseppeDisabledHandlers) {
94
- this.monitor.onGiuseppeDisabled(handler);
95
- }
96
- this._pendingGiuseppeDisabledHandlers = undefined;
97
- }
98
- // Create Giuseppe agent if auto-fix is enabled
99
- if (this.config.autoFix) {
100
- if (!this.config.anthropicApiKey && !process.env.ANTHROPIC_API_KEY) {
101
- logger.warn('Auto-fix enabled but no ANTHROPIC_API_KEY - Giuseppe disabled');
102
- }
103
- else {
104
- // Create the conversational Giuseppe agent
105
- this.giuseppe = new giuseppe_agent_1.GiuseppeAgent(this.userContext, this.monitor, process.env.DEV_APPS_PATH || process.cwd(), this.config.anthropicApiKey);
106
- // Register Giuseppe as bug handler - starts the conversation
107
- this.monitor.onNewBug(async (bug) => {
108
- // Lock discussion to prevent HAL from responding
109
- if (bug.discussionId) {
110
- (0, discussion_lock_1.acquireDiscussionLock)(bug.discussionId, 'giuseppe', 30 * 60 * 1000);
111
- // IMPORTANT: Tell monitor to watch this discussion for messages
112
- this.monitor.watchDiscussion(bug.discussionId);
113
- }
114
- await this.giuseppe.handleNewBug(bug);
115
- logger.info('Giuseppe started conversation', { bugId: bug.id });
116
- });
117
- // Register Giuseppe as message handler - continues the conversation
118
- this.monitor.onMessage(async (discussionId, message, senderName) => {
119
- logger.info('Routing message to Giuseppe', { discussionId, senderName, preview: message.substring(0, 50) });
120
- await this.giuseppe.handleMessage(discussionId, message, senderName);
121
- });
122
- logger.info('Giuseppe Agent enabled - full conversational mode');
123
- }
124
- }
125
- // Start monitoring
126
- await this.monitor.start();
127
- this.started = true;
128
- logger.info('Bug Reports Module started', {
129
- autoFix: !!this.giuseppe,
130
- notifyOnNew: this.config.notifyOnNew,
131
- intervalMs: this.config.intervalMs
132
- });
133
- }
134
- catch (error) {
135
- logger.error('Failed to start Bug Reports Module', { error });
136
- }
137
- }
138
- /**
139
- * Stop the module
140
- */
141
- async stop() {
142
- if (this.monitor) {
143
- await this.monitor.stop();
144
- }
145
- this.started = false;
146
- logger.info('Bug Reports Module stopped');
147
- }
148
- /**
149
- * Get current configuration
150
- */
151
- getConfig() {
152
- return this.config || (0, bug_config_1.getDefaultConfig)();
153
- }
154
- /**
155
- * Check if module is running
156
- */
157
- isRunning() {
158
- return this.started;
159
- }
160
- /**
161
- * Manually trigger a bug fix (for testing or manual dispatch)
162
- */
163
- async fixBug(bug) {
164
- if (!this.giuseppe) {
165
- return {
166
- success: false,
167
- summary: 'Giuseppe Agent not initialized (autoFix disabled or no API key)'
168
- };
169
- }
170
- // Start the conversational fix
171
- await this.giuseppe.handleNewBug(bug);
172
- return {
173
- success: true,
174
- summary: 'Giuseppe started fixing the bug conversationally'
175
- };
176
- }
177
- /**
178
- * Register a custom bug handler
179
- */
180
- onNewBug(handler) {
181
- if (this.monitor) {
182
- this.monitor.onNewBug(handler);
183
- }
184
- else {
185
- logger.warn('Cannot register handler - monitor not initialized');
186
- }
187
- }
188
- }
189
- exports.BugReportsModule = BugReportsModule;
190
- var bug_monitor_2 = require("./bug-monitor");
191
- Object.defineProperty(exports, "BugMonitor", { enumerable: true, get: function () { return bug_monitor_2.BugMonitor; } });
192
- var giuseppe_agent_2 = require("./giuseppe-agent");
193
- Object.defineProperty(exports, "GiuseppeAgent", { enumerable: true, get: function () { return giuseppe_agent_2.GiuseppeAgent; } });
194
- var giuseppe_bot_1 = require("./giuseppe-bot"); // Legacy, for backwards compatibility
195
- Object.defineProperty(exports, "GiuseppeBot", { enumerable: true, get: function () { return giuseppe_bot_1.GiuseppeBot; } });
196
- var bug_config_2 = require("./bug-config");
197
- Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return bug_config_2.loadConfig; } });
198
- Object.defineProperty(exports, "discoverWorkflow", { enumerable: true, get: function () { return bug_config_2.discoverWorkflow; } });
199
- Object.defineProperty(exports, "getDefaultConfig", { enumerable: true, get: function () { return bug_config_2.getDefaultConfig; } });
200
- var pending_registry_1 = require("./pending-registry");
201
- Object.defineProperty(exports, "PendingRegistry", { enumerable: true, get: function () { return pending_registry_1.PendingRegistry; } });
202
- var pending_fix_registry_1 = require("./pending-fix-registry");
203
- Object.defineProperty(exports, "pendingFixRegistry", { enumerable: true, get: function () { return pending_fix_registry_1.pendingFixRegistry; } });
204
- var pending_classification_registry_1 = require("./pending-classification-registry");
205
- Object.defineProperty(exports, "pendingClassificationRegistry", { enumerable: true, get: function () { return pending_classification_registry_1.pendingClassificationRegistry; } });
206
- // Export extracted Giuseppe modules
207
- var giuseppe_ai_1 = require("./giuseppe-ai");
208
- Object.defineProperty(exports, "GiuseppeAI", { enumerable: true, get: function () { return giuseppe_ai_1.GiuseppeAI; } });
209
- var giuseppe_git_1 = require("./giuseppe-git");
210
- Object.defineProperty(exports, "GiuseppeGit", { enumerable: true, get: function () { return giuseppe_git_1.GiuseppeGit; } });
211
- var giuseppe_files_1 = require("./giuseppe-files");
212
- Object.defineProperty(exports, "GiuseppeFiles", { enumerable: true, get: function () { return giuseppe_files_1.GiuseppeFiles; } });
213
- var giuseppe_prompt_1 = require("./giuseppe-prompt");
214
- Object.defineProperty(exports, "GIUSEPPE_SYSTEM_PROMPT", { enumerable: true, get: function () { return giuseppe_prompt_1.GIUSEPPE_SYSTEM_PROMPT; } });
215
- //# sourceMappingURL=index.js.map
@@ -1,28 +0,0 @@
1
- /**
2
- * Pending Classification Registry - Tracks bug classifications awaiting confirmation
3
- */
4
- import { PendingRegistry, PendingItem } from './pending-registry';
5
- import type { BugReport } from './types';
6
- export interface PendingClassificationInfo extends PendingItem {
7
- bugId: string;
8
- bugName: string;
9
- appId?: string;
10
- appName?: string;
11
- classification: 'bug' | 'feature_request' | 'unclear';
12
- reason: string;
13
- bug: BugReport;
14
- }
15
- declare class PendingClassificationRegistry extends PendingRegistry<PendingClassificationInfo> {
16
- private fixItCallback?;
17
- private notABugCallback?;
18
- constructor();
19
- setCallbacks(fixItCallback: (discussionId: string) => Promise<void>, notABugCallback: (discussionId: string) => Promise<void>): void;
20
- triggerFixIt(discussionId: string): Promise<boolean>;
21
- triggerNotABug(discussionId: string): Promise<boolean>;
22
- hasPendingClassification(discussionId: string): boolean;
23
- getPendingClassification(discussionId: string): PendingClassificationInfo | undefined;
24
- getAllPendingClassifications(): PendingClassificationInfo[];
25
- }
26
- export declare const pendingClassificationRegistry: PendingClassificationRegistry;
27
- export {};
28
- //# sourceMappingURL=pending-classification-registry.d.ts.map
@@ -1,50 +0,0 @@
1
- "use strict";
2
- /**
3
- * Pending Classification Registry - Tracks bug classifications awaiting confirmation
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.pendingClassificationRegistry = void 0;
7
- const pending_registry_1 = require("./pending-registry");
8
- class PendingClassificationRegistry extends pending_registry_1.PendingRegistry {
9
- fixItCallback;
10
- notABugCallback;
11
- constructor() {
12
- super('pending-classification-registry');
13
- }
14
- setCallbacks(fixItCallback, notABugCallback) {
15
- this.fixItCallback = fixItCallback;
16
- this.notABugCallback = notABugCallback;
17
- }
18
- async triggerFixIt(discussionId) {
19
- if (!this.fixItCallback) {
20
- this.logger.warn('No fixIt callback registered', { discussionId });
21
- return false;
22
- }
23
- if (!this.has(discussionId)) {
24
- this.logger.warn('No pending classification to fix', { discussionId });
25
- return false;
26
- }
27
- this.logger.info('Triggering fix it', { discussionId });
28
- await this.fixItCallback(discussionId);
29
- return true;
30
- }
31
- async triggerNotABug(discussionId) {
32
- if (!this.notABugCallback) {
33
- this.logger.warn('No notABug callback registered', { discussionId });
34
- return false;
35
- }
36
- if (!this.has(discussionId)) {
37
- this.logger.warn('No pending classification to decline', { discussionId });
38
- return false;
39
- }
40
- this.logger.info('Triggering not a bug', { discussionId });
41
- await this.notABugCallback(discussionId);
42
- return true;
43
- }
44
- // Backward-compatible aliases
45
- hasPendingClassification(discussionId) { return this.has(discussionId); }
46
- getPendingClassification(discussionId) { return this.get(discussionId); }
47
- getAllPendingClassifications() { return this.getAll(); }
48
- }
49
- exports.pendingClassificationRegistry = new PendingClassificationRegistry();
50
- //# sourceMappingURL=pending-classification-registry.js.map
@@ -1,30 +0,0 @@
1
- /**
2
- * Pending Fix Registry - Tracks bug fixes awaiting approval
3
- */
4
- import { PendingRegistry, PendingItem } from './pending-registry';
5
- import type { BugReport, AppRegistryEntry } from './types';
6
- import type { FixPlan } from './giuseppe-ai';
7
- export interface PendingFixInfo extends PendingItem {
8
- bugId: string;
9
- appId: string;
10
- state: 'awaiting_test' | 'awaiting_explanation';
11
- fixSummary: string;
12
- bug: BugReport;
13
- app: AppRegistryEntry;
14
- fixPlan: FixPlan;
15
- filesModified: string[];
16
- commitHash?: string;
17
- }
18
- declare class PendingFixRegistry extends PendingRegistry<PendingFixInfo> {
19
- private retryCallback?;
20
- constructor();
21
- updateState(discussionId: string, state: PendingFixInfo['state']): void;
22
- setRetryCallback(callback: (discussionId: string, explanation: string) => Promise<void>): void;
23
- triggerRetry(discussionId: string, explanation: string): Promise<boolean>;
24
- hasPendingFix(discussionId: string): boolean;
25
- getPendingFix(discussionId: string): PendingFixInfo | undefined;
26
- getAllPendingFixes(): PendingFixInfo[];
27
- }
28
- export declare const pendingFixRegistry: PendingFixRegistry;
29
- export {};
30
- //# sourceMappingURL=pending-fix-registry.d.ts.map
@@ -1,42 +0,0 @@
1
- "use strict";
2
- /**
3
- * Pending Fix Registry - Tracks bug fixes awaiting approval
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.pendingFixRegistry = void 0;
7
- const pending_registry_1 = require("./pending-registry");
8
- class PendingFixRegistry extends pending_registry_1.PendingRegistry {
9
- retryCallback;
10
- constructor() {
11
- super('pending-fix-registry');
12
- }
13
- updateState(discussionId, state) {
14
- const fix = this.get(discussionId);
15
- if (fix) {
16
- fix.state = state;
17
- this.logger.debug('Updated pending fix state', { discussionId, state });
18
- }
19
- }
20
- setRetryCallback(callback) {
21
- this.retryCallback = callback;
22
- }
23
- async triggerRetry(discussionId, explanation) {
24
- if (!this.retryCallback) {
25
- this.logger.warn('No retry callback registered', { discussionId });
26
- return false;
27
- }
28
- if (!this.has(discussionId)) {
29
- this.logger.warn('No pending fix to retry', { discussionId });
30
- return false;
31
- }
32
- this.logger.info('Triggering retry with explanation', { discussionId, explanationLength: explanation.length });
33
- await this.retryCallback(discussionId, explanation);
34
- return true;
35
- }
36
- // Backward-compatible aliases
37
- hasPendingFix(discussionId) { return this.has(discussionId); }
38
- getPendingFix(discussionId) { return this.get(discussionId); }
39
- getAllPendingFixes() { return this.getAll(); }
40
- }
41
- exports.pendingFixRegistry = new PendingFixRegistry();
42
- //# sourceMappingURL=pending-fix-registry.js.map
@@ -1,27 +0,0 @@
1
- /**
2
- * Generic Pending Registry Base Class
3
- *
4
- * Shared foundation for PendingFixRegistry and PendingClassificationRegistry.
5
- * Provides Map-based storage with register/unregister/has/get/getAll methods.
6
- */
7
- import { Logger } from '../../lib/logger';
8
- export interface PendingItem {
9
- discussionId: string;
10
- timestamp: number;
11
- }
12
- /**
13
- * Generic registry for pending items keyed by discussionId
14
- */
15
- export declare class PendingRegistry<T extends PendingItem> {
16
- protected items: Map<string, T>;
17
- protected logger: Logger;
18
- constructor(component: string);
19
- register(item: T): void;
20
- unregister(discussionId: string): void;
21
- has(discussionId: string): boolean;
22
- get(discussionId: string): T | undefined;
23
- getAll(): T[];
24
- get size(): number;
25
- clear(): void;
26
- }
27
- //# sourceMappingURL=pending-registry.d.ts.map
@@ -1,49 +0,0 @@
1
- "use strict";
2
- /**
3
- * Generic Pending Registry Base Class
4
- *
5
- * Shared foundation for PendingFixRegistry and PendingClassificationRegistry.
6
- * Provides Map-based storage with register/unregister/has/get/getAll methods.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.PendingRegistry = void 0;
10
- const logger_1 = require("../../lib/logger");
11
- /**
12
- * Generic registry for pending items keyed by discussionId
13
- */
14
- class PendingRegistry {
15
- items = new Map();
16
- logger;
17
- constructor(component) {
18
- this.logger = (0, logger_1.createLogger)({ component });
19
- }
20
- register(item) {
21
- this.items.set(item.discussionId, item);
22
- this.logger.debug('Registered pending item', {
23
- discussionId: item.discussionId,
24
- timestamp: item.timestamp
25
- });
26
- }
27
- unregister(discussionId) {
28
- this.items.delete(discussionId);
29
- this.logger.debug('Unregistered pending item', { discussionId });
30
- }
31
- has(discussionId) {
32
- return this.items.has(discussionId);
33
- }
34
- get(discussionId) {
35
- return this.items.get(discussionId);
36
- }
37
- getAll() {
38
- return Array.from(this.items.values());
39
- }
40
- get size() {
41
- return this.items.size;
42
- }
43
- clear() {
44
- this.items.clear();
45
- this.logger.debug('Cleared all pending items');
46
- }
47
- }
48
- exports.PendingRegistry = PendingRegistry;
49
- //# sourceMappingURL=pending-registry.js.map
@@ -1,123 +0,0 @@
1
- /**
2
- * Bug Reports Module - Type Definitions
3
- *
4
- * Shared types for the bug monitoring and auto-fix system.
5
- * No hardcoded IDs - everything discovered by name patterns.
6
- */
7
- export interface BugReportsConfig {
8
- /** Enable/disable the bug monitor */
9
- enabled: boolean;
10
- /** Workflow name pattern to find Bug Reports workflow */
11
- workflowNamePattern: string;
12
- /** Phase names for bug lifecycle */
13
- phaseNames: {
14
- new: string;
15
- inProgress: string;
16
- fixed: string;
17
- closed: string;
18
- declined: string;
19
- };
20
- /** Polling interval in milliseconds */
21
- intervalMs: number;
22
- /** Enable auto-fix via Giuseppe bot */
23
- autoFix: boolean;
24
- /** Post notifications to bug discussions */
25
- notifyOnNew: boolean;
26
- /** Anthropic API key for Giuseppe bot (if autoFix enabled) */
27
- anthropicApiKey?: string;
28
- /** Apps registry - maps appId to project paths */
29
- appsRegistry?: Record<string, AppRegistryEntry>;
30
- }
31
- export interface AppRegistryEntry {
32
- /** Local path to app project */
33
- projectPath: string;
34
- /** App name for reference */
35
- name: string;
36
- /** Git remote URL (optional) */
37
- gitRemote?: string;
38
- }
39
- export interface BugReport {
40
- /** Activity ID */
41
- id: string;
42
- /** Bug title/name */
43
- name: string;
44
- /** App ID this bug relates to */
45
- appId?: string;
46
- /** App name */
47
- appName?: string;
48
- /** Who reported the bug */
49
- reportedBy?: string;
50
- /** Bug description */
51
- description: string;
52
- /** Steps to reproduce */
53
- stepsToReproduce?: string;
54
- /** Expected behavior */
55
- expectedBehavior?: string;
56
- /** Actual behavior */
57
- actualBehavior?: string;
58
- /** Priority level */
59
- priority?: 'low' | 'medium' | 'high' | 'critical';
60
- /** Discussion ID for posting updates */
61
- discussionId?: string;
62
- /** Workflow ID */
63
- workflowId: string;
64
- /** Current phase ID */
65
- phaseId: string;
66
- /** Creation timestamp */
67
- createdAt: string;
68
- /** Who created the bug activity (user ID) */
69
- createdBy?: string;
70
- /** Raw field values for custom parsing */
71
- rawFields?: Record<string, any>;
72
- }
73
- export interface WorkflowDiscoveryResult {
74
- /** Found workflow ID */
75
- workflowId: string;
76
- /** Workflow name */
77
- workflowName: string;
78
- /** Phase ID mappings */
79
- phases: {
80
- new?: string;
81
- inProgress?: string;
82
- fixed?: string;
83
- closed?: string;
84
- declined?: string;
85
- };
86
- /** Field ID mappings (discovered by label) */
87
- fields: {
88
- appId?: string;
89
- appName?: string;
90
- description?: string;
91
- stepsToReproduce?: string;
92
- expectedBehavior?: string;
93
- actualBehavior?: string;
94
- reportedBy?: string;
95
- priority?: string;
96
- };
97
- }
98
- export interface FixResult {
99
- success: boolean;
100
- /** What was done */
101
- summary: string;
102
- /** Files modified */
103
- filesModified?: string[];
104
- /** Commit hash if committed */
105
- commitHash?: string;
106
- /** New version if published */
107
- publishedVersion?: string;
108
- /** Error message if failed */
109
- error?: string;
110
- /** Detailed log of actions */
111
- log?: string[];
112
- }
113
- export interface GiuseppeTaskInput {
114
- /** The bug to fix */
115
- bug: BugReport;
116
- /** App project info */
117
- app: AppRegistryEntry;
118
- /** Whether to auto-publish after fix */
119
- autoPublish: boolean;
120
- /** Hailer app ID for publishing */
121
- hailerAppId?: string;
122
- }
123
- //# sourceMappingURL=types.d.ts.map
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /**
3
- * Bug Reports Module - Type Definitions
4
- *
5
- * Shared types for the bug monitoring and auto-fix system.
6
- * No hardcoded IDs - everything discovered by name patterns.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- //# sourceMappingURL=types.js.map
@@ -1,44 +0,0 @@
1
- /**
2
- * Agent Routes and Connection Manager
3
- *
4
- * REST API endpoints for enabling/disabling agents in workspaces
5
- * and managing their persistent connections.
6
- */
7
- import { Router } from 'express';
8
- import { HailerClient } from '../mcp/hailer-clients';
9
- import { AgentCredentialStore, AgentCredentials } from '../services/agent-credential-store';
10
- /**
11
- * Manages persistent connections for enabled agents.
12
- * Handles connection lifecycle, reconnection, and signal handling.
13
- */
14
- export declare class AgentConnectionManager {
15
- private credentialStore;
16
- private connections;
17
- private logger;
18
- constructor(credentialStore: AgentCredentialStore);
19
- /**
20
- * Connect an agent using stored credentials
21
- */
22
- connect(credentials: AgentCredentials): Promise<HailerClient>;
23
- /**
24
- * Disconnect an agent
25
- */
26
- disconnect(workspaceId: string, agentType: string): Promise<void>;
27
- /**
28
- * Check if agent is connected
29
- */
30
- isConnected(workspaceId: string, agentType: string): boolean;
31
- /**
32
- * Reconnect all agents on server startup
33
- */
34
- reconnectAll(): Promise<void>;
35
- /**
36
- * Handle @mention signals (placeholder for agent logic)
37
- */
38
- private handleMentionSignal;
39
- }
40
- /**
41
- * Create Express router for agent management endpoints
42
- */
43
- export declare function createAgentRouter(credentialStore: AgentCredentialStore, connectionManager: AgentConnectionManager): Router;
44
- //# sourceMappingURL=agents.d.ts.map