@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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upload Files Tool - Clean Architecture Implementation
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates the new tool architecture pattern:
|
|
5
|
+
* - Direct Tool<TSchema> interface implementation
|
|
6
|
+
* - Inline schema and execute logic
|
|
7
|
+
* - No static class wrapper needed
|
|
8
|
+
* - Type-safe with Zod schema inference
|
|
9
|
+
*/
|
|
10
|
+
import { Tool } from '../tool-registry';
|
|
11
|
+
/**
|
|
12
|
+
* Upload Files Tool - Clean implementation following new architecture
|
|
13
|
+
*/
|
|
14
|
+
export declare const uploadFilesTool: Tool;
|
|
15
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Upload Files Tool - Clean Architecture Implementation
|
|
4
|
+
*
|
|
5
|
+
* Demonstrates the new tool architecture pattern:
|
|
6
|
+
* - Direct Tool<TSchema> interface implementation
|
|
7
|
+
* - Inline schema and execute logic
|
|
8
|
+
* - No static class wrapper needed
|
|
9
|
+
* - Type-safe with Zod schema inference
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.uploadFilesTool = void 0;
|
|
13
|
+
const zod_1 = require("zod");
|
|
14
|
+
const tool_registry_1 = require("../tool-registry");
|
|
15
|
+
const logger_1 = require("../../lib/logger");
|
|
16
|
+
const logger = (0, logger_1.createLogger)({ component: 'upload-files-tool' });
|
|
17
|
+
/**
|
|
18
|
+
* Tool description - extracted for clarity
|
|
19
|
+
*/
|
|
20
|
+
const description = `๐งช [PLAYGROUND] Upload files: \`{ "files": [{ "path": "/path/to/file" }] }\` or \`{ "files": [{ "url": "https://..." }] }\`.
|
|
21
|
+
|
|
22
|
+
Max 100MB per file. Returns file IDs for activities.`;
|
|
23
|
+
/**
|
|
24
|
+
* Upload Files Tool - Clean implementation following new architecture
|
|
25
|
+
*/
|
|
26
|
+
exports.uploadFilesTool = {
|
|
27
|
+
name: 'upload_files',
|
|
28
|
+
group: tool_registry_1.ToolGroup.PLAYGROUND,
|
|
29
|
+
description,
|
|
30
|
+
schema: zod_1.z.object({
|
|
31
|
+
files: zod_1.z.union([
|
|
32
|
+
zod_1.z.array(zod_1.z.object({
|
|
33
|
+
url: zod_1.z.string().optional(),
|
|
34
|
+
path: zod_1.z.string().optional(),
|
|
35
|
+
filename: zod_1.z.string().optional(),
|
|
36
|
+
isPublic: zod_1.z.boolean().optional()
|
|
37
|
+
})),
|
|
38
|
+
zod_1.z.string()
|
|
39
|
+
]).describe("Array of files to upload (or JSON string). Each file must have either 'url' or 'path'")
|
|
40
|
+
}),
|
|
41
|
+
async execute(args, context) {
|
|
42
|
+
// Parse files if JSON string
|
|
43
|
+
let files;
|
|
44
|
+
if (typeof args.files === 'string') {
|
|
45
|
+
try {
|
|
46
|
+
files = JSON.parse(args.files);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return {
|
|
50
|
+
content: [{
|
|
51
|
+
type: "text",
|
|
52
|
+
text: `โ Invalid JSON: ${args.files}`
|
|
53
|
+
}]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
files = args.files;
|
|
59
|
+
}
|
|
60
|
+
// Validate each file has url or path
|
|
61
|
+
for (let i = 0; i < files.length; i++) {
|
|
62
|
+
if (!files[i].url && !files[i].path) {
|
|
63
|
+
return {
|
|
64
|
+
content: [{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: `โ File ${i + 1}: must have either 'url' or 'path' property\n\n` +
|
|
67
|
+
`Example: {"path": "/home/user/file.pdf"}`
|
|
68
|
+
}]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
logger.debug('Uploading files', { fileCount: files.length });
|
|
73
|
+
try {
|
|
74
|
+
// Upload all files in parallel
|
|
75
|
+
const results = await Promise.all(files.map(async (fileSpec) => {
|
|
76
|
+
try {
|
|
77
|
+
return await context.hailer.uploadFile(fileSpec);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return {
|
|
81
|
+
success: false,
|
|
82
|
+
error: error instanceof Error ? error.message : String(error),
|
|
83
|
+
source: fileSpec.url || fileSpec.path || 'unknown',
|
|
84
|
+
type: fileSpec.url ? 'url' : 'path'
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
88
|
+
const successes = results.filter(r => r.success);
|
|
89
|
+
const failures = results.filter(r => !r.success);
|
|
90
|
+
let text = `๐ฆ Upload completed: ${successes.length}/${results.length} successful\n\n`;
|
|
91
|
+
if (successes.length > 0) {
|
|
92
|
+
text += `**Uploaded:**\n`;
|
|
93
|
+
successes.forEach((r, i) => {
|
|
94
|
+
text += `${i + 1}. ${r.type === 'url' ? '๐' : '๐'} ${r.source}\n`;
|
|
95
|
+
text += ` ๐ ${r.fileId} (${r.sizeKB} KB)\n`;
|
|
96
|
+
});
|
|
97
|
+
const ids = successes.map(r => r.fileId).join('", "');
|
|
98
|
+
text += `\n๐ก Use: \`fileIds: ["${ids}"]\`\n`;
|
|
99
|
+
}
|
|
100
|
+
if (failures.length > 0) {
|
|
101
|
+
text += `\n**Failed:**\n`;
|
|
102
|
+
failures.forEach((r, i) => {
|
|
103
|
+
text += `${i + 1}. ${r.source}\n โ ${r.error}\n`;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return { content: [{ type: "text", text }] };
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
logger.error('Upload failed', error);
|
|
110
|
+
return {
|
|
111
|
+
content: [{
|
|
112
|
+
type: "text",
|
|
113
|
+
text: `โ Upload failed: ${error instanceof Error ? error.message : String(error)}`
|
|
114
|
+
}]
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insight Tools - Clean Architecture Implementation
|
|
3
|
+
*
|
|
4
|
+
* SQL-like insights over Hailer workflows:
|
|
5
|
+
* - Workflows = Tables
|
|
6
|
+
* - Activities = Rows
|
|
7
|
+
* - Fields = Columns
|
|
8
|
+
*
|
|
9
|
+
* All 4 insight management tools in one file for cohesion.
|
|
10
|
+
*/
|
|
11
|
+
import { Tool } from '../tool-registry';
|
|
12
|
+
export declare const createInsightTool: Tool;
|
|
13
|
+
export declare const previewInsightTool: Tool;
|
|
14
|
+
export declare const getInsightDataTool: Tool;
|
|
15
|
+
export declare const removeInsightTool: Tool;
|
|
16
|
+
export declare const listInsightsTool: Tool;
|
|
17
|
+
//# sourceMappingURL=insight.d.ts.map
|