@hailer/mcp 0.0.5 → 0.1.0

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 (120) hide show
  1. package/.claude/agents/ada.md +127 -0
  2. package/.claude/agents/agent-builder.md +151 -0
  3. package/.claude/agents/alejandro.md +66 -0
  4. package/.claude/agents/bjorn.md +305 -0
  5. package/.claude/agents/dmitri.md +61 -0
  6. package/.claude/agents/giuseppe.md +66 -0
  7. package/.claude/agents/gunther.md +355 -0
  8. package/.claude/agents/helga.md +68 -0
  9. package/.claude/agents/kenji.md +58 -0
  10. package/.claude/agents/svetlana.md +394 -0
  11. package/.claude/agents/viktor.md +63 -0
  12. package/.claude/agents/yevgeni.md +60 -0
  13. package/.claude/hooks/agent-failure-detector.cjs +286 -0
  14. package/.claude/hooks/app-edit-guard.cjs +462 -0
  15. package/.claude/hooks/interactive-mode.cjs +59 -0
  16. package/.claude/hooks/mcp-server-guard.cjs +92 -0
  17. package/.claude/hooks/post-scaffold-hook.cjs +31 -0
  18. package/.claude/hooks/src-edit-guard.cjs +208 -0
  19. package/.claude/settings.json +47 -2
  20. package/.claude/skills/insight-join-patterns/SKILL.md +209 -0
  21. package/.env.example +13 -1
  22. package/CLAUDE.md +134 -0
  23. package/dist/app.js +4 -3
  24. package/dist/cli.js +0 -0
  25. package/dist/client/adaptive-documentation-bot.d.ts +0 -2
  26. package/dist/client/adaptive-documentation-bot.js +5 -16
  27. package/dist/client/message-processor.js +5 -0
  28. package/dist/client/providers/anthropic-provider.js +21 -7
  29. package/dist/mcp/UserContextCache.d.ts +14 -0
  30. package/dist/mcp/UserContextCache.js +49 -24
  31. package/dist/mcp/auth.d.ts +7 -0
  32. package/dist/mcp/auth.js +13 -5
  33. package/dist/mcp/hailer-clients.d.ts +5 -2
  34. package/dist/mcp/signal-handler.d.ts +28 -2
  35. package/dist/mcp/signal-handler.js +4 -2
  36. package/dist/mcp/tool-registry.d.ts +55 -2
  37. package/dist/mcp/tool-registry.js +197 -2
  38. package/dist/mcp/tools/app-core.d.ts +15 -0
  39. package/dist/mcp/tools/app-core.js +609 -0
  40. package/dist/mcp/tools/app-marketplace.d.ts +21 -0
  41. package/dist/mcp/tools/app-marketplace.js +1284 -0
  42. package/dist/mcp/tools/app-member.d.ts +11 -0
  43. package/dist/mcp/tools/app-member.js +258 -0
  44. package/dist/mcp/tools/app-scaffold.d.ts +11 -0
  45. package/dist/mcp/tools/app-scaffold.js +743 -0
  46. package/dist/mcp/tools/app.d.ts +13 -22
  47. package/dist/mcp/tools/app.js +17 -2466
  48. package/dist/mcp/tools/file.js +6 -6
  49. package/dist/mcp/tools/insight.d.ts +1 -0
  50. package/dist/mcp/tools/insight.js +203 -64
  51. package/dist/mcp/tools/user.js +3 -9
  52. package/dist/mcp/tools/workflow.js +49 -38
  53. package/dist/mcp/utils/hailer-api-client.js +4 -13
  54. package/dist/mcp/utils/tool-helpers.d.ts +102 -0
  55. package/dist/mcp/utils/tool-helpers.js +179 -0
  56. package/dist/mcp/utils/types.d.ts +6 -0
  57. package/dist/mcp/workspace-cache.d.ts +5 -5
  58. package/dist/mcp/workspace-cache.js +4 -3
  59. package/package.json +1 -1
  60. package/.claude/hooks/PreToolUse.sh +0 -52
  61. package/.claude/hooks/prompt-skill-loader.cjs +0 -553
  62. package/.claude/hooks/skill-loader.cjs +0 -142
  63. package/.claude/settings.local.json +0 -49
  64. package/.claude/skills/MCP-add-app-member-skill/SKILL.md +0 -977
  65. package/.claude/skills/MCP-build-data-app-skill/SKILL.md +0 -372
  66. package/.claude/skills/MCP-create-app-skill/SKILL.md +0 -1101
  67. package/.claude/skills/MCP-create-insight-skill/SKILL.md +0 -1317
  68. package/.claude/skills/MCP-get-insight-data-skill/SKILL.md +0 -1053
  69. package/.claude/skills/MCP-insight-api/SKILL.md +0 -185
  70. package/.claude/skills/MCP-insight-api/references/insight-endpoints.md +0 -514
  71. package/.claude/skills/MCP-install-workflow-skill/SKILL.md +0 -1056
  72. package/.claude/skills/MCP-list-apps-skill/SKILL.md +0 -1010
  73. package/.claude/skills/MCP-list-workflows-minimal-skill/SKILL.md +0 -992
  74. package/.claude/skills/MCP-local-first-skill/SKILL.md +0 -570
  75. package/.claude/skills/MCP-populate-workflow-data-skill/SKILL.md +0 -395
  76. package/.claude/skills/MCP-preview-insight-skill/SKILL.md +0 -1290
  77. package/.claude/skills/MCP-publish-hailer-app-skill/SKILL.md +0 -453
  78. package/.claude/skills/MCP-publish-template-skill/SKILL.md +0 -278
  79. package/.claude/skills/MCP-remove-app-member-skill/SKILL.md +0 -671
  80. package/.claude/skills/MCP-remove-app-skill/SKILL.md +0 -985
  81. package/.claude/skills/MCP-remove-insight-skill/SKILL.md +0 -1011
  82. package/.claude/skills/MCP-remove-workflow-skill/SKILL.md +0 -920
  83. package/.claude/skills/MCP-scaffold-hailer-app-skill/SKILL.md +0 -1237
  84. package/.claude/skills/MCP-update-app-skill/SKILL.md +0 -970
  85. package/.claude/skills/MCP-update-workflow-field-skill/SKILL.md +0 -1098
  86. package/.claude/skills/SDK-create-function-field-skill/SKILL.md +0 -313
  87. package/.claude/skills/SDK-generate-skill/SKILL.md +0 -223
  88. package/.claude/skills/SDK-init-skill/SKILL.md +0 -177
  89. package/.claude/skills/SDK-workspace-setup-skill/SKILL.md +0 -605
  90. package/.claude/skills/SDK-ws-config-skill/SKILL.md +0 -435
  91. package/.claude/skills/activity-api/SKILL.md +0 -96
  92. package/.claude/skills/activity-api/references/activity-endpoints.md +0 -845
  93. package/.claude/skills/agent-building/SKILL.md +0 -243
  94. package/.claude/skills/agent-building/references/architecture-patterns.md +0 -446
  95. package/.claude/skills/agent-building/references/code-examples.md +0 -587
  96. package/.claude/skills/agent-building/references/implementation-guide.md +0 -619
  97. package/.claude/skills/app-api/SKILL.md +0 -219
  98. package/.claude/skills/app-api/references/app-endpoints.md +0 -759
  99. package/.claude/skills/building-hailer-apps-skill/SKILL.md +0 -813
  100. package/.claude/skills/hailer-api/SKILL.md +0 -283
  101. package/.claude/skills/hailer-api/references/activities.md +0 -620
  102. package/.claude/skills/hailer-api/references/authentication.md +0 -216
  103. package/.claude/skills/hailer-api/references/datasets.md +0 -437
  104. package/.claude/skills/hailer-api/references/files.md +0 -301
  105. package/.claude/skills/hailer-api/references/insights.md +0 -469
  106. package/.claude/skills/hailer-api/references/workflows.md +0 -720
  107. package/.claude/skills/hailer-api/references/workspaces-users.md +0 -445
  108. package/.claude/skills/hailer-app-builder/SKILL.md +0 -340
  109. package/.claude/skills/mcp-tools/SKILL.md +0 -419
  110. package/.claude/skills/mcp-tools/references/api-endpoints.md +0 -499
  111. package/.claude/skills/mcp-tools/references/data-structures.md +0 -554
  112. package/.claude/skills/mcp-tools/references/implementation-patterns.md +0 -717
  113. package/.claude/skills/skill-testing/README.md +0 -137
  114. package/.claude/skills/skill-testing/SKILL.md +0 -348
  115. package/.claude/skills/skill-testing/references/test-patterns.md +0 -705
  116. package/.claude/skills/skill-testing/references/testing-guide.md +0 -603
  117. package/.claude/skills/skill-testing/references/validation-checklist.md +0 -537
  118. package/.claude/skills/spawn-app-builder/SKILL.md +0 -366
  119. package/.claude/skills/tool-builder/SKILL.md +0 -328
  120. package/tsconfig.json +0 -23
@@ -1,301 +0,0 @@
1
- # Hailer Files API
2
-
3
- ## Overview
4
-
5
- Hailer's Files API allows uploading, downloading, and managing files attached to activities, workspaces, and datasets.
6
-
7
- ## Endpoints
8
-
9
- ### Upload File
10
-
11
- ```http
12
- POST /v3/files
13
- Content-Type: multipart/form-data
14
-
15
- file: (binary)
16
- activity_id: 123 (optional)
17
- workspace_id: ws_456 (optional)
18
- ```
19
-
20
- **Python Example:**
21
- ```python
22
- with open('document.pdf', 'rb') as f:
23
- response = requests.post(
24
- 'https://api.hailer.local.gd/v3/files',
25
- headers={'Authorization': f'Bearer {token}'},
26
- files={'file': f},
27
- data={'activity_id': '123'}
28
- )
29
- ```
30
-
31
- **Response:**
32
- ```json
33
- {
34
- "id": "file_789",
35
- "filename": "document.pdf",
36
- "size": 524288,
37
- "mime_type": "application/pdf",
38
- "url": "https://files.hailer.com/file_789",
39
- "thumbnail_url": "https://files.hailer.com/file_789/thumb",
40
- "created_at": "2025-01-15T10:30:00Z"
41
- }
42
- ```
43
-
44
- ### Get File Metadata
45
-
46
- ```http
47
- GET /v3/files/{file_id}
48
- ```
49
-
50
- **Response:**
51
- ```json
52
- {
53
- "id": "file_789",
54
- "filename": "document.pdf",
55
- "size": 524288,
56
- "mime_type": "application/pdf",
57
- "url": "https://files.hailer.com/file_789",
58
- "created_at": "2025-01-15T10:30:00Z",
59
- "created_by": {
60
- "id": "user_123",
61
- "name": "Johan Rekna"
62
- },
63
- "activity_id": "act_456",
64
- "workspace_id": "ws_789"
65
- }
66
- ```
67
-
68
- ### Download File
69
-
70
- ```http
71
- GET /v3/files/{file_id}/download
72
- ```
73
-
74
- Returns file binary with appropriate Content-Type header.
75
-
76
- **Python Example:**
77
- ```python
78
- response = requests.get(
79
- f'https://api.hailer.local.gd/v3/files/{file_id}/download',
80
- headers={'Authorization': f'Bearer {token}'},
81
- stream=True
82
- )
83
-
84
- with open('downloaded_file.pdf', 'wb') as f:
85
- for chunk in response.iter_content(chunk_size=8192):
86
- f.write(chunk)
87
- ```
88
-
89
- ### Delete File
90
-
91
- ```http
92
- DELETE /v3/files/{file_id}
93
- ```
94
-
95
- **Response:** `204 No Content`
96
-
97
- ### List Files
98
-
99
- ```http
100
- GET /v3/files?activity_id=123
101
- GET /v3/files?workspace_id=ws_456
102
- ```
103
-
104
- **Query Parameters:**
105
- - `activity_id` - Filter by activity
106
- - `workspace_id` - Filter by workspace
107
- - `created_after` - ISO 8601 timestamp
108
- - `created_before` - ISO 8601 timestamp
109
- - `mime_type` - Filter by MIME type
110
- - `page` - Page number
111
- - `per_page` - Items per page (max 100)
112
-
113
- **Response:**
114
- ```json
115
- {
116
- "data": [
117
- {
118
- "id": "file_789",
119
- "filename": "document.pdf",
120
- "size": 524288,
121
- "mime_type": "application/pdf",
122
- "url": "https://files.hailer.com/file_789",
123
- "created_at": "2025-01-15T10:30:00Z"
124
- }
125
- ],
126
- "meta": {
127
- "page": 1,
128
- "per_page": 50,
129
- "total": 15
130
- }
131
- }
132
- ```
133
-
134
- ### Update File Metadata
135
-
136
- ```http
137
- PATCH /v3/files/{file_id}
138
- Content-Type: application/json
139
-
140
- {
141
- "filename": "renamed_document.pdf"
142
- }
143
- ```
144
-
145
- ## Supported MIME Types
146
-
147
- ### Documents
148
- - `application/pdf` - PDF documents
149
- - `application/msword` - Word (.doc)
150
- - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - Word (.docx)
151
- - `application/vnd.ms-excel` - Excel (.xls)
152
- - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - Excel (.xlsx)
153
- - `text/plain` - Text files
154
- - `text/csv` - CSV files
155
-
156
- ### Images
157
- - `image/jpeg` - JPEG images
158
- - `image/png` - PNG images
159
- - `image/gif` - GIF images
160
- - `image/svg+xml` - SVG images
161
- - `image/webp` - WebP images
162
-
163
- ### Archives
164
- - `application/zip` - ZIP archives
165
- - `application/x-rar-compressed` - RAR archives
166
-
167
- ### Other
168
- - `application/json` - JSON files
169
- - `application/xml` - XML files
170
-
171
- ## File Size Limits
172
-
173
- - Maximum file size: 100 MB per file
174
- - Maximum total storage: Depends on workspace plan
175
- - Thumbnail generation: Automatic for images and PDFs
176
-
177
- ## Thumbnails
178
-
179
- Hailer automatically generates thumbnails for:
180
- - Images (JPEG, PNG, GIF, WebP)
181
- - PDF documents (first page)
182
-
183
- Access thumbnails:
184
- ```http
185
- GET /v3/files/{file_id}/thumbnail?size=small
186
- GET /v3/files/{file_id}/thumbnail?size=medium
187
- GET /v3/files/{file_id}/thumbnail?size=large
188
- ```
189
-
190
- Sizes:
191
- - `small` - 150x150px
192
- - `medium` - 300x300px
193
- - `large` - 600x600px
194
-
195
- ## Batch Upload
196
-
197
- ```http
198
- POST /v3/files/batch
199
- Content-Type: multipart/form-data
200
-
201
- files[]: (binary) multiple files
202
- activity_id: 123
203
- ```
204
-
205
- **Response:**
206
- ```json
207
- {
208
- "files": [
209
- {
210
- "id": "file_789",
211
- "filename": "doc1.pdf",
212
- "success": true
213
- },
214
- {
215
- "filename": "doc2.pdf",
216
- "success": false,
217
- "error": "File too large"
218
- }
219
- ]
220
- }
221
- ```
222
-
223
- ## File Sharing
224
-
225
- ### Generate Public Link
226
-
227
- ```http
228
- POST /v3/files/{file_id}/share
229
- Content-Type: application/json
230
-
231
- {
232
- "expires_at": "2025-12-31T23:59:59Z",
233
- "password": "optional_password"
234
- }
235
- ```
236
-
237
- **Response:**
238
- ```json
239
- {
240
- "share_url": "https://share.hailer.com/abc123def456",
241
- "expires_at": "2025-12-31T23:59:59Z"
242
- }
243
- ```
244
-
245
- ### Revoke Public Link
246
-
247
- ```http
248
- DELETE /v3/files/{file_id}/share
249
- ```
250
-
251
- ## File Permissions
252
-
253
- Files inherit permissions from their parent:
254
- - Activity files: Same permissions as activity
255
- - Workspace files: Same permissions as workspace
256
-
257
- Check file access:
258
- ```http
259
- GET /v3/files/{file_id}/permissions
260
- ```
261
-
262
- ## Advanced: Direct Upload to S3
263
-
264
- For large files, use pre-signed S3 URLs:
265
-
266
- 1. Request upload URL:
267
- ```http
268
- POST /v3/files/upload-url
269
- {
270
- "filename": "large_video.mp4",
271
- "size": 52428800,
272
- "mime_type": "video/mp4"
273
- }
274
- ```
275
-
276
- 2. Upload directly to S3:
277
- ```python
278
- response = requests.put(
279
- presigned_url,
280
- data=open('large_video.mp4', 'rb'),
281
- headers={'Content-Type': 'video/mp4'}
282
- )
283
- ```
284
-
285
- 3. Confirm upload:
286
- ```http
287
- POST /v3/files/confirm
288
- {
289
- "upload_id": "upload_123",
290
- "activity_id": "act_456"
291
- }
292
- ```
293
-
294
- ## Best Practices
295
-
296
- 1. **Use streaming for large files** - Don't load entire file into memory
297
- 2. **Check file size before upload** - Validate against 100MB limit
298
- 3. **Set appropriate MIME types** - For proper file handling
299
- 4. **Use batch upload for multiple files** - More efficient than individual uploads
300
- 5. **Clean up temporary files** - Delete files when no longer needed
301
- 6. **Use thumbnails for previews** - Don't download full images for UI previews