@hailer/mcp 0.1.6 → 0.1.9

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 (137) hide show
  1. package/.claude/agents/agent-dmitri-activity-crud.md +3 -1
  2. package/.claude/agents/agent-giuseppe-app-builder.md +11 -12
  3. package/.claude/agents/agent-kenji-data-reader.md +5 -3
  4. package/.claude/hooks/sync-marketplace-agents.cjs +117 -56
  5. package/.claude/skills/hailer-app-builder/SKILL.md +506 -0
  6. package/.claude/skills/publish-hailer-app/SKILL.md +169 -0
  7. package/.claude/skills/tool-parameter-usage/SKILL.md +112 -0
  8. package/CHANGELOG.md +20 -0
  9. package/CLAUDE.md +37 -16
  10. package/REFACTOR_STATUS.md +127 -0
  11. package/dist/cli.js +0 -0
  12. package/dist/client/agents/base.d.ts +202 -0
  13. package/dist/client/agents/base.js +737 -0
  14. package/dist/client/agents/definitions.d.ts +53 -0
  15. package/dist/client/agents/definitions.js +178 -0
  16. package/dist/client/agents/orchestrator.d.ts +119 -0
  17. package/dist/client/agents/orchestrator.js +760 -0
  18. package/dist/client/agents/specialist.d.ts +86 -0
  19. package/dist/client/agents/specialist.js +340 -0
  20. package/dist/client/bot-manager.d.ts +44 -0
  21. package/dist/client/bot-manager.js +173 -0
  22. package/dist/client/chat-agent-daemon.d.ts +464 -0
  23. package/dist/client/chat-agent-daemon.js +1774 -0
  24. package/dist/client/daemon-factory.d.ts +106 -0
  25. package/dist/client/daemon-factory.js +301 -0
  26. package/dist/client/factory.d.ts +107 -0
  27. package/dist/client/factory.js +304 -0
  28. package/dist/client/index.d.ts +17 -0
  29. package/dist/client/index.js +38 -0
  30. package/dist/client/multi-bot-manager.d.ts +18 -0
  31. package/dist/client/multi-bot-manager.js +88 -1
  32. package/dist/client/orchestrator-daemon.d.ts +87 -0
  33. package/dist/client/orchestrator-daemon.js +444 -0
  34. package/dist/client/services/agent-registry.d.ts +108 -0
  35. package/dist/client/services/agent-registry.js +630 -0
  36. package/dist/client/services/conversation-manager.d.ts +50 -0
  37. package/dist/client/services/conversation-manager.js +136 -0
  38. package/dist/client/services/mcp-client.d.ts +48 -0
  39. package/dist/client/services/mcp-client.js +105 -0
  40. package/dist/client/services/message-classifier.d.ts +37 -0
  41. package/dist/client/services/message-classifier.js +187 -0
  42. package/dist/client/services/message-formatter.d.ts +84 -0
  43. package/dist/client/services/message-formatter.js +353 -0
  44. package/dist/client/services/session-logger.d.ts +106 -0
  45. package/dist/client/services/session-logger.js +446 -0
  46. package/dist/client/services/tool-executor.d.ts +41 -0
  47. package/dist/client/services/tool-executor.js +169 -0
  48. package/dist/client/services/workspace-schema-cache.d.ts +149 -0
  49. package/dist/client/services/workspace-schema-cache.js +732 -0
  50. package/dist/client/specialist-daemon.d.ts +77 -0
  51. package/dist/client/specialist-daemon.js +197 -0
  52. package/dist/client/specialists.d.ts +53 -0
  53. package/dist/client/specialists.js +178 -0
  54. package/dist/client/tool-schema-loader.d.ts +4 -3
  55. package/dist/client/tool-schema-loader.js +54 -8
  56. package/dist/client/types.d.ts +283 -55
  57. package/dist/client/types.js +113 -2
  58. package/dist/config.d.ts +1 -1
  59. package/dist/config.js +1 -1
  60. package/dist/core.d.ts +10 -2
  61. package/dist/core.js +43 -27
  62. package/dist/lib/logger.js +15 -3
  63. package/dist/mcp/UserContextCache.js +2 -2
  64. package/dist/mcp/hailer-clients.js +5 -5
  65. package/dist/mcp/signal-handler.js +27 -5
  66. package/dist/mcp/tools/activity.js +137 -65
  67. package/dist/mcp/tools/app-core.js +4 -140
  68. package/dist/mcp/tools/app-marketplace.js +15 -260
  69. package/dist/mcp/tools/app-member.js +2 -73
  70. package/dist/mcp/tools/app-scaffold.js +146 -87
  71. package/dist/mcp/tools/discussion.js +348 -73
  72. package/dist/mcp/tools/insight.js +74 -190
  73. package/dist/mcp/tools/workflow.js +20 -94
  74. package/dist/mcp/utils/hailer-api-client.d.ts +4 -2
  75. package/dist/mcp/utils/hailer-api-client.js +24 -10
  76. package/dist/mcp-server.d.ts +4 -0
  77. package/dist/mcp-server.js +24 -4
  78. package/dist/routes/agents.d.ts +44 -0
  79. package/dist/routes/agents.js +311 -0
  80. package/dist/services/agent-credential-store.d.ts +73 -0
  81. package/dist/services/agent-credential-store.js +212 -0
  82. package/lineup-manager/dist/assets/index-8ce6041d.css +1 -0
  83. package/lineup-manager/dist/assets/index-e168f265.js +600 -0
  84. package/lineup-manager/dist/index.html +15 -0
  85. package/lineup-manager/dist/manifest.json +17 -0
  86. package/lineup-manager/dist/vite.svg +1 -0
  87. package/package.json +1 -1
  88. package/dist/client/adaptive-documentation-bot.d.ts +0 -106
  89. package/dist/client/adaptive-documentation-bot.js +0 -464
  90. package/dist/client/adaptive-documentation-types.d.ts +0 -66
  91. package/dist/client/adaptive-documentation-types.js +0 -9
  92. package/dist/client/agent-activity-bot.d.ts +0 -51
  93. package/dist/client/agent-activity-bot.js +0 -166
  94. package/dist/client/agent-tracker.d.ts +0 -499
  95. package/dist/client/agent-tracker.js +0 -659
  96. package/dist/client/description-updater.d.ts +0 -56
  97. package/dist/client/description-updater.js +0 -259
  98. package/dist/client/log-parser.d.ts +0 -72
  99. package/dist/client/log-parser.js +0 -387
  100. package/dist/client/mcp-assistant.d.ts +0 -21
  101. package/dist/client/mcp-assistant.js +0 -58
  102. package/dist/client/mcp-client.d.ts +0 -50
  103. package/dist/client/mcp-client.js +0 -538
  104. package/dist/client/message-processor.d.ts +0 -35
  105. package/dist/client/message-processor.js +0 -357
  106. package/dist/client/providers/anthropic-provider.d.ts +0 -19
  107. package/dist/client/providers/anthropic-provider.js +0 -645
  108. package/dist/client/providers/assistant-provider.d.ts +0 -17
  109. package/dist/client/providers/assistant-provider.js +0 -51
  110. package/dist/client/providers/llm-provider.d.ts +0 -47
  111. package/dist/client/providers/llm-provider.js +0 -367
  112. package/dist/client/providers/openai-provider.d.ts +0 -23
  113. package/dist/client/providers/openai-provider.js +0 -630
  114. package/dist/client/simple-llm-caller.d.ts +0 -19
  115. package/dist/client/simple-llm-caller.js +0 -100
  116. package/dist/client/skill-generator.d.ts +0 -81
  117. package/dist/client/skill-generator.js +0 -386
  118. package/dist/client/test-adaptive-bot.d.ts +0 -9
  119. package/dist/client/test-adaptive-bot.js +0 -82
  120. package/dist/client/token-pricing.d.ts +0 -38
  121. package/dist/client/token-pricing.js +0 -127
  122. package/dist/client/token-tracker.d.ts +0 -232
  123. package/dist/client/token-tracker.js +0 -457
  124. package/dist/client/token-usage-bot.d.ts +0 -53
  125. package/dist/client/token-usage-bot.js +0 -153
  126. package/dist/client/tool-executor.d.ts +0 -69
  127. package/dist/client/tool-executor.js +0 -159
  128. package/dist/lib/materialize.d.ts +0 -3
  129. package/dist/lib/materialize.js +0 -101
  130. package/dist/lib/normalizedName.d.ts +0 -7
  131. package/dist/lib/normalizedName.js +0 -48
  132. package/dist/lib/terminal-prompt.d.ts +0 -9
  133. package/dist/lib/terminal-prompt.js +0 -108
  134. package/dist/mcp/tools/skill.d.ts +0 -10
  135. package/dist/mcp/tools/skill.js +0 -279
  136. package/dist/mcp/tools/workflow-template.d.ts +0 -19
  137. package/dist/mcp/tools/workflow-template.js +0 -822
@@ -1,51 +0,0 @@
1
- /**
2
- * Agent Activity Bot
3
- *
4
- * Monitors agent activity and posts summaries to discussions.
5
- * Can respond to queries about agent performance and tool usage.
6
- */
7
- import { AgentTracker } from './agent-tracker';
8
- export interface AgentActivityBotConfig {
9
- enabled: boolean;
10
- postSummaryAfterConversation: boolean;
11
- minDurationThreshold?: number;
12
- }
13
- export declare class AgentActivityBot {
14
- private agentTracker;
15
- private config;
16
- private lastPostedConversation;
17
- constructor(agentTracker: AgentTracker, config: AgentActivityBotConfig);
18
- /**
19
- * Generate a summary message for the last conversation in a discussion
20
- */
21
- generateSummary(requestId: string, discussionId: string, duration: number, toolsCalled: string[]): string;
22
- /**
23
- * Format a concise summary message
24
- */
25
- private formatSummaryMessage;
26
- /**
27
- * Generate detailed agent activity report
28
- */
29
- generateDetailedReport(discussionId?: string): string;
30
- /**
31
- * Check if message is asking for agent activity details
32
- */
33
- isActivityQuery(messageContent: string): boolean;
34
- /**
35
- * Should post summary after this conversation?
36
- */
37
- shouldPostSummary(discussionId: string, duration: number): boolean;
38
- /**
39
- * Mark that we posted a summary for this discussion
40
- */
41
- markPosted(discussionId: string): void;
42
- /**
43
- * Get agent tracker instance
44
- */
45
- getAgentTracker(): AgentTracker;
46
- }
47
- /**
48
- * Factory function to create AgentActivityBot
49
- */
50
- export declare function createAgentActivityBot(agentTracker: AgentTracker, config: AgentActivityBotConfig): AgentActivityBot;
51
- //# sourceMappingURL=agent-activity-bot.d.ts.map
@@ -1,166 +0,0 @@
1
- "use strict";
2
- /**
3
- * Agent Activity Bot
4
- *
5
- * Monitors agent activity and posts summaries to discussions.
6
- * Can respond to queries about agent performance and tool usage.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.AgentActivityBot = void 0;
10
- exports.createAgentActivityBot = createAgentActivityBot;
11
- const logger_1 = require("../lib/logger");
12
- const logger = (0, logger_1.createLogger)({ component: 'agent-activity-bot' });
13
- class AgentActivityBot {
14
- agentTracker;
15
- config;
16
- lastPostedConversation = new Map(); // discussionId -> timestamp
17
- constructor(agentTracker, config) {
18
- this.agentTracker = agentTracker;
19
- this.config = {
20
- minDurationThreshold: 1000,
21
- ...config
22
- };
23
- if (this.config.enabled) {
24
- logger.info('Agent Activity Bot initialized', {
25
- postSummaries: this.config.postSummaryAfterConversation,
26
- minThreshold: this.config.minDurationThreshold
27
- });
28
- }
29
- }
30
- /**
31
- * Generate a summary message for the last conversation in a discussion
32
- */
33
- generateSummary(requestId, discussionId, duration, toolsCalled) {
34
- const recentActivity = this.agentTracker.getRecentActivity(50);
35
- // Find the specific request
36
- const trigger = recentActivity.find(e => e.type === 'trigger' && e.requestId === requestId);
37
- const completion = recentActivity.find(e => e.type === 'completion' && e.requestId === requestId);
38
- if (!trigger || !completion || trigger.type !== 'trigger' || completion.type !== 'completion') {
39
- return `🤖 **Agent Activity**\n\nProcessing completed but details unavailable.`;
40
- }
41
- return this.formatSummaryMessage(trigger.trigger.type, completion.completion.success, duration, toolsCalled, completion.completion.provider || 'unknown');
42
- }
43
- /**
44
- * Format a concise summary message
45
- */
46
- formatSummaryMessage(triggerType, success, duration, toolsCalled, provider) {
47
- const statusIcon = success ? '✅' : '❌';
48
- const triggerIcon = triggerType === 'mention' ? '💬' : '📩';
49
- return `🤖 **Agent Activity**
50
- ${statusIcon} ${success ? 'Completed' : 'Failed'} ${triggerIcon} ${triggerType === 'mention' ? 'Mention' : 'Direct message'}
51
- ⏱️ Duration: ${(duration / 1000).toFixed(2)}s | 🔧 Tools: ${toolsCalled.length > 0 ? toolsCalled.slice(0, 3).join(', ') : 'none'}${toolsCalled.length > 3 ? '...' : ''}
52
- 🧠 Provider: ${provider}`;
53
- }
54
- /**
55
- * Generate detailed agent activity report
56
- */
57
- generateDetailedReport(discussionId) {
58
- const stats = this.agentTracker.getStats();
59
- const recentActivity = this.agentTracker.getRecentActivity(100);
60
- let report = `📊 **Detailed Agent Activity Report**\n\n`;
61
- if (discussionId) {
62
- // Filter for specific discussion
63
- const discussionActivity = recentActivity.filter(e => {
64
- if (e.type === 'trigger')
65
- return e.trigger.discussionId === discussionId;
66
- if (e.type === 'tool_call')
67
- return e.toolCall.discussionId === discussionId;
68
- return false;
69
- });
70
- const discussionTriggers = discussionActivity.filter(e => e.type === 'trigger');
71
- const discussionToolCalls = discussionActivity.filter(e => e.type === 'tool_call');
72
- report += `**This Conversation:**\n`;
73
- report += `- Total Interactions: ${discussionTriggers.length}\n`;
74
- report += `- Tool Calls: ${discussionToolCalls.length}\n`;
75
- report += `\n`;
76
- // Show last 5 interactions
77
- if (discussionTriggers.length > 0) {
78
- report += `**Recent Interactions:**\n`;
79
- discussionTriggers.slice(-5).forEach((event, i) => {
80
- if (event.type === 'trigger') {
81
- report += `${i + 1}. ${event.trigger.type} - ${event.trigger.messagePreview}\n`;
82
- }
83
- });
84
- report += `\n`;
85
- }
86
- }
87
- // Overall stats
88
- report += `**Overall Stats:**\n`;
89
- report += `- Total Triggers: ${stats.totalTriggers}\n`;
90
- report += `- Total Completions: ${stats.totalCompletions}\n`;
91
- report += `- Success Rate: ${stats.successRate.toFixed(1)}%\n`;
92
- report += `- Avg Response Time: ${(stats.averageResponseTime / 1000).toFixed(2)}s\n`;
93
- report += `- Total Tool Calls: ${stats.totalToolCalls}\n\n`;
94
- // Most active agent
95
- if (stats.mostActiveBot) {
96
- report += `**Most Active Agent:**\n`;
97
- report += `- Bot ID: ${stats.mostActiveBot.substring(0, 8)}...\n\n`;
98
- }
99
- // Top tools
100
- if (stats.mostUsedTool) {
101
- report += `**Most Used Tool:** ${stats.mostUsedTool}\n\n`;
102
- }
103
- // Recent tool calls
104
- const recentToolCalls = this.agentTracker.getRecentToolCalls(5);
105
- if (recentToolCalls.length > 0) {
106
- report += `**Recent Tool Calls:**\n`;
107
- recentToolCalls.forEach((call, i) => {
108
- const status = call.toolCall.response.success ? '✅' : '❌';
109
- report += `${i + 1}. ${status} ${call.toolCall.toolName} (${(call.toolCall.duration / 1000).toFixed(2)}s)\n`;
110
- });
111
- }
112
- return report;
113
- }
114
- /**
115
- * Check if message is asking for agent activity details
116
- */
117
- isActivityQuery(messageContent) {
118
- const lower = messageContent.toLowerCase();
119
- return ((lower.includes('agent') || lower.includes('bot') || lower.includes('activity')) && (lower.includes('activity') ||
120
- lower.includes('stats') ||
121
- lower.includes('performance') ||
122
- lower.includes('detail') ||
123
- lower.includes('report') ||
124
- lower.includes('how') ||
125
- lower.includes('what tools') ||
126
- lower.includes('tool usage')));
127
- }
128
- /**
129
- * Should post summary after this conversation?
130
- */
131
- shouldPostSummary(discussionId, duration) {
132
- if (!this.config.enabled || !this.config.postSummaryAfterConversation) {
133
- return false;
134
- }
135
- // Check duration threshold
136
- if (duration < (this.config.minDurationThreshold || 0)) {
137
- return false;
138
- }
139
- // Debounce: Don't post if we posted recently (within 30 seconds)
140
- const lastPosted = this.lastPostedConversation.get(discussionId);
141
- if (lastPosted && Date.now() - lastPosted < 30000) {
142
- return false;
143
- }
144
- return true;
145
- }
146
- /**
147
- * Mark that we posted a summary for this discussion
148
- */
149
- markPosted(discussionId) {
150
- this.lastPostedConversation.set(discussionId, Date.now());
151
- }
152
- /**
153
- * Get agent tracker instance
154
- */
155
- getAgentTracker() {
156
- return this.agentTracker;
157
- }
158
- }
159
- exports.AgentActivityBot = AgentActivityBot;
160
- /**
161
- * Factory function to create AgentActivityBot
162
- */
163
- function createAgentActivityBot(agentTracker, config) {
164
- return new AgentActivityBot(agentTracker, config);
165
- }
166
- //# sourceMappingURL=agent-activity-bot.js.map