@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,279 +0,0 @@
1
- "use strict";
2
- /**
3
- * Skill Management Tools - Clean Architecture
4
- *
5
- * Tools for discovering and loading skill documentation.
6
- * Skills are comprehensive documentation files with examples and best practices.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.getSkillTool = exports.listSkillsTool = void 0;
10
- const zod_1 = require("zod");
11
- const tool_registry_1 = require("../tool-registry");
12
- const logger_1 = require("../../lib/logger");
13
- const fs_1 = require("fs");
14
- const path_1 = require("path");
15
- const logger = (0, logger_1.createLogger)({ component: 'skill-tools' });
16
- // Module-level cache for skill content
17
- const skillContentCache = new Map();
18
- // ============================================================================
19
- // HELPER FUNCTIONS
20
- // ============================================================================
21
- /**
22
- * Parse YAML frontmatter from skill file
23
- */
24
- function parseSkillMetadata(skillPath) {
25
- try {
26
- const content = (0, fs_1.readFileSync)(skillPath, 'utf-8');
27
- // Check if file starts with YAML frontmatter
28
- if (!content.startsWith('---\n')) {
29
- return null;
30
- }
31
- // Extract frontmatter (between first and second ---)
32
- const endOfFrontmatter = content.indexOf('\n---\n', 4);
33
- if (endOfFrontmatter === -1) {
34
- return null;
35
- }
36
- const frontmatter = content.substring(4, endOfFrontmatter);
37
- // Simple YAML parsing for name and description
38
- const nameMatch = frontmatter.match(/^name:\s*(.+)$/m);
39
- const descMatch = frontmatter.match(/^description:\s*(.+)$/m);
40
- return {
41
- name: nameMatch ? nameMatch[1].trim() : '',
42
- description: descMatch ? descMatch[1].trim() : ''
43
- };
44
- }
45
- catch (error) {
46
- logger.debug('Error parsing skill metadata', { skillPath, error });
47
- return null;
48
- }
49
- }
50
- /**
51
- * Get all available skills with metadata from .claude/skills directory
52
- */
53
- function getAvailableSkillsWithMetadata() {
54
- const skillsPath = (0, path_1.join)(process.cwd(), '.claude', 'skills');
55
- if (!(0, fs_1.existsSync)(skillsPath)) {
56
- return [];
57
- }
58
- try {
59
- return (0, fs_1.readdirSync)(skillsPath, { withFileTypes: true })
60
- .filter(dirent => dirent.isDirectory())
61
- .map(dirent => {
62
- const skillName = dirent.name;
63
- const skillFile = (0, path_1.join)(skillsPath, skillName, 'SKILL.md');
64
- if (!(0, fs_1.existsSync)(skillFile)) {
65
- return null;
66
- }
67
- const metadata = parseSkillMetadata(skillFile);
68
- return {
69
- skillName,
70
- name: metadata?.name || skillName,
71
- description: metadata?.description || 'No description available'
72
- };
73
- })
74
- .filter((skill) => skill !== null);
75
- }
76
- catch (error) {
77
- logger.error('Error reading skills directory', error);
78
- return [];
79
- }
80
- }
81
- /**
82
- * Get all available skills from .claude/skills directory (simple list)
83
- */
84
- function getAvailableSkills() {
85
- const skillsPath = (0, path_1.join)(process.cwd(), '.claude', 'skills');
86
- if (!(0, fs_1.existsSync)(skillsPath)) {
87
- return [];
88
- }
89
- try {
90
- return (0, fs_1.readdirSync)(skillsPath, { withFileTypes: true })
91
- .filter(dirent => dirent.isDirectory())
92
- .map(dirent => dirent.name)
93
- .filter(name => {
94
- // Only include directories that have SKILL.md
95
- const skillFile = (0, path_1.join)(skillsPath, name, 'SKILL.md');
96
- return (0, fs_1.existsSync)(skillFile);
97
- });
98
- }
99
- catch (error) {
100
- logger.error('Error reading skills directory', error);
101
- return [];
102
- }
103
- }
104
- // ============================================================================
105
- // TOOL 1: LIST SKILLS
106
- // ============================================================================
107
- const listSkillsDescription = `📚 List all available skills - Get skill index with names and descriptions
108
-
109
- **What it returns:**
110
- - Skill name/ID (used with get_skill tool)
111
- - Display name
112
- - Brief description of what the skill covers
113
-
114
- **Usage:**
115
- 1. Call list_skills() to see all available skills
116
- 2. Pick relevant skill based on your task
117
- 3. Call get_skill({ skillName: "..." }) to load full documentation
118
-
119
- **Example:**
120
- \`\`\`javascript
121
- // Step 1: List all skills
122
- list_skills()
123
-
124
- // Step 2: Load specific skill
125
- get_skill({ skillName: "install-workflow-skill" })
126
- \`\`\`
127
-
128
- **When to use:**
129
- - Discovering available documentation
130
- - Finding relevant skill for your task
131
- - Before loading full skill content to save tokens`;
132
- const listSkillsSchema = zod_1.z.object({});
133
- exports.listSkillsTool = {
134
- name: 'list_skills',
135
- group: tool_registry_1.ToolGroup.PLAYGROUND,
136
- description: listSkillsDescription,
137
- schema: listSkillsSchema,
138
- async execute(_args, _context) {
139
- logger.debug('Listing all skills');
140
- const skills = getAvailableSkillsWithMetadata();
141
- if (skills.length === 0) {
142
- return {
143
- content: [{
144
- type: "text",
145
- text: `📚 **No skills found**\n\n` +
146
- `Skills should be located in \`.claude/skills/{skill-name}/SKILL.md\``
147
- }]
148
- };
149
- }
150
- // Build formatted skill list
151
- const skillList = skills.map((skill, index) => {
152
- return `${index + 1}. **${skill.skillName}**\n` +
153
- ` Name: ${skill.name}\n` +
154
- ` Description: ${skill.description}`;
155
- }).join('\n\n');
156
- logger.info('Listed skills', { count: skills.length });
157
- return {
158
- content: [{
159
- type: "text",
160
- text: `📚 **Available Skills** (${skills.length} total)\n\n` +
161
- `${skillList}\n\n` +
162
- `---\n\n` +
163
- `💡 **Next step:** Use \`get_skill({ skillName: "..." })\` to load full documentation for a specific skill.`
164
- }]
165
- };
166
- }
167
- };
168
- // ============================================================================
169
- // TOOL 2: GET SKILL
170
- // ============================================================================
171
- const getSkillDescription = `📚 Get skill documentation - Load detailed guides for complex tools
172
-
173
- **What are skills?**
174
- Skills are comprehensive documentation files with examples, best practices, and troubleshooting.
175
-
176
- **When to use:**
177
- - Before calling complex tools (install_workflow, create_insight, update_workflow_field, etc.)
178
- - When tool descriptions say "Use Skill: [skill-name]"
179
- - When you need detailed examples and field type documentation
180
- - When debugging errors or understanding tool requirements
181
-
182
- **Discovery:**
183
- - Use \`list_skills()\` to see all available skills with descriptions
184
- - Skills are automatically cached after first load
185
-
186
- **Usage pattern:**
187
- 1. Tool description mentions skill (e.g., "Use Skill: install-workflow-skill")
188
- 2. Call get_skill({ skillName: "install-workflow-skill" })
189
- 3. Read documentation with examples
190
- 4. Call the actual tool with correct format
191
-
192
- **Example:**
193
- \`\`\`javascript
194
- // Step 1: Load skill (cached after first load)
195
- get_skill({ skillName: "install-workflow-skill" })
196
-
197
- // Step 2: Read examples and understand format
198
-
199
- // Step 3: Call tool with correct format
200
- install_workflow({
201
- workflowTemplates: [{ ... }]
202
- })
203
- \`\`\`
204
-
205
- **Token efficiency:** Skills are cached after first load to avoid re-reading from disk.`;
206
- const getSkillSchema = zod_1.z.object({
207
- skillName: zod_1.z
208
- .string()
209
- .min(1)
210
- .describe("Skill name (e.g., 'install-workflow-skill', 'create-insight-skill')")
211
- });
212
- exports.getSkillTool = {
213
- name: 'get_skill',
214
- group: tool_registry_1.ToolGroup.PLAYGROUND,
215
- description: getSkillDescription,
216
- schema: getSkillSchema,
217
- async execute(args, _context) {
218
- const skillName = args.skillName;
219
- logger.debug('Getting skill', { skillName });
220
- // Check cache first
221
- if (skillContentCache.has(skillName)) {
222
- logger.debug('Using cached skill content', { skillName });
223
- const cachedContent = skillContentCache.get(skillName);
224
- return {
225
- content: [{
226
- type: "text",
227
- text: `📚 **Skill Loaded (cached):** \`${skillName}\`\n\n${cachedContent}\n\n` +
228
- `---\n\n` +
229
- `💡 **Next step:** Use the examples and guidance above to call the related MCP tool correctly.`
230
- }]
231
- };
232
- }
233
- // Build path to skill file
234
- const skillPath = (0, path_1.join)(process.cwd(), '.claude', 'skills', skillName, 'SKILL.md');
235
- // Check if skill exists
236
- if (!(0, fs_1.existsSync)(skillPath)) {
237
- const availableSkills = getAvailableSkills();
238
- return {
239
- content: [{
240
- type: "text",
241
- text: `❌ **Skill not found:** \`${skillName}\`\n\n` +
242
- `**Tip:** Use \`list_skills()\` to see all available skills.\n\n` +
243
- `**Quick list:**\n${availableSkills.map(s => `- ${s}`).join('\n')}\n\n` +
244
- `**Note:** Skill names must match directory names in \`.claude/skills/\``
245
- }]
246
- };
247
- }
248
- try {
249
- // Read skill content
250
- const skillContent = (0, fs_1.readFileSync)(skillPath, 'utf-8');
251
- // Cache the content
252
- skillContentCache.set(skillName, skillContent);
253
- logger.info('Skill loaded and cached', {
254
- skillName,
255
- contentLength: skillContent.length,
256
- cacheSize: skillContentCache.size
257
- });
258
- return {
259
- content: [{
260
- type: "text",
261
- text: `📚 **Skill Loaded:** \`${skillName}\`\n\n${skillContent}\n\n` +
262
- `---\n\n` +
263
- `💡 **Next step:** Use the examples and guidance above to call the related MCP tool correctly.`
264
- }]
265
- };
266
- }
267
- catch (error) {
268
- logger.error('Error reading skill file', error);
269
- return {
270
- content: [{
271
- type: "text",
272
- text: `❌ **Error reading skill:** ${error instanceof Error ? error.message : String(error)}\n\n` +
273
- `Skill path: \`${skillPath}\``
274
- }]
275
- };
276
- }
277
- }
278
- };
279
- //# sourceMappingURL=skill.js.map
@@ -1,19 +0,0 @@
1
- /**
2
- * Workflow Template Tools - Clean Architecture Implementation
3
- *
4
- * Document template management for Hailer workflows:
5
- * - Templates define how to convert activity data into documents (PDF, etc.)
6
- * - Templates can be workflow-specific or global
7
- * - Preview and install capabilities for testing and deployment
8
- *
9
- * All 7 template management tools in one file for cohesion.
10
- */
11
- import { Tool } from '../tool-registry';
12
- export declare const listTemplatesTool: Tool;
13
- export declare const getTemplateTool: Tool;
14
- export declare const createTemplateTool: Tool;
15
- export declare const updateTemplateTool: Tool;
16
- export declare const deleteTemplateTool: Tool;
17
- export declare const previewTemplateTool: Tool;
18
- export declare const installTemplateTool: Tool;
19
- //# sourceMappingURL=workflow-template.d.ts.map