@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.
- package/.claude/agents/agent-dmitri-activity-crud.md +3 -1
- package/.claude/agents/agent-giuseppe-app-builder.md +11 -12
- package/.claude/agents/agent-kenji-data-reader.md +5 -3
- package/.claude/hooks/sync-marketplace-agents.cjs +117 -56
- package/.claude/skills/hailer-app-builder/SKILL.md +506 -0
- package/.claude/skills/publish-hailer-app/SKILL.md +169 -0
- package/.claude/skills/tool-parameter-usage/SKILL.md +112 -0
- package/CHANGELOG.md +20 -0
- package/CLAUDE.md +37 -16
- package/REFACTOR_STATUS.md +127 -0
- package/dist/cli.js +0 -0
- package/dist/client/agents/base.d.ts +202 -0
- package/dist/client/agents/base.js +737 -0
- package/dist/client/agents/definitions.d.ts +53 -0
- package/dist/client/agents/definitions.js +178 -0
- package/dist/client/agents/orchestrator.d.ts +119 -0
- package/dist/client/agents/orchestrator.js +760 -0
- package/dist/client/agents/specialist.d.ts +86 -0
- package/dist/client/agents/specialist.js +340 -0
- package/dist/client/bot-manager.d.ts +44 -0
- package/dist/client/bot-manager.js +173 -0
- package/dist/client/chat-agent-daemon.d.ts +464 -0
- package/dist/client/chat-agent-daemon.js +1774 -0
- package/dist/client/daemon-factory.d.ts +106 -0
- package/dist/client/daemon-factory.js +301 -0
- package/dist/client/factory.d.ts +107 -0
- package/dist/client/factory.js +304 -0
- package/dist/client/index.d.ts +17 -0
- package/dist/client/index.js +38 -0
- package/dist/client/multi-bot-manager.d.ts +18 -0
- package/dist/client/multi-bot-manager.js +88 -1
- package/dist/client/orchestrator-daemon.d.ts +87 -0
- package/dist/client/orchestrator-daemon.js +444 -0
- package/dist/client/services/agent-registry.d.ts +108 -0
- package/dist/client/services/agent-registry.js +630 -0
- package/dist/client/services/conversation-manager.d.ts +50 -0
- package/dist/client/services/conversation-manager.js +136 -0
- package/dist/client/services/mcp-client.d.ts +48 -0
- package/dist/client/services/mcp-client.js +105 -0
- package/dist/client/services/message-classifier.d.ts +37 -0
- package/dist/client/services/message-classifier.js +187 -0
- package/dist/client/services/message-formatter.d.ts +84 -0
- package/dist/client/services/message-formatter.js +353 -0
- package/dist/client/services/session-logger.d.ts +106 -0
- package/dist/client/services/session-logger.js +446 -0
- package/dist/client/services/tool-executor.d.ts +41 -0
- package/dist/client/services/tool-executor.js +169 -0
- package/dist/client/services/workspace-schema-cache.d.ts +149 -0
- package/dist/client/services/workspace-schema-cache.js +732 -0
- package/dist/client/specialist-daemon.d.ts +77 -0
- package/dist/client/specialist-daemon.js +197 -0
- package/dist/client/specialists.d.ts +53 -0
- package/dist/client/specialists.js +178 -0
- package/dist/client/tool-schema-loader.d.ts +4 -3
- package/dist/client/tool-schema-loader.js +54 -8
- package/dist/client/types.d.ts +283 -55
- package/dist/client/types.js +113 -2
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/core.d.ts +10 -2
- package/dist/core.js +43 -27
- package/dist/lib/logger.js +15 -3
- package/dist/mcp/UserContextCache.js +2 -2
- package/dist/mcp/hailer-clients.js +5 -5
- package/dist/mcp/signal-handler.js +27 -5
- package/dist/mcp/tools/activity.js +137 -65
- package/dist/mcp/tools/app-core.js +4 -140
- package/dist/mcp/tools/app-marketplace.js +15 -260
- package/dist/mcp/tools/app-member.js +2 -73
- package/dist/mcp/tools/app-scaffold.js +146 -87
- package/dist/mcp/tools/discussion.js +348 -73
- package/dist/mcp/tools/insight.js +74 -190
- package/dist/mcp/tools/workflow.js +20 -94
- package/dist/mcp/utils/hailer-api-client.d.ts +4 -2
- package/dist/mcp/utils/hailer-api-client.js +24 -10
- package/dist/mcp-server.d.ts +4 -0
- package/dist/mcp-server.js +24 -4
- package/dist/routes/agents.d.ts +44 -0
- package/dist/routes/agents.js +311 -0
- package/dist/services/agent-credential-store.d.ts +73 -0
- package/dist/services/agent-credential-store.js +212 -0
- package/lineup-manager/dist/assets/index-8ce6041d.css +1 -0
- package/lineup-manager/dist/assets/index-e168f265.js +600 -0
- package/lineup-manager/dist/index.html +15 -0
- package/lineup-manager/dist/manifest.json +17 -0
- package/lineup-manager/dist/vite.svg +1 -0
- package/package.json +1 -1
- package/dist/client/adaptive-documentation-bot.d.ts +0 -106
- package/dist/client/adaptive-documentation-bot.js +0 -464
- package/dist/client/adaptive-documentation-types.d.ts +0 -66
- package/dist/client/adaptive-documentation-types.js +0 -9
- package/dist/client/agent-activity-bot.d.ts +0 -51
- package/dist/client/agent-activity-bot.js +0 -166
- package/dist/client/agent-tracker.d.ts +0 -499
- package/dist/client/agent-tracker.js +0 -659
- package/dist/client/description-updater.d.ts +0 -56
- package/dist/client/description-updater.js +0 -259
- package/dist/client/log-parser.d.ts +0 -72
- package/dist/client/log-parser.js +0 -387
- package/dist/client/mcp-assistant.d.ts +0 -21
- package/dist/client/mcp-assistant.js +0 -58
- package/dist/client/mcp-client.d.ts +0 -50
- package/dist/client/mcp-client.js +0 -538
- package/dist/client/message-processor.d.ts +0 -35
- package/dist/client/message-processor.js +0 -357
- package/dist/client/providers/anthropic-provider.d.ts +0 -19
- package/dist/client/providers/anthropic-provider.js +0 -645
- package/dist/client/providers/assistant-provider.d.ts +0 -17
- package/dist/client/providers/assistant-provider.js +0 -51
- package/dist/client/providers/llm-provider.d.ts +0 -47
- package/dist/client/providers/llm-provider.js +0 -367
- package/dist/client/providers/openai-provider.d.ts +0 -23
- package/dist/client/providers/openai-provider.js +0 -630
- package/dist/client/simple-llm-caller.d.ts +0 -19
- package/dist/client/simple-llm-caller.js +0 -100
- package/dist/client/skill-generator.d.ts +0 -81
- package/dist/client/skill-generator.js +0 -386
- package/dist/client/test-adaptive-bot.d.ts +0 -9
- package/dist/client/test-adaptive-bot.js +0 -82
- package/dist/client/token-pricing.d.ts +0 -38
- package/dist/client/token-pricing.js +0 -127
- package/dist/client/token-tracker.d.ts +0 -232
- package/dist/client/token-tracker.js +0 -457
- package/dist/client/token-usage-bot.d.ts +0 -53
- package/dist/client/token-usage-bot.js +0 -153
- package/dist/client/tool-executor.d.ts +0 -69
- package/dist/client/tool-executor.js +0 -159
- package/dist/lib/materialize.d.ts +0 -3
- package/dist/lib/materialize.js +0 -101
- package/dist/lib/normalizedName.d.ts +0 -7
- package/dist/lib/normalizedName.js +0 -48
- package/dist/lib/terminal-prompt.d.ts +0 -9
- package/dist/lib/terminal-prompt.js +0 -108
- package/dist/mcp/tools/skill.d.ts +0 -10
- package/dist/mcp/tools/skill.js +0 -279
- package/dist/mcp/tools/workflow-template.d.ts +0 -19
- 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
|