@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.
Files changed (163) hide show
  1. package/.claude/commands/tool-builder.md +37 -0
  2. package/.claude/commands/ws-pull.md +44 -0
  3. package/.claude/settings.json +8 -0
  4. package/.claude/settings.local.json +49 -0
  5. package/.claude/skills/activity-api/SKILL.md +96 -0
  6. package/.claude/skills/activity-api/references/activity-endpoints.md +845 -0
  7. package/.claude/skills/add-app-member-skill/SKILL.md +977 -0
  8. package/.claude/skills/agent-building/SKILL.md +243 -0
  9. package/.claude/skills/agent-building/references/architecture-patterns.md +446 -0
  10. package/.claude/skills/agent-building/references/code-examples.md +587 -0
  11. package/.claude/skills/agent-building/references/implementation-guide.md +619 -0
  12. package/.claude/skills/app-api/SKILL.md +219 -0
  13. package/.claude/skills/app-api/references/app-endpoints.md +759 -0
  14. package/.claude/skills/building-hailer-apps-skill/SKILL.md +548 -0
  15. package/.claude/skills/create-app-skill/SKILL.md +1101 -0
  16. package/.claude/skills/create-insight-skill/SKILL.md +1317 -0
  17. package/.claude/skills/get-insight-data-skill/SKILL.md +1053 -0
  18. package/.claude/skills/hailer-api/SKILL.md +283 -0
  19. package/.claude/skills/hailer-api/references/activities.md +620 -0
  20. package/.claude/skills/hailer-api/references/authentication.md +216 -0
  21. package/.claude/skills/hailer-api/references/datasets.md +437 -0
  22. package/.claude/skills/hailer-api/references/files.md +301 -0
  23. package/.claude/skills/hailer-api/references/insights.md +469 -0
  24. package/.claude/skills/hailer-api/references/workflows.md +720 -0
  25. package/.claude/skills/hailer-api/references/workspaces-users.md +445 -0
  26. package/.claude/skills/insight-api/SKILL.md +185 -0
  27. package/.claude/skills/insight-api/references/insight-endpoints.md +514 -0
  28. package/.claude/skills/install-workflow-skill/SKILL.md +1056 -0
  29. package/.claude/skills/list-apps-skill/SKILL.md +1010 -0
  30. package/.claude/skills/list-workflows-minimal-skill/SKILL.md +992 -0
  31. package/.claude/skills/local-first-skill/SKILL.md +570 -0
  32. package/.claude/skills/mcp-tools/SKILL.md +419 -0
  33. package/.claude/skills/mcp-tools/references/api-endpoints.md +499 -0
  34. package/.claude/skills/mcp-tools/references/data-structures.md +554 -0
  35. package/.claude/skills/mcp-tools/references/implementation-patterns.md +717 -0
  36. package/.claude/skills/preview-insight-skill/SKILL.md +1290 -0
  37. package/.claude/skills/publish-hailer-app-skill/SKILL.md +453 -0
  38. package/.claude/skills/remove-app-member-skill/SKILL.md +671 -0
  39. package/.claude/skills/remove-app-skill/SKILL.md +985 -0
  40. package/.claude/skills/remove-insight-skill/SKILL.md +1011 -0
  41. package/.claude/skills/remove-workflow-skill/SKILL.md +920 -0
  42. package/.claude/skills/scaffold-hailer-app-skill/SKILL.md +1034 -0
  43. package/.claude/skills/skill-testing/README.md +137 -0
  44. package/.claude/skills/skill-testing/SKILL.md +348 -0
  45. package/.claude/skills/skill-testing/references/test-patterns.md +705 -0
  46. package/.claude/skills/skill-testing/references/testing-guide.md +603 -0
  47. package/.claude/skills/skill-testing/references/validation-checklist.md +537 -0
  48. package/.claude/skills/tool-builder/SKILL.md +328 -0
  49. package/.claude/skills/update-app-skill/SKILL.md +970 -0
  50. package/.claude/skills/update-workflow-field-skill/SKILL.md +1098 -0
  51. package/.env.example +81 -0
  52. package/.mcp.json +13 -0
  53. package/README.md +297 -0
  54. package/dist/app.d.ts +4 -0
  55. package/dist/app.js +74 -0
  56. package/dist/cli.d.ts +3 -0
  57. package/dist/cli.js +5 -0
  58. package/dist/client/adaptive-documentation-bot.d.ts +108 -0
  59. package/dist/client/adaptive-documentation-bot.js +475 -0
  60. package/dist/client/adaptive-documentation-types.d.ts +66 -0
  61. package/dist/client/adaptive-documentation-types.js +9 -0
  62. package/dist/client/agent-activity-bot.d.ts +51 -0
  63. package/dist/client/agent-activity-bot.js +166 -0
  64. package/dist/client/agent-tracker.d.ts +499 -0
  65. package/dist/client/agent-tracker.js +659 -0
  66. package/dist/client/description-updater.d.ts +56 -0
  67. package/dist/client/description-updater.js +259 -0
  68. package/dist/client/log-parser.d.ts +72 -0
  69. package/dist/client/log-parser.js +387 -0
  70. package/dist/client/mcp-client.d.ts +50 -0
  71. package/dist/client/mcp-client.js +532 -0
  72. package/dist/client/message-processor.d.ts +35 -0
  73. package/dist/client/message-processor.js +352 -0
  74. package/dist/client/multi-bot-manager.d.ts +24 -0
  75. package/dist/client/multi-bot-manager.js +74 -0
  76. package/dist/client/providers/anthropic-provider.d.ts +19 -0
  77. package/dist/client/providers/anthropic-provider.js +631 -0
  78. package/dist/client/providers/llm-provider.d.ts +47 -0
  79. package/dist/client/providers/llm-provider.js +367 -0
  80. package/dist/client/providers/openai-provider.d.ts +23 -0
  81. package/dist/client/providers/openai-provider.js +621 -0
  82. package/dist/client/simple-llm-caller.d.ts +19 -0
  83. package/dist/client/simple-llm-caller.js +100 -0
  84. package/dist/client/skill-generator.d.ts +81 -0
  85. package/dist/client/skill-generator.js +386 -0
  86. package/dist/client/test-adaptive-bot.d.ts +9 -0
  87. package/dist/client/test-adaptive-bot.js +82 -0
  88. package/dist/client/token-pricing.d.ts +38 -0
  89. package/dist/client/token-pricing.js +127 -0
  90. package/dist/client/token-tracker.d.ts +232 -0
  91. package/dist/client/token-tracker.js +457 -0
  92. package/dist/client/token-usage-bot.d.ts +53 -0
  93. package/dist/client/token-usage-bot.js +153 -0
  94. package/dist/client/tool-executor.d.ts +69 -0
  95. package/dist/client/tool-executor.js +159 -0
  96. package/dist/client/tool-schema-loader.d.ts +60 -0
  97. package/dist/client/tool-schema-loader.js +178 -0
  98. package/dist/client/types.d.ts +69 -0
  99. package/dist/client/types.js +7 -0
  100. package/dist/config.d.ts +162 -0
  101. package/dist/config.js +296 -0
  102. package/dist/core.d.ts +26 -0
  103. package/dist/core.js +147 -0
  104. package/dist/lib/context-manager.d.ts +111 -0
  105. package/dist/lib/context-manager.js +431 -0
  106. package/dist/lib/logger.d.ts +74 -0
  107. package/dist/lib/logger.js +277 -0
  108. package/dist/lib/materialize.d.ts +3 -0
  109. package/dist/lib/materialize.js +101 -0
  110. package/dist/lib/normalizedName.d.ts +7 -0
  111. package/dist/lib/normalizedName.js +48 -0
  112. package/dist/lib/prompt-length-manager.d.ts +81 -0
  113. package/dist/lib/prompt-length-manager.js +457 -0
  114. package/dist/lib/terminal-prompt.d.ts +9 -0
  115. package/dist/lib/terminal-prompt.js +108 -0
  116. package/dist/mcp/UserContextCache.d.ts +56 -0
  117. package/dist/mcp/UserContextCache.js +163 -0
  118. package/dist/mcp/auth.d.ts +2 -0
  119. package/dist/mcp/auth.js +29 -0
  120. package/dist/mcp/hailer-clients.d.ts +42 -0
  121. package/dist/mcp/hailer-clients.js +246 -0
  122. package/dist/mcp/signal-handler.d.ts +45 -0
  123. package/dist/mcp/signal-handler.js +317 -0
  124. package/dist/mcp/tool-registry.d.ts +100 -0
  125. package/dist/mcp/tool-registry.js +306 -0
  126. package/dist/mcp/tools/activity.d.ts +15 -0
  127. package/dist/mcp/tools/activity.js +955 -0
  128. package/dist/mcp/tools/app.d.ts +20 -0
  129. package/dist/mcp/tools/app.js +1488 -0
  130. package/dist/mcp/tools/discussion.d.ts +19 -0
  131. package/dist/mcp/tools/discussion.js +950 -0
  132. package/dist/mcp/tools/file.d.ts +15 -0
  133. package/dist/mcp/tools/file.js +119 -0
  134. package/dist/mcp/tools/insight.d.ts +17 -0
  135. package/dist/mcp/tools/insight.js +806 -0
  136. package/dist/mcp/tools/skill.d.ts +10 -0
  137. package/dist/mcp/tools/skill.js +279 -0
  138. package/dist/mcp/tools/user.d.ts +10 -0
  139. package/dist/mcp/tools/user.js +108 -0
  140. package/dist/mcp/tools/workflow-template.d.ts +19 -0
  141. package/dist/mcp/tools/workflow-template.js +822 -0
  142. package/dist/mcp/tools/workflow.d.ts +18 -0
  143. package/dist/mcp/tools/workflow.js +1362 -0
  144. package/dist/mcp/utils/api-errors.d.ts +45 -0
  145. package/dist/mcp/utils/api-errors.js +160 -0
  146. package/dist/mcp/utils/data-transformers.d.ts +102 -0
  147. package/dist/mcp/utils/data-transformers.js +194 -0
  148. package/dist/mcp/utils/file-upload.d.ts +33 -0
  149. package/dist/mcp/utils/file-upload.js +148 -0
  150. package/dist/mcp/utils/hailer-api-client.d.ts +120 -0
  151. package/dist/mcp/utils/hailer-api-client.js +323 -0
  152. package/dist/mcp/utils/index.d.ts +13 -0
  153. package/dist/mcp/utils/index.js +39 -0
  154. package/dist/mcp/utils/logger.d.ts +42 -0
  155. package/dist/mcp/utils/logger.js +103 -0
  156. package/dist/mcp/utils/types.d.ts +286 -0
  157. package/dist/mcp/utils/types.js +7 -0
  158. package/dist/mcp/workspace-cache.d.ts +42 -0
  159. package/dist/mcp/workspace-cache.js +97 -0
  160. package/dist/mcp-server.d.ts +42 -0
  161. package/dist/mcp-server.js +280 -0
  162. package/package.json +56 -0
  163. package/tsconfig.json +23 -0
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Activate tool-builder mode to implement a new MCP tool
3
+ ---
4
+
5
+ Load the `tool-builder` skill and enter tool-building mode.
6
+
7
+ **What tool should I build?**
8
+
9
+ Please provide:
10
+
11
+ - **Tool Name**: `tool_name` (snake_case)
12
+ - **Purpose**: What does it do?
13
+ - **API Endpoint**: `v3.endpoint.method`
14
+ - **Request Format**: `[arg1, arg2]`
15
+ - **Response Format**: What the API returns
16
+ - **Target File**: Which file in `src/mcp/tools/`?
17
+ - **Tool Group**: READ | WRITE | PLAYGROUND
18
+
19
+ ---
20
+
21
+ **Example:**
22
+ ```
23
+ Tool Name: list_insights
24
+ Purpose: List all insights in workspace
25
+ API Endpoint: v3.insight.list
26
+ Request: [workspaceId]
27
+ Response: { insights: [{_id, name, query, sources}] }
28
+ Target File: insight.ts
29
+ Tool Group: PLAYGROUND
30
+ ```
31
+
32
+ I'll:
33
+ 1. Load tool-builder skill
34
+ 2. Read existing patterns in target file
35
+ 3. Implement the tool
36
+ 4. Register in src/app.ts
37
+ 5. Report what was created
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: Pull workspace configuration from Hailer (READ-ONLY)
3
+ ---
4
+
5
+ Pull the current workspace configuration from Hailer and save it locally.
6
+
7
+ **What this does:**
8
+ - Downloads workflows, insights, teams, groups, and phases from Hailer workspace
9
+ - Saves configuration as JSON files to the `WORKSPACE_CONFIG_PATH` directory
10
+ - READ-ONLY operation - does not modify anything on Hailer
11
+ - Safe to run anytime
12
+
13
+ **Requirements:**
14
+ - Must have `WORKSPACE_CONFIG_PATH` set in `.env.local`
15
+ - Hailer credentials must be configured
16
+
17
+ **Instructions for Claude:**
18
+
19
+ 1. Read `.env.local` file to get `WORKSPACE_CONFIG_PATH`
20
+ 2. Run: `cd "$WORKSPACE_CONFIG_PATH" && npm run ws-pull`
21
+ 3. **AUTOMATICALLY read the generated files to load context:**
22
+ - Read `workspace/enums.ts` (complete file - contains ALL field and phase IDs)
23
+ - List `workspace/` directory to see all workflow folders
24
+ - Read 1-2 example workflow configs (main.ts, fields.ts, phases.ts) to understand structure
25
+ 4. Provide summary of what workflows were pulled and confirm context is loaded
26
+
27
+ **What gets downloaded:**
28
+ - `workspace/enums.ts` - Type-safe field and phase ID enums for ALL workflows
29
+ - `workspace/workflows.ts` - Main workflows export
30
+ - `workspace/insights.ts` - SQL insight definitions
31
+ - `workspace/teams.ts` - Team structures
32
+ - `workspace/groups.ts` - User groups
33
+ - `workspace/<workflow_name>/` - Individual workflow configs (main.ts, fields.ts, phases.ts)
34
+
35
+ **Why automatic reading matters:**
36
+ - Loads all field/phase IDs into conversation context immediately
37
+ - Enables local-first strategy without manual file reads
38
+ - Saves 75% of API calls and hundreds of tokens on subsequent operations
39
+ - You'll know the workspace structure instantly
40
+
41
+ **Common use cases:**
42
+ - Backup current workspace configuration
43
+ - Review workflow structures locally
44
+ - Prepare for making configuration changes
@@ -0,0 +1,8 @@
1
+ {
2
+ "permissions": {
3
+ "deny": [
4
+ "Read(./.env.local)",
5
+ "Read(**/.env.local)"
6
+ ]
7
+ }
8
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "mcp__hailer__create_activity",
5
+ "mcp__hailer__list_workflow_phases",
6
+ "mcp__hailer__list_workflows",
7
+ "mcp__hailer__show_activity_by_id",
8
+ "mcp__hailer__get_workflow_schema",
9
+ "mcp__ide__getDiagnostics",
10
+ "mcp__hailer__remove_workflow",
11
+ "Read(//tmp/**)",
12
+ "mcp__hailer__install_workflow",
13
+ "mcp__hailer__update_workflow_field",
14
+ "mcp__hailer__update_activity",
15
+ "Skill(agent-building)",
16
+ "mcp__hailer__search_workspace_users",
17
+ "mcp__hailer__add_discussion_message",
18
+ "mcp__hailer__join_discussion",
19
+ "mcp__hailer__fetch_discussion_messages",
20
+ "mcp__hailer__list_activities",
21
+ "mcp__hailer__get_insight_data",
22
+ "mcp__hailer__create_insight",
23
+ "mcp__hailer__preview_insight",
24
+ "mcp__hailer__remove_insight",
25
+ "mcp__hailer__create_app",
26
+ "mcp__hailer__scaffold_hailer_app",
27
+ "mcp__hailer__update_app",
28
+ "mcp__hailer__publish_hailer_app",
29
+ "Bash(npm run build:*)",
30
+ "Bash(npm pack)",
31
+ "Bash(yes:*)",
32
+ "Bash(printf:*)",
33
+ "Bash(script -qec:*)",
34
+ "mcp__hailer__list_workflows_minimal",
35
+ "Skill(hailer-api)",
36
+ "Skill(publish-hailer-app-skill)",
37
+ "Bash(find:*)",
38
+ "mcp__hailer__list_templates",
39
+ "Skill(insight-api)",
40
+ "Bash(node -e:*)",
41
+ "mcp__hailer__create_template",
42
+ "mcp__hailer__update_workflow_phase"
43
+ ]
44
+ },
45
+ "enableAllProjectMcpServers": true,
46
+ "enabledMcpjsonServers": [
47
+ "hailer"
48
+ ]
49
+ }
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: Activity API Reference
3
+ description: Complete reference for Hailer Activity API endpoints (v2 and v3) - use when building activity-related MCP tools
4
+ ---
5
+
6
+ # Activity API Reference Skill
7
+
8
+ This skill provides comprehensive documentation for all Hailer Activity API endpoints. Use this as a reference when building MCP tools that interact with activities.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Invoke this skill when:
13
+ - Building new activity-related MCP tools
14
+ - Understanding available activity operations
15
+ - Implementing activity creation, updates, or queries
16
+ - Working with activity links, templates, or bulk operations
17
+ - Exploring timeline, kanban, or calendar views
18
+
19
+ ## Quick Navigation
20
+
21
+ ### Core Activity Operations
22
+ - **v3.activity.list** - List activities with advanced filtering and pagination
23
+ - **v3.activity.create** - Create a single activity
24
+ - **v3.activity.createMany** - Batch create multiple activities
25
+ - **v3.activity.updateMany** - Batch update multiple activities
26
+ - **v3.activity.template.create** - Get activity template with field definitions
27
+
28
+ ### Activity Relationships
29
+ - **v3.activity.linkedFrom.overview** - View activities linked to a target activity
30
+ - **v3.activity.linkedFrom.search** - Search linked activities
31
+ - **v2.activities.copy** - Copy activities with optional renaming
32
+
33
+ ### Views & Visualization
34
+ - **v3.activity.kanban.list** - Kanban board view
35
+ - **v3.activity.timeline** - Timeline/calendar view with grouping
36
+ - **v3.activity.events** - Calendar events from date fields
37
+
38
+ ### Advanced Operations
39
+ - **v3.activity.evaluateMany** - Dry-run function field evaluations
40
+ - **v3.activity.permissions** - Check user permissions
41
+ - **v3.activity.removed.overview** - List deleted activities
42
+ - **v3.activity.removed.recover** - Restore deleted activities
43
+
44
+ ## Documentation
45
+
46
+ See [Activity API Endpoints](references/activity-endpoints.md) for complete endpoint documentation with request/response schemas.
47
+
48
+ ## Key Concepts
49
+
50
+ ### Activity Creation Pattern
51
+ ```typescript
52
+ // 1. Get template to understand required fields
53
+ const template = await getActivityTemplate(workflowId, phaseId);
54
+
55
+ // 2. Create activity with proper field structure
56
+ const result = await createActivity(workflowId, {
57
+ name: "Activity Name",
58
+ fields: {
59
+ [fieldId]: value, // Use fieldIds from template
60
+ },
61
+ phaseId: phaseId,
62
+ teamId: teamId // Required if no default owner
63
+ });
64
+ ```
65
+
66
+ ### Filtering Activities
67
+ ```typescript
68
+ // Use filters object for complex queries
69
+ const activities = await listActivities(workflowId, {
70
+ filters: {
71
+ and: [
72
+ { [fieldId]: { equalTo: "value" } },
73
+ { [dateFieldId]: { between: [startMs, endMs] } }
74
+ ]
75
+ },
76
+ returnFlat: true // Use flat structure for easier field access
77
+ });
78
+ ```
79
+
80
+ ### returnFlat Mode
81
+ - **returnFlat: false** - Fields nested in `fields` object with complex structure
82
+ - **returnFlat: true** - Fields flattened to root level, accessible by field key
83
+
84
+ ## Common Use Cases
85
+
86
+ 1. **List activities in a workflow/phase**: Use `v3.activity.list`
87
+ 2. **Create multiple activities**: Use `v3.activity.createMany` with template
88
+ 3. **Update activity fields**: Use `v3.activity.updateMany`
89
+ 4. **View activity relationships**: Use `v3.activity.linkedFrom.overview`
90
+ 5. **Get field definitions**: Use `v3.activity.template.create`
91
+ 6. **Timeline/calendar view**: Use `v3.activity.timeline` or `v3.activity.events`
92
+
93
+ ## Next Steps
94
+
95
+ For complete endpoint documentation with request/response schemas, see:
96
+ - [Activity API Endpoints](references/activity-endpoints.md) - All v2 and v3 endpoints