@hailer/mcp 0.0.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.
- package/.claude/commands/tool-builder.md +37 -0
- package/.claude/commands/ws-pull.md +44 -0
- package/.claude/settings.json +8 -0
- package/.claude/settings.local.json +49 -0
- package/.claude/skills/activity-api/SKILL.md +96 -0
- package/.claude/skills/activity-api/references/activity-endpoints.md +845 -0
- package/.claude/skills/add-app-member-skill/SKILL.md +977 -0
- package/.claude/skills/agent-building/SKILL.md +243 -0
- package/.claude/skills/agent-building/references/architecture-patterns.md +446 -0
- package/.claude/skills/agent-building/references/code-examples.md +587 -0
- package/.claude/skills/agent-building/references/implementation-guide.md +619 -0
- package/.claude/skills/app-api/SKILL.md +219 -0
- package/.claude/skills/app-api/references/app-endpoints.md +759 -0
- package/.claude/skills/building-hailer-apps-skill/SKILL.md +548 -0
- package/.claude/skills/create-app-skill/SKILL.md +1101 -0
- package/.claude/skills/create-insight-skill/SKILL.md +1317 -0
- package/.claude/skills/get-insight-data-skill/SKILL.md +1053 -0
- package/.claude/skills/hailer-api/SKILL.md +283 -0
- package/.claude/skills/hailer-api/references/activities.md +620 -0
- package/.claude/skills/hailer-api/references/authentication.md +216 -0
- package/.claude/skills/hailer-api/references/datasets.md +437 -0
- package/.claude/skills/hailer-api/references/files.md +301 -0
- package/.claude/skills/hailer-api/references/insights.md +469 -0
- package/.claude/skills/hailer-api/references/workflows.md +720 -0
- package/.claude/skills/hailer-api/references/workspaces-users.md +445 -0
- package/.claude/skills/insight-api/SKILL.md +185 -0
- package/.claude/skills/insight-api/references/insight-endpoints.md +514 -0
- package/.claude/skills/install-workflow-skill/SKILL.md +1056 -0
- package/.claude/skills/list-apps-skill/SKILL.md +1010 -0
- package/.claude/skills/list-workflows-minimal-skill/SKILL.md +992 -0
- package/.claude/skills/local-first-skill/SKILL.md +570 -0
- package/.claude/skills/mcp-tools/SKILL.md +419 -0
- package/.claude/skills/mcp-tools/references/api-endpoints.md +499 -0
- package/.claude/skills/mcp-tools/references/data-structures.md +554 -0
- package/.claude/skills/mcp-tools/references/implementation-patterns.md +717 -0
- package/.claude/skills/preview-insight-skill/SKILL.md +1290 -0
- package/.claude/skills/publish-hailer-app-skill/SKILL.md +453 -0
- package/.claude/skills/remove-app-member-skill/SKILL.md +671 -0
- package/.claude/skills/remove-app-skill/SKILL.md +985 -0
- package/.claude/skills/remove-insight-skill/SKILL.md +1011 -0
- package/.claude/skills/remove-workflow-skill/SKILL.md +920 -0
- package/.claude/skills/scaffold-hailer-app-skill/SKILL.md +1034 -0
- package/.claude/skills/skill-testing/README.md +137 -0
- package/.claude/skills/skill-testing/SKILL.md +348 -0
- package/.claude/skills/skill-testing/references/test-patterns.md +705 -0
- package/.claude/skills/skill-testing/references/testing-guide.md +603 -0
- package/.claude/skills/skill-testing/references/validation-checklist.md +537 -0
- package/.claude/skills/tool-builder/SKILL.md +328 -0
- package/.claude/skills/update-app-skill/SKILL.md +970 -0
- package/.claude/skills/update-workflow-field-skill/SKILL.md +1098 -0
- package/.env.example +81 -0
- package/.mcp.json +13 -0
- package/README.md +297 -0
- package/dist/app.d.ts +4 -0
- package/dist/app.js +74 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +5 -0
- package/dist/client/adaptive-documentation-bot.d.ts +108 -0
- package/dist/client/adaptive-documentation-bot.js +475 -0
- package/dist/client/adaptive-documentation-types.d.ts +66 -0
- package/dist/client/adaptive-documentation-types.js +9 -0
- package/dist/client/agent-activity-bot.d.ts +51 -0
- package/dist/client/agent-activity-bot.js +166 -0
- package/dist/client/agent-tracker.d.ts +499 -0
- package/dist/client/agent-tracker.js +659 -0
- package/dist/client/description-updater.d.ts +56 -0
- package/dist/client/description-updater.js +259 -0
- package/dist/client/log-parser.d.ts +72 -0
- package/dist/client/log-parser.js +387 -0
- package/dist/client/mcp-client.d.ts +50 -0
- package/dist/client/mcp-client.js +532 -0
- package/dist/client/message-processor.d.ts +35 -0
- package/dist/client/message-processor.js +352 -0
- package/dist/client/multi-bot-manager.d.ts +24 -0
- package/dist/client/multi-bot-manager.js +74 -0
- package/dist/client/providers/anthropic-provider.d.ts +19 -0
- package/dist/client/providers/anthropic-provider.js +631 -0
- package/dist/client/providers/llm-provider.d.ts +47 -0
- package/dist/client/providers/llm-provider.js +367 -0
- package/dist/client/providers/openai-provider.d.ts +23 -0
- package/dist/client/providers/openai-provider.js +621 -0
- package/dist/client/simple-llm-caller.d.ts +19 -0
- package/dist/client/simple-llm-caller.js +100 -0
- package/dist/client/skill-generator.d.ts +81 -0
- package/dist/client/skill-generator.js +386 -0
- package/dist/client/test-adaptive-bot.d.ts +9 -0
- package/dist/client/test-adaptive-bot.js +82 -0
- package/dist/client/token-pricing.d.ts +38 -0
- package/dist/client/token-pricing.js +127 -0
- package/dist/client/token-tracker.d.ts +232 -0
- package/dist/client/token-tracker.js +457 -0
- package/dist/client/token-usage-bot.d.ts +53 -0
- package/dist/client/token-usage-bot.js +153 -0
- package/dist/client/tool-executor.d.ts +69 -0
- package/dist/client/tool-executor.js +159 -0
- package/dist/client/tool-schema-loader.d.ts +60 -0
- package/dist/client/tool-schema-loader.js +178 -0
- package/dist/client/types.d.ts +69 -0
- package/dist/client/types.js +7 -0
- package/dist/config.d.ts +162 -0
- package/dist/config.js +296 -0
- package/dist/core.d.ts +26 -0
- package/dist/core.js +147 -0
- package/dist/lib/context-manager.d.ts +111 -0
- package/dist/lib/context-manager.js +431 -0
- package/dist/lib/logger.d.ts +74 -0
- package/dist/lib/logger.js +277 -0
- package/dist/lib/materialize.d.ts +3 -0
- package/dist/lib/materialize.js +101 -0
- package/dist/lib/normalizedName.d.ts +7 -0
- package/dist/lib/normalizedName.js +48 -0
- package/dist/lib/prompt-length-manager.d.ts +81 -0
- package/dist/lib/prompt-length-manager.js +457 -0
- package/dist/lib/terminal-prompt.d.ts +9 -0
- package/dist/lib/terminal-prompt.js +108 -0
- package/dist/mcp/UserContextCache.d.ts +56 -0
- package/dist/mcp/UserContextCache.js +163 -0
- package/dist/mcp/auth.d.ts +2 -0
- package/dist/mcp/auth.js +29 -0
- package/dist/mcp/hailer-clients.d.ts +42 -0
- package/dist/mcp/hailer-clients.js +246 -0
- package/dist/mcp/signal-handler.d.ts +45 -0
- package/dist/mcp/signal-handler.js +317 -0
- package/dist/mcp/tool-registry.d.ts +100 -0
- package/dist/mcp/tool-registry.js +306 -0
- package/dist/mcp/tools/activity.d.ts +15 -0
- package/dist/mcp/tools/activity.js +955 -0
- package/dist/mcp/tools/app.d.ts +20 -0
- package/dist/mcp/tools/app.js +1488 -0
- package/dist/mcp/tools/discussion.d.ts +19 -0
- package/dist/mcp/tools/discussion.js +950 -0
- package/dist/mcp/tools/file.d.ts +15 -0
- package/dist/mcp/tools/file.js +119 -0
- package/dist/mcp/tools/insight.d.ts +17 -0
- package/dist/mcp/tools/insight.js +806 -0
- package/dist/mcp/tools/skill.d.ts +10 -0
- package/dist/mcp/tools/skill.js +279 -0
- package/dist/mcp/tools/user.d.ts +10 -0
- package/dist/mcp/tools/user.js +108 -0
- package/dist/mcp/tools/workflow-template.d.ts +19 -0
- package/dist/mcp/tools/workflow-template.js +822 -0
- package/dist/mcp/tools/workflow.d.ts +18 -0
- package/dist/mcp/tools/workflow.js +1362 -0
- package/dist/mcp/utils/api-errors.d.ts +45 -0
- package/dist/mcp/utils/api-errors.js +160 -0
- package/dist/mcp/utils/data-transformers.d.ts +102 -0
- package/dist/mcp/utils/data-transformers.js +194 -0
- package/dist/mcp/utils/file-upload.d.ts +33 -0
- package/dist/mcp/utils/file-upload.js +148 -0
- package/dist/mcp/utils/hailer-api-client.d.ts +120 -0
- package/dist/mcp/utils/hailer-api-client.js +323 -0
- package/dist/mcp/utils/index.d.ts +13 -0
- package/dist/mcp/utils/index.js +39 -0
- package/dist/mcp/utils/logger.d.ts +42 -0
- package/dist/mcp/utils/logger.js +103 -0
- package/dist/mcp/utils/types.d.ts +286 -0
- package/dist/mcp/utils/types.js +7 -0
- package/dist/mcp/workspace-cache.d.ts +42 -0
- package/dist/mcp/workspace-cache.js +97 -0
- package/dist/mcp-server.d.ts +42 -0
- package/dist/mcp-server.js +280 -0
- package/package.json +56 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Management Tools - Clean Architecture
|
|
3
|
+
*
|
|
4
|
+
* Tools for discovering and loading skill documentation.
|
|
5
|
+
* Skills are comprehensive documentation files with examples and best practices.
|
|
6
|
+
*/
|
|
7
|
+
import { Tool } from '../tool-registry';
|
|
8
|
+
export declare const listSkillsTool: Tool;
|
|
9
|
+
export declare const getSkillTool: Tool;
|
|
10
|
+
//# sourceMappingURL=skill.d.ts.map
|
|
@@ -0,0 +1,279 @@
|
|
|
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
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Tools - Clean Architecture Implementation
|
|
3
|
+
*
|
|
4
|
+
* Tools for managing users in Hailer workspaces:
|
|
5
|
+
* - Search for users by name (WRITE)
|
|
6
|
+
* - Get initialization data (READ) - currently disabled
|
|
7
|
+
*/
|
|
8
|
+
import { Tool } from '../tool-registry';
|
|
9
|
+
export declare const searchWorkspaceUsersTool: Tool;
|
|
10
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* User Tools - Clean Architecture Implementation
|
|
4
|
+
*
|
|
5
|
+
* Tools for managing users in Hailer workspaces:
|
|
6
|
+
* - Search for users by name (WRITE)
|
|
7
|
+
* - Get initialization data (READ) - currently disabled
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.searchWorkspaceUsersTool = void 0;
|
|
11
|
+
const zod_1 = require("zod");
|
|
12
|
+
const tool_registry_1 = require("../tool-registry");
|
|
13
|
+
const index_1 = require("../utils/index");
|
|
14
|
+
const logger = (0, index_1.createLogger)({ component: 'user-tools' });
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// TOOL 1: SEARCH WORKSPACE USERS
|
|
17
|
+
// ============================================================================
|
|
18
|
+
const searchWorkspaceUsersDescription = `Search for users in the current workspace by name - Returns valid user IDs for assignment`;
|
|
19
|
+
exports.searchWorkspaceUsersTool = {
|
|
20
|
+
name: 'search_workspace_users',
|
|
21
|
+
group: tool_registry_1.ToolGroup.READ,
|
|
22
|
+
description: searchWorkspaceUsersDescription,
|
|
23
|
+
schema: zod_1.z.object({
|
|
24
|
+
query: zod_1.z
|
|
25
|
+
.string()
|
|
26
|
+
.min(1, "Query cannot be empty")
|
|
27
|
+
.describe("User's first name, last name, or full name to search for"),
|
|
28
|
+
exactMatch: zod_1.z
|
|
29
|
+
.boolean()
|
|
30
|
+
.optional()
|
|
31
|
+
.default(false)
|
|
32
|
+
.describe("Whether to require exact match (default: partial match)"),
|
|
33
|
+
}),
|
|
34
|
+
async execute(args, context) {
|
|
35
|
+
logger.debug('Searching workspace users', {
|
|
36
|
+
query: args.query,
|
|
37
|
+
apiKey: context.apiKey.substring(0, 8) + '...'
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
if (!context.workspaceCache) {
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: "ā Workspace cache not available for user search. You must report it to user that there is a problem with MCP Server that must be forwarded to development team",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const query = args.query.toLowerCase().trim();
|
|
51
|
+
const exactMatch = args.exactMatch;
|
|
52
|
+
const matchingUsers = context.workspaceCache.users.filter((user) => {
|
|
53
|
+
const fullName = user.fullName.toLowerCase();
|
|
54
|
+
const firstName = (user.firstname || "").toLowerCase();
|
|
55
|
+
const lastName = (user.lastname || "").toLowerCase();
|
|
56
|
+
if (exactMatch) {
|
|
57
|
+
return (fullName === query || firstName === query || lastName === query);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return (fullName.includes(query) ||
|
|
61
|
+
firstName.includes(query) ||
|
|
62
|
+
lastName.includes(query));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
if (matchingUsers.length === 0) {
|
|
66
|
+
return {
|
|
67
|
+
content: [
|
|
68
|
+
{
|
|
69
|
+
type: "text",
|
|
70
|
+
text: `ā No users found matching "${args.query}" in the current workspace.\n\n` +
|
|
71
|
+
`š” Available users:\n${context.workspaceCache.users.map((u) => `- ${u.fullName} (${u.id})`).join("\n")}`,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const userList = matchingUsers.map((user) => ({
|
|
77
|
+
id: user.id,
|
|
78
|
+
name: user.fullName,
|
|
79
|
+
firstName: user.firstname,
|
|
80
|
+
lastName: user.lastname,
|
|
81
|
+
}));
|
|
82
|
+
return {
|
|
83
|
+
content: [
|
|
84
|
+
{
|
|
85
|
+
type: "text",
|
|
86
|
+
text: `ā
Found ${matchingUsers.length} user(s) matching "${args.query}":\n\n` +
|
|
87
|
+
userList
|
|
88
|
+
.map((user) => `⢠**${user.name}**\n - ID: \`${user.id}\`\n - Use this ID for assignment or followers`)
|
|
89
|
+
.join("\n\n") +
|
|
90
|
+
`\n\nš” Use these IDs in create_activity fields or followerIds parameters.`,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
logger.error("Error searching workspace users", error);
|
|
97
|
+
return {
|
|
98
|
+
content: [
|
|
99
|
+
{
|
|
100
|
+
type: "text",
|
|
101
|
+
text: `ā Error searching users: ${error instanceof Error ? error.message : String(error)}`,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|