@hailer/mcp 1.1.11 → 1.1.13

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 (252) hide show
  1. package/dist/app.js +18 -5
  2. package/dist/bot/bot-config.d.ts +12 -1
  3. package/dist/bot/bot-config.js +98 -14
  4. package/dist/bot/bot-manager.d.ts +13 -3
  5. package/dist/bot/bot-manager.js +80 -25
  6. package/dist/bot/bot.d.ts +46 -0
  7. package/dist/bot/bot.js +542 -166
  8. package/dist/bot/services/message-classifier.js +17 -0
  9. package/dist/bot/services/permission-guard.d.ts +52 -0
  10. package/dist/bot/services/permission-guard.js +149 -0
  11. package/dist/bot/services/types.d.ts +5 -0
  12. package/dist/bot/services/typing-indicator.d.ts +6 -1
  13. package/dist/bot/services/typing-indicator.js +19 -3
  14. package/dist/config.d.ts +6 -1
  15. package/dist/config.js +43 -0
  16. package/dist/core.js +3 -6
  17. package/dist/mcp/UserContextCache.d.ts +5 -0
  18. package/dist/mcp/UserContextCache.js +51 -19
  19. package/dist/mcp/hailer-clients.d.ts +19 -1
  20. package/dist/mcp/hailer-clients.js +157 -20
  21. package/dist/mcp/session-store.d.ts +68 -0
  22. package/dist/mcp/session-store.js +169 -0
  23. package/dist/mcp/signal-handler.js +12 -12
  24. package/dist/mcp/tool-registry.d.ts +17 -4
  25. package/dist/mcp/tool-registry.js +37 -7
  26. package/dist/mcp/tools/activity.js +99 -7
  27. package/dist/mcp/tools/app-scaffold.js +304 -336
  28. package/dist/mcp/tools/company.d.ts +9 -0
  29. package/dist/mcp/tools/company.js +88 -0
  30. package/dist/mcp/tools/discussion.js +68 -0
  31. package/dist/mcp/tools/workflow-permissions.d.ts +15 -0
  32. package/dist/mcp/tools/workflow-permissions.js +204 -0
  33. package/dist/mcp/tools/workflow.js +57 -18
  34. package/dist/mcp/utils/index.d.ts +2 -0
  35. package/dist/mcp/utils/index.js +12 -1
  36. package/dist/mcp/utils/role-utils.d.ts +74 -0
  37. package/dist/mcp/utils/role-utils.js +151 -0
  38. package/dist/mcp/utils/types.d.ts +43 -1
  39. package/dist/mcp/utils/types.js +14 -0
  40. package/dist/mcp/webhook-handler.d.ts +6 -0
  41. package/dist/mcp/webhook-handler.js +11 -0
  42. package/dist/mcp-server.d.ts +23 -2
  43. package/dist/mcp-server.js +639 -111
  44. package/dist/plugins/vipunen/client.d.ts +150 -0
  45. package/dist/plugins/vipunen/client.js +535 -0
  46. package/dist/plugins/vipunen/config/schema-config.json +19 -0
  47. package/dist/plugins/vipunen/config/schema-doc.json +22 -0
  48. package/dist/plugins/vipunen/index.d.ts +41 -0
  49. package/dist/plugins/vipunen/index.js +88 -0
  50. package/dist/plugins/vipunen/tools.d.ts +26 -0
  51. package/dist/plugins/vipunen/tools.js +501 -0
  52. package/package.json +2 -1
  53. package/.claude/.context-watchdog.json +0 -1
  54. package/.claude/.session-checked +0 -1
  55. package/.claude/CLAUDE.md +0 -370
  56. package/.claude/agents/agent-ada-skill-builder.md +0 -94
  57. package/.claude/agents/agent-alejandro-function-fields.md +0 -342
  58. package/.claude/agents/agent-bjorn-config-audit.md +0 -103
  59. package/.claude/agents/agent-builder-agent-creator.md +0 -130
  60. package/.claude/agents/agent-code-simplifier.md +0 -53
  61. package/.claude/agents/agent-dmitri-activity-crud.md +0 -159
  62. package/.claude/agents/agent-giuseppe-app-builder.md +0 -247
  63. package/.claude/agents/agent-gunther-mcp-tools.md +0 -39
  64. package/.claude/agents/agent-helga-workflow-config.md +0 -204
  65. package/.claude/agents/agent-igor-activity-mover-automation.md +0 -125
  66. package/.claude/agents/agent-ingrid-doc-templates.md +0 -261
  67. package/.claude/agents/agent-ivan-monolith.md +0 -154
  68. package/.claude/agents/agent-kenji-data-reader.md +0 -86
  69. package/.claude/agents/agent-lars-code-inspector.md +0 -102
  70. package/.claude/agents/agent-marco-mockup-builder.md +0 -110
  71. package/.claude/agents/agent-marcus-api-documenter.md +0 -323
  72. package/.claude/agents/agent-marketplace-publisher.md +0 -280
  73. package/.claude/agents/agent-marketplace-reviewer.md +0 -309
  74. package/.claude/agents/agent-permissions-handler.md +0 -208
  75. package/.claude/agents/agent-simple-writer.md +0 -48
  76. package/.claude/agents/agent-svetlana-code-review.md +0 -171
  77. package/.claude/agents/agent-tanya-test-runner.md +0 -333
  78. package/.claude/agents/agent-ui-designer.md +0 -100
  79. package/.claude/agents/agent-viktor-sql-insights.md +0 -212
  80. package/.claude/agents/agent-web-search.md +0 -55
  81. package/.claude/agents/agent-yevgeni-discussions.md +0 -45
  82. package/.claude/agents/agent-zara-zapier.md +0 -159
  83. package/.claude/commands/app-squad.md +0 -135
  84. package/.claude/commands/audit-squad.md +0 -158
  85. package/.claude/commands/autoplan.md +0 -563
  86. package/.claude/commands/cleanup-squad.md +0 -98
  87. package/.claude/commands/config-squad.md +0 -106
  88. package/.claude/commands/crud-squad.md +0 -87
  89. package/.claude/commands/data-squad.md +0 -97
  90. package/.claude/commands/debug-squad.md +0 -303
  91. package/.claude/commands/doc-squad.md +0 -65
  92. package/.claude/commands/handoff.md +0 -137
  93. package/.claude/commands/health.md +0 -49
  94. package/.claude/commands/help.md +0 -29
  95. package/.claude/commands/help:agents.md +0 -151
  96. package/.claude/commands/help:commands.md +0 -78
  97. package/.claude/commands/help:faq.md +0 -79
  98. package/.claude/commands/help:plugins.md +0 -50
  99. package/.claude/commands/help:skills.md +0 -93
  100. package/.claude/commands/help:tools.md +0 -75
  101. package/.claude/commands/hotfix-squad.md +0 -112
  102. package/.claude/commands/integration-squad.md +0 -82
  103. package/.claude/commands/janitor-squad.md +0 -167
  104. package/.claude/commands/learn-auto.md +0 -120
  105. package/.claude/commands/learn.md +0 -120
  106. package/.claude/commands/mcp-list.md +0 -27
  107. package/.claude/commands/onboard-squad.md +0 -140
  108. package/.claude/commands/plan-workspace.md +0 -732
  109. package/.claude/commands/prd.md +0 -130
  110. package/.claude/commands/project-status.md +0 -82
  111. package/.claude/commands/publish.md +0 -138
  112. package/.claude/commands/recap.md +0 -69
  113. package/.claude/commands/restore.md +0 -64
  114. package/.claude/commands/review-squad.md +0 -152
  115. package/.claude/commands/save.md +0 -24
  116. package/.claude/commands/stats.md +0 -19
  117. package/.claude/commands/swarm.md +0 -210
  118. package/.claude/commands/tool-builder.md +0 -39
  119. package/.claude/commands/ws-pull.md +0 -44
  120. package/.claude/hooks/_shared-memory.cjs +0 -305
  121. package/.claude/hooks/_utils.cjs +0 -108
  122. package/.claude/hooks/agent-failure-detector.cjs +0 -383
  123. package/.claude/hooks/agent-usage-logger.cjs +0 -204
  124. package/.claude/hooks/app-edit-guard.cjs +0 -494
  125. package/.claude/hooks/auto-learn.cjs +0 -304
  126. package/.claude/hooks/bash-guard.cjs +0 -272
  127. package/.claude/hooks/builder-mode-manager.cjs +0 -354
  128. package/.claude/hooks/bulk-activity-guard.cjs +0 -271
  129. package/.claude/hooks/context-watchdog.cjs +0 -230
  130. package/.claude/hooks/delegation-reminder.cjs +0 -465
  131. package/.claude/hooks/design-system-lint.cjs +0 -271
  132. package/.claude/hooks/post-scaffold-hook.cjs +0 -181
  133. package/.claude/hooks/prompt-guard.cjs +0 -354
  134. package/.claude/hooks/publish-template-guard.cjs +0 -147
  135. package/.claude/hooks/session-start.cjs +0 -35
  136. package/.claude/hooks/shared-memory-writer.cjs +0 -147
  137. package/.claude/hooks/skill-injector.cjs +0 -140
  138. package/.claude/hooks/skill-usage-logger.cjs +0 -258
  139. package/.claude/hooks/src-edit-guard.cjs +0 -240
  140. package/.claude/hooks/sync-marketplace-agents.cjs +0 -346
  141. package/.claude/settings.json +0 -257
  142. package/.claude/skills/SDK-activity-patterns/SKILL.md +0 -428
  143. package/.claude/skills/SDK-document-templates/SKILL.md +0 -1033
  144. package/.claude/skills/SDK-function-fields/SKILL.md +0 -542
  145. package/.claude/skills/SDK-generate-skill/SKILL.md +0 -92
  146. package/.claude/skills/SDK-init-skill/SKILL.md +0 -127
  147. package/.claude/skills/SDK-insight-queries/SKILL.md +0 -787
  148. package/.claude/skills/SDK-ws-config-skill/SKILL.md +0 -1139
  149. package/.claude/skills/agent-structure/SKILL.md +0 -98
  150. package/.claude/skills/api-documentation-patterns/SKILL.md +0 -474
  151. package/.claude/skills/chrome-mcp-reference/SKILL.md +0 -370
  152. package/.claude/skills/delegation-routing/SKILL.md +0 -202
  153. package/.claude/skills/frontend-design/SKILL.md +0 -254
  154. package/.claude/skills/hailer-activity-mover/SKILL.md +0 -213
  155. package/.claude/skills/hailer-api-client/SKILL.md +0 -518
  156. package/.claude/skills/hailer-app-builder/SKILL.md +0 -1434
  157. package/.claude/skills/hailer-apps-pictures/SKILL.md +0 -269
  158. package/.claude/skills/hailer-design-system/SKILL.md +0 -235
  159. package/.claude/skills/hailer-monolith-automations/SKILL.md +0 -686
  160. package/.claude/skills/hailer-permissions-system/SKILL.md +0 -121
  161. package/.claude/skills/hailer-project-protocol/SKILL.md +0 -488
  162. package/.claude/skills/hailer-rest-api/SKILL.md +0 -61
  163. package/.claude/skills/hailer-rest-api/hailer-activities.md +0 -184
  164. package/.claude/skills/hailer-rest-api/hailer-admin.md +0 -473
  165. package/.claude/skills/hailer-rest-api/hailer-calendar.md +0 -256
  166. package/.claude/skills/hailer-rest-api/hailer-feed.md +0 -249
  167. package/.claude/skills/hailer-rest-api/hailer-insights.md +0 -195
  168. package/.claude/skills/hailer-rest-api/hailer-messaging.md +0 -276
  169. package/.claude/skills/hailer-rest-api/hailer-workflows.md +0 -283
  170. package/.claude/skills/insight-join-patterns/SKILL.md +0 -174
  171. package/.claude/skills/integration-patterns/SKILL.md +0 -421
  172. package/.claude/skills/json-only-output/SKILL.md +0 -72
  173. package/.claude/skills/lsp-setup/SKILL.md +0 -160
  174. package/.claude/skills/mcp-direct-tools/SKILL.md +0 -153
  175. package/.claude/skills/optional-parameters/SKILL.md +0 -72
  176. package/.claude/skills/publish-hailer-app/SKILL.md +0 -244
  177. package/.claude/skills/testing-patterns/SKILL.md +0 -630
  178. package/.claude/skills/tool-builder/SKILL.md +0 -250
  179. package/.claude/skills/tool-parameter-usage/SKILL.md +0 -126
  180. package/.claude/skills/tool-response-verification/SKILL.md +0 -92
  181. package/.claude/skills/zapier-hailer-patterns/SKILL.md +0 -581
  182. package/.hailer-mcp-port +0 -1
  183. package/.mcp.json +0 -13
  184. package/.opencode/agent/agent-ada-skill-builder.md +0 -35
  185. package/.opencode/agent/agent-alejandro-function-fields.md +0 -39
  186. package/.opencode/agent/agent-bjorn-config-audit.md +0 -36
  187. package/.opencode/agent/agent-builder-agent-creator.md +0 -39
  188. package/.opencode/agent/agent-code-simplifier.md +0 -31
  189. package/.opencode/agent/agent-dmitri-activity-crud.md +0 -40
  190. package/.opencode/agent/agent-giuseppe-app-builder.md +0 -37
  191. package/.opencode/agent/agent-gunther-mcp-tools.md +0 -39
  192. package/.opencode/agent/agent-helga-workflow-config.md +0 -204
  193. package/.opencode/agent/agent-igor-activity-mover-automation.md +0 -46
  194. package/.opencode/agent/agent-ingrid-doc-templates.md +0 -39
  195. package/.opencode/agent/agent-ivan-monolith.md +0 -46
  196. package/.opencode/agent/agent-kenji-data-reader.md +0 -53
  197. package/.opencode/agent/agent-lars-code-inspector.md +0 -28
  198. package/.opencode/agent/agent-marco-mockup-builder.md +0 -42
  199. package/.opencode/agent/agent-marcus-api-documenter.md +0 -53
  200. package/.opencode/agent/agent-marketplace-publisher.md +0 -44
  201. package/.opencode/agent/agent-marketplace-reviewer.md +0 -42
  202. package/.opencode/agent/agent-permissions-handler.md +0 -50
  203. package/.opencode/agent/agent-simple-writer.md +0 -45
  204. package/.opencode/agent/agent-svetlana-code-review.md +0 -39
  205. package/.opencode/agent/agent-tanya-test-runner.md +0 -57
  206. package/.opencode/agent/agent-ui-designer.md +0 -56
  207. package/.opencode/agent/agent-viktor-sql-insights.md +0 -34
  208. package/.opencode/agent/agent-web-search.md +0 -42
  209. package/.opencode/agent/agent-yevgeni-discussions.md +0 -37
  210. package/.opencode/agent/agent-zara-zapier.md +0 -53
  211. package/.opencode/commands/app-squad.md +0 -135
  212. package/.opencode/commands/audit-squad.md +0 -158
  213. package/.opencode/commands/autoplan.md +0 -563
  214. package/.opencode/commands/cleanup-squad.md +0 -98
  215. package/.opencode/commands/config-squad.md +0 -106
  216. package/.opencode/commands/crud-squad.md +0 -87
  217. package/.opencode/commands/data-squad.md +0 -97
  218. package/.opencode/commands/debug-squad.md +0 -303
  219. package/.opencode/commands/doc-squad.md +0 -65
  220. package/.opencode/commands/handoff.md +0 -137
  221. package/.opencode/commands/health.md +0 -49
  222. package/.opencode/commands/help-agents.md +0 -151
  223. package/.opencode/commands/help-commands.md +0 -32
  224. package/.opencode/commands/help-faq.md +0 -29
  225. package/.opencode/commands/help-plugins.md +0 -28
  226. package/.opencode/commands/help-skills.md +0 -7
  227. package/.opencode/commands/help-tools.md +0 -40
  228. package/.opencode/commands/help.md +0 -28
  229. package/.opencode/commands/hotfix-squad.md +0 -112
  230. package/.opencode/commands/integration-squad.md +0 -82
  231. package/.opencode/commands/janitor-squad.md +0 -167
  232. package/.opencode/commands/learn-auto.md +0 -120
  233. package/.opencode/commands/learn.md +0 -120
  234. package/.opencode/commands/mcp-list.md +0 -27
  235. package/.opencode/commands/onboard-squad.md +0 -140
  236. package/.opencode/commands/plan-workspace.md +0 -732
  237. package/.opencode/commands/prd.md +0 -131
  238. package/.opencode/commands/project-status.md +0 -82
  239. package/.opencode/commands/publish.md +0 -138
  240. package/.opencode/commands/recap.md +0 -69
  241. package/.opencode/commands/restore.md +0 -64
  242. package/.opencode/commands/review-squad.md +0 -152
  243. package/.opencode/commands/save.md +0 -24
  244. package/.opencode/commands/stats.md +0 -19
  245. package/.opencode/commands/swarm.md +0 -210
  246. package/.opencode/commands/tool-builder.md +0 -39
  247. package/.opencode/commands/ws-pull.md +0 -44
  248. package/.opencode/opencode.json +0 -21
  249. package/inbox/failures.log +0 -1
  250. package/inbox/usage.jsonl +0 -4
  251. package/scripts/postinstall.cjs +0 -64
  252. package/scripts/test-hal-tools.ts +0 -154
@@ -1,581 +0,0 @@
1
- ---
2
- name: zapier-hailer-patterns
3
- description: Patterns for building Zapier integrations with Hailer REST API
4
- version: 1.0.1
5
- triggers: When building Zapier automations, webhook triggers, or API integrations
6
- ---
7
-
8
- # Zapier-Hailer Integration Patterns
9
-
10
- Use this skill when building Zapier automations that integrate with Hailer.
11
-
12
- ## Key Insight: Zapier + Any REST API
13
-
14
- Zapier doesn't have a native Hailer integration, but **Webhooks by Zapier** can connect to ANY REST API. This means:
15
- - Hailer's full REST API is available via Zapier
16
- - Same pattern works for any external system with REST API
17
-
18
- ---
19
-
20
- ## CRITICAL: Custom Request Configuration
21
-
22
- **#1 Zapier mistake: Not setting `return_raw_response`**
23
-
24
- Every Custom Request step MUST set `return_raw_response: true` (or `"yes"` in JSON).
25
-
26
- Without this parameter:
27
- - Zapier returns only HTTP status (200 OK), not the response body
28
- - You can't get created activity IDs
29
- - You can't parse API responses in Code steps
30
- - You can't chain API calls using returned data
31
-
32
- **Always include this:**
33
- ```json
34
- {
35
- "method": "POST",
36
- "url": "https://api.hailer.com/api/v3/activity/create",
37
- "return_raw_response": "yes" // ← ESSENTIAL - Enables access to response body
38
- }
39
- ```
40
-
41
- This single parameter fixes 90% of "Zap runs but I can't access the data" issues.
42
-
43
- ---
44
-
45
- ## Knowledge Sources
46
-
47
- **Always query NotebookLM first** for detailed patterns and examples:
48
-
49
- ```
50
- Notebook: "Zapier-opas Haileriin: Automaatio, AI-orkestointi ja yritysratkaisut"
51
- ID: 2d93afb6-6378-45e7-b380-3ee3c235244f
52
- ```
53
-
54
- This notebook contains:
55
- - Hailer REST API documentation
56
- - Authentication patterns
57
- - Field type formats
58
- - Example zaps with annotations
59
- - Webhook configuration guides
60
-
61
- **Also check:** "Hailer REST-api" notebook (ID: `68e4e3fd-6ed6-4e0b-b624-672773ba4142`) for API endpoint details.
62
-
63
- ## Quick Reference
64
-
65
- ### Authentication
66
- ```
67
- POST https://api.hailer.com/api/login
68
- Body: {"0": "email", "1": "password"}
69
- Returns: Session key → use as "hlrkey" header
70
- ```
71
-
72
- ### Webhook Triggers
73
- - Configured per-phase in Hailer (not per-workflow)
74
- - Set `webhooksEnabled: true` and `webhookUrl` on phase
75
-
76
- **CRITICAL: Webhook Payload Structure**
77
- ```typescript
78
- {
79
- _id: string; // Activity ID (MongoDB ObjectId)
80
- name: string; // Activity name
81
- currentPhase: string; // Phase ID (MongoDB ObjectId)
82
- process: string; // Workflow ID (MongoDB ObjectId)
83
- fields: Array<{
84
- id: string; // Field ID (MongoDB ObjectId)
85
- type: string; // Field type
86
- value: any; // Field value
87
- key?: string; // Optional field key (human-readable)
88
- }>;
89
- }
90
- ```
91
-
92
- **Finding field values - two methods:**
93
- ```javascript
94
- // Method 1: By key (if field has key property - preferred when available)
95
- const tagValue = fields.find(f => f.key === 'tag')?.value;
96
-
97
- // Method 2: By fieldId (always works - use real MongoDB IDs)
98
- const tagValue = fields.find(f => f.id === '507f1f77bcf86cd799439011')?.value;
99
- ```
100
-
101
- **⚠️ NEVER use SDK enums in automations.** Webhooks receive raw MongoDB ObjectIds, not SDK enum names. Use real IDs from the workspace or extract from payload.
102
-
103
- ### Activity Creation
104
- ```
105
- POST https://api.hailer.com/api/v3/activity/create
106
- Headers: Content-Type: application/json, hlrkey: <session_key>
107
- Body: {
108
- "0": "workflowId",
109
- "1": {
110
- "name": "Activity name",
111
- "phaseId": "phaseId",
112
- "teamId": "teamId",
113
- "fields": { "fieldId": "value" }
114
- }
115
- }
116
- ```
117
-
118
- ### Field Types
119
- | Type | Format |
120
- |------|--------|
121
- | text/textarea | String |
122
- | date | Timestamp in milliseconds |
123
- | users | 24-char userId |
124
- | activitylink | 24-char activityId |
125
- | textpredefinedoptions | Exact option string |
126
-
127
- ### Zapier Tips
128
- - **Always set `return_raw_response: true`** in Custom Request steps - this gives you the full JSON response for parsing in subsequent code steps
129
- - Webhook payloads use `id` (not `_id`) for field identifiers
130
- - Use Code steps to parse and transform data between API calls
131
- - Search fields by `key` property when available (e.g., `f.key === 'user'`) for more readable code
132
- - **For Dataset workflows:** `phaseId` must be in the OPTIONS object (third parameter "2"), not in the activity object
133
-
134
- ### Zapier Import/Export JSON Format
135
-
136
- Zaps can be exported and imported as JSON files. This is useful for:
137
- - Version controlling automations in git
138
- - Sharing zap templates between projects
139
- - Backing up zap configurations
140
-
141
- **Top-level structure:**
142
- ```json
143
- {
144
- "metadata": { "version": 2 },
145
- "zaps": [{
146
- "id": 1,
147
- "title": "Zap name",
148
- "nodes": {
149
- "1": { /* trigger */ },
150
- "2": { /* action 1 */ },
151
- "3": { /* action 2 */ }
152
- }
153
- }]
154
- }
155
- ```
156
-
157
- **Node structure:**
158
- ```json
159
- {
160
- "id": 1,
161
- "paused": false,
162
- "type_of": "read", // "read" = trigger, "write" = action
163
- "params": {}, // Step-specific parameters
164
- "meta": { "$editor": { "has_automatic_issues": false }, "timezone": "Europe/Helsinki" },
165
- "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 },
166
- "parent_id": null, // null for trigger, previous node id for actions
167
- "root_id": null, // null for trigger, 1 for all actions
168
- "action": "hook_raw", // Action type (see below)
169
- "selected_api": "WebHookCLIAPI@1.0.29",
170
- "title": "Step title",
171
- "authentication_id": null
172
- }
173
- ```
174
-
175
- **Action types:**
176
- | action | selected_api | Purpose |
177
- |--------|--------------|---------|
178
- | `hook_raw` | WebHookCLIAPI@1.0.29 | Catch Webhook trigger |
179
- | `post` | WebHookCLIAPI@1.0.29 | POST request |
180
- | `custom` | WebHookCLIAPI@1.0.29 | Custom Request (GET/POST/PUT) |
181
- | `01929fad-d3dd-...` | CodeCLIAPI@1.0.1 | Run JavaScript code |
182
-
183
- **Data references between steps:**
184
- Use `{{node_id__field}}` syntax:
185
- - `{{1__raw_body}}` - Raw body from trigger
186
- - `{{2__results}}` - Results from node 2 (e.g., session key from login)
187
- - `{{3__payload}}` - Output field from code step
188
-
189
- **Example: Webhook → Login → Code → Create Activity**
190
- ```json
191
- {
192
- "metadata": { "version": 2 },
193
- "zaps": [{
194
- "id": 1,
195
- "title": "Phase webhook → Create task",
196
- "nodes": {
197
- "1": {
198
- "id": 1, "type_of": "read", "action": "hook_raw",
199
- "selected_api": "WebHookCLIAPI@1.0.29",
200
- "title": "Catch webhook", "parent_id": null, "root_id": null,
201
- "params": {}, "paused": false, "authentication_id": null,
202
- "meta": { "$editor": { "has_automatic_issues": false }, "timezone": "Europe/Helsinki" },
203
- "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 }
204
- },
205
- "2": {
206
- "id": 2, "type_of": "write", "action": "post",
207
- "selected_api": "WebHookCLIAPI@1.0.29",
208
- "title": "Login to Hailer", "parent_id": 1, "root_id": 1,
209
- "params": {
210
- "payload_type": "json", "wrap_in_array": "no", "unflatten": "yes",
211
- "url": "https://api.hailer.com/api/login",
212
- "data": { "0": "user@example.com", "1": "PASSWORD" },
213
- "headers": { "Content-Type": "application/json" }
214
- },
215
- "paused": false, "authentication_id": null,
216
- "meta": { "$editor": { "has_automatic_issues": false }, "parammap": {} },
217
- "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 }
218
- },
219
- "3": {
220
- "id": 3, "type_of": "write", "action": "01929fad-d3dd-62c2-52ed-7868d5fcc691",
221
- "selected_api": "CodeCLIAPI@1.0.1",
222
- "title": "Build payload", "parent_id": 2, "root_id": 1,
223
- "params": {
224
- "code": "const body = JSON.parse(inputData.rawBody);\\nconst payload = { \"0\": \"workflowId\", \"1\": { ... } };\\nreturn { payload: JSON.stringify(payload) };",
225
- "input": { "rawBody": "{{1__raw_body}}" }
226
- },
227
- "paused": false, "authentication_id": null,
228
- "meta": { "$editor": { "has_automatic_issues": false }, "parammap": {} },
229
- "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 }
230
- },
231
- "4": {
232
- "id": 4, "type_of": "write", "action": "custom",
233
- "selected_api": "WebHookCLIAPI@1.0.29",
234
- "title": "Create activity", "parent_id": 3, "root_id": 1,
235
- "params": {
236
- "method": "POST", "unflatten": "yes", "return_raw_response": "no",
237
- "url": "https://api.hailer.com/api/v3/activity/create",
238
- "headers": { "Content-Type": "application/json", "hlrkey": "{{2__results}}" },
239
- "data": "{{3__payload}}"
240
- },
241
- "paused": false, "authentication_id": null,
242
- "meta": { "$editor": { "has_automatic_issues": false }, "parammap": {} },
243
- "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 }
244
- }
245
- }
246
- }]
247
- }
248
- ```
249
-
250
- **See also:** `sdk-projects/pohjaset/automations/` for real-world examples with annotations
251
-
252
- ---
253
-
254
- ## Zapier Built-in Tools Reference
255
-
256
- These are Zapier's native apps - no external service needed. Essential for Hailer integrations.
257
-
258
- ### Webhooks by Zapier
259
- **API:** `WebHookCLIAPI@1.0.29`
260
-
261
- | Trigger/Action | Purpose | Key Params |
262
- |----------------|---------|------------|
263
- | **Catch Hook** (trigger) | Receive webhook from Hailer phase | `action: "hook_raw"` |
264
- | **Catch Raw Hook** (trigger) | Same, preserves raw body | `action: "hook_raw"` |
265
- | **Custom Request** (action) | Any HTTP request | `action: "custom"`, `method`, `url`, `headers`, `data` |
266
- | **POST** (action) | Simple POST | `action: "post"`, `url`, `data` |
267
- | **GET** (action) | Simple GET | `action: "get"`, `url` |
268
- | **PUT** (action) | Simple PUT | `action: "put"`, `url`, `data` |
269
-
270
- **Custom Request params:**
271
- ```json
272
- {
273
- "method": "POST",
274
- "url": "https://api.hailer.com/api/v3/activity/create",
275
- "headers": { "Content-Type": "application/json", "hlrkey": "{{2__results}}" },
276
- "data": "{{3__payload}}",
277
- "unflatten": "yes",
278
- "return_raw_response": "yes"
279
- }
280
- ```
281
-
282
- ### Code by Zapier
283
- **API:** `CodeCLIAPI@1.0.1`
284
-
285
- | Action | Purpose | Key Params |
286
- |--------|---------|------------|
287
- | **Run JavaScript** | Transform data, build payloads | `action: "01929fad-d3dd-62c2-52ed-7868d5fcc691"` |
288
- | **Run Python** | Same, Python syntax | Different action UUID |
289
-
290
- **JavaScript params:**
291
- ```json
292
- {
293
- "code": "const data = JSON.parse(inputData.rawBody);\\nreturn { result: data.field };",
294
- "input": { "rawBody": "{{1__raw_body}}", "sessionKey": "{{2__results}}" }
295
- }
296
- ```
297
-
298
- **Code tips:**
299
- - Access inputs via `inputData.variableName`
300
- - Return object with named outputs: `return { payload, email, id };`
301
- - Can use `fetch` for additional API calls (async supported)
302
- - Output fields available as `{{node__fieldname}}`
303
-
304
- ### Filter by Zapier
305
- **API:** `FilterAPI` (legacy, still works)
306
-
307
- Conditionally continue or stop the Zap. Note: `type_of` is `"filter"` (not "write").
308
-
309
- | Action | Purpose |
310
- |--------|---------|
311
- | `filter` | Only continue if conditions match |
312
-
313
- **Params:**
314
- ```json
315
- {
316
- "selected_api": "FilterAPI",
317
- "action": "filter",
318
- "type_of": "filter",
319
- "params": {
320
- "filter_criteria": [
321
- {
322
- "id": 4699009700892223,
323
- "group": 4153161264351725,
324
- "key": "{{1__status}}",
325
- "value": "approved",
326
- "match": "icontains",
327
- "action": "continue"
328
- }
329
- ]
330
- }
331
- }
332
- ```
333
-
334
- **Match types:** `icontains`, `inot_contains`, `iexact`, `inot_exact`, `is_set`, `not_set`, `greater_than`, `less_than`
335
-
336
- ### Paths by Zapier
337
- **API:** `BranchingAPI` (419 uses found)
338
-
339
- Conditional branching - different actions based on conditions. Note: Uses `BranchingAPI` not `PathsCLIAPI`.
340
-
341
- ```json
342
- {
343
- "selected_api": "BranchingAPI",
344
- "action": "branch",
345
- "type_of": "branching",
346
- "params": {
347
- "branches": [
348
- {
349
- "name": "Path A - Approved",
350
- "filter_criteria": [
351
- { "key": "{{1__status}}", "value": "approved", "match": "iexact" }
352
- ]
353
- },
354
- {
355
- "name": "Path B - Rejected",
356
- "filter_criteria": [
357
- { "key": "{{1__status}}", "value": "rejected", "match": "iexact" }
358
- ]
359
- }
360
- ]
361
- }
362
- }
363
- ```
364
-
365
- ### Formatter by Zapier
366
- **API:** `ZapierFormatterCLIAPI@1.0.7`
367
-
368
- Transform text, dates, numbers without code.
369
-
370
- | Action | Purpose |
371
- |--------|---------|
372
- | `datetime_line_item` | Format dates |
373
- | `text_line_item` | Manipulate strings |
374
- | `util_line_item` | Utilities (lookup, pick) |
375
-
376
- **Date format (useful for Hailer timestamps):**
377
- ```json
378
- {
379
- "selected_api": "ZapierFormatterCLIAPI@1.0.7",
380
- "action": "datetime_line_item",
381
- "type_of": "write",
382
- "params": {
383
- "transform": "date.formatting",
384
- "to_timezone": "UTC",
385
- "from_timezone": "UTC",
386
- "inputs": "{{1__timestamp}}",
387
- "to_format": "YYYY-MM-DD"
388
- }
389
- }
390
- ```
391
-
392
- **Text transform:**
393
- ```json
394
- {
395
- "selected_api": "ZapierFormatterCLIAPI@1.0.7",
396
- "action": "text_line_item",
397
- "type_of": "write",
398
- "params": {
399
- "transform": "text.replace",
400
- "inputs": "{{1__email}}",
401
- "find": "@old-domain.com",
402
- "replace": "@new-domain.com"
403
- }
404
- }
405
- ```
406
- Note: Hailer uses milliseconds, Zapier's `X` is seconds - divide by 1000 in Code step or use date formatting.
407
-
408
- ### Delay by Zapier
409
- **API:** `DelayCLIAPI@1.1.1`
410
-
411
- Pause execution.
412
-
413
- | Action | Purpose |
414
- |--------|---------|
415
- | `delay_for` | Wait specific duration |
416
-
417
- ```json
418
- {
419
- "selected_api": "DelayCLIAPI@1.1.1",
420
- "action": "delay_for",
421
- "type_of": "write",
422
- "params": {
423
- "delay_for_value": "5",
424
- "delay_for_unit": "minutes"
425
- }
426
- }
427
- ```
428
-
429
- ### Looping by Zapier
430
- **API:** `ZapierLoopingCLIAPI@1.2.6`
431
-
432
- Iterate over arrays (e.g., process multiple activities).
433
-
434
- | Action | Purpose |
435
- |--------|---------|
436
- | `loop_values_line_items` | Loop over line items (objects) |
437
- | `loop_values_numbers` | Loop over number range |
438
- | `loop_values_text` | Loop over text items |
439
-
440
- ```json
441
- {
442
- "selected_api": "ZapierLoopingCLIAPI@1.2.6",
443
- "action": "loop_values_line_items",
444
- "type_of": "write",
445
- "params": {
446
- "trim_whitespace": "True",
447
- "iteration_start": "1",
448
- "iteration_limit": "500",
449
- "loop_values": {
450
- "activityId": "{{1__activities[]_id}}",
451
- "name": "{{1__activities[]name}}",
452
- "status": "{{1__activities[]currentPhase}}"
453
- }
454
- }
455
- }
456
- ```
457
-
458
- Access loop outputs: `{{node__activityId}}`, `{{node__name}}`, etc.
459
-
460
- ### Sub-Zap by Zapier
461
- **API:** `SubZapCLIAPI@0.11.2`
462
-
463
- Call another Zap as a subroutine.
464
-
465
- | Action | Purpose |
466
- |--------|---------|
467
- | `start_subzap` | Trigger (receives call from parent) |
468
- | `call_subzap` | Call another Zap, wait for response |
469
- | `return_subzap` | Return data to caller |
470
-
471
- **Trigger (in sub-zap):**
472
- ```json
473
- {
474
- "selected_api": "SubZapCLIAPI@0.11.2",
475
- "action": "start_subzap",
476
- "type_of": "read",
477
- "params": {
478
- "input_list": ["activityId", "sessionKey", "workflowId"]
479
- }
480
- }
481
- ```
482
-
483
- **Call (from parent zap):**
484
- ```json
485
- {
486
- "selected_api": "SubZapCLIAPI@0.11.2",
487
- "action": "call_subzap",
488
- "type_of": "write",
489
- "params": {
490
- "account_id": "5024683",
491
- "zap_id": "202514585",
492
- "activityId": "{{1__activityId}}",
493
- "sessionKey": "{{2__results}}",
494
- "workflowId": "{{3__workflowId}}"
495
- }
496
- }
497
- ```
498
-
499
- Useful for reusable logic (e.g., "Login to Hailer" sub-zap).
500
-
501
- ### Storage by Zapier
502
- **API:** `StorageCLIAPI@1.2.1`
503
-
504
- Store and retrieve values across Zap runs.
505
-
506
- | Action | Purpose |
507
- |--------|---------|
508
- | `get_multiple_values` | Retrieve stored values |
509
- | `list_push` | Add to list |
510
- | `set_value` | Store key-value pair |
511
-
512
- **Get values:**
513
- ```json
514
- {
515
- "selected_api": "StorageCLIAPI@1.2.1",
516
- "action": "get_multiple_values",
517
- "type_of": "search",
518
- "params": {
519
- "_zap_search_success_on_miss": true,
520
- "keys": ["{{1__activityId}}", "lastSyncTimestamp"]
521
- }
522
- }
523
- ```
524
-
525
- **Push to list:**
526
- ```json
527
- {
528
- "selected_api": "StorageCLIAPI@1.2.1",
529
- "action": "list_push",
530
- "type_of": "write",
531
- "params": {
532
- "key": "processedIds",
533
- "value": "{{1__activityId}}",
534
- "location": "tail"
535
- }
536
- }
537
- ```
538
-
539
- Useful for: tracking last sync timestamp, deduplication, counters.
540
-
541
- ---
542
-
543
- ## Common Tool Combinations for Hailer
544
-
545
- | Pattern | Tools Used |
546
- |---------|------------|
547
- | **Webhook → Create Activity** | Catch Hook → Code → Custom Request |
548
- | **Conditional Processing** | Catch Hook → Filter → Code → Custom Request |
549
- | **Branching Logic** | Catch Hook → Paths → (different actions per path) |
550
- | **Batch Processing** | Catch Hook → Looping → Custom Request |
551
- | **Scheduled Sync** | Schedule trigger → Custom Request (list) → Looping → Custom Request (update) |
552
- | **Date Formatting** | Catch Hook → Formatter (date) → Code → Custom Request |
553
- | **Reusable Auth** | Sub-Zap for login → Return session key |
554
-
555
- ---
556
-
557
- ## Workflow for Building Zaps
558
-
559
- 1. **Query NotebookLM** for API patterns and field formats
560
- 2. **Get workspace IDs** using Kenji agent (workflow, phase, field, team IDs)
561
- 3. **Design the zap flow**: Trigger → (optional code step) → API action
562
- 4. **Create annotated documentation** for future reference
563
- 5. **Store zap JSON** in project's `automations/` folder
564
-
565
- ## Common Zap Patterns
566
-
567
- ### Hailer Webhook → Hailer Action
568
- 1. Catch Hook (webhook from Hailer phase)
569
- 2. Login to get session key
570
- 3. Code step to build payload
571
- 4. Custom Request to Hailer API
572
-
573
- ### External Trigger → Hailer
574
- 1. Trigger from external app (Gmail, Slack, etc.)
575
- 2. Login to Hailer
576
- 3. Create/Update activity via API
577
-
578
- ### Hailer → External Action
579
- 1. Catch Hook from Hailer
580
- 2. Transform data if needed
581
- 3. Send to external API (Slack, Email, etc.)
package/.hailer-mcp-port DELETED
@@ -1 +0,0 @@
1
- 3031
package/.mcp.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "hailer": {
4
- "type": "stdio",
5
- "command": "npx",
6
- "args": [
7
- "mcp-remote",
8
- "http://localhost:3031/api/mcp?apiKey=unique-api-key-for-this-agent"
9
- ],
10
- "env": {}
11
- }
12
- }
13
- }
@@ -1,35 +0,0 @@
1
- ---
2
- description: Creates skills and updates agents based on failure patterns
3
- mode: subagent
4
- model: anthropic/claude-sonnet-4-5
5
- tools:
6
- read: true
7
- glob: true
8
- write: true
9
- edit: true
10
- ---
11
-
12
- I am Ada. Every failure is a lesson waiting to be documented. Output JSON. Full stop.
13
-
14
- ## Handles
15
- - Detect agent failure patterns
16
- - Create skills in .claude/skills/
17
- - Update agent definitions with skill references
18
- - Document niche workflows
19
-
20
- ## Rules
21
- 1. **NEVER FABRICATE** - Must call tools.
22
- 2. **Keep agents LEAN** - Add skill references, not documentation.
23
- 3. **Minimal skills** - Focus on specific issue.
24
- 4. **Preserve personality** - Never change agent character.
25
- 5. **JSON ONLY** - Output closing brace, then STOP.
26
-
27
- ## Skill Location
28
- .claude/skills/[skill-name]/SKILL.md
29
-
30
- ## Agent Update
31
- Add ONE LINE to agent's skills section:
32
- Load `skill-name` for [pattern description].
33
-
34
- ## Protocol
35
- Output: { "status": "success|error", "result": { "skill_path": "", "agent_updated": "", "pattern": "" }, "summary": "" }
@@ -1,39 +0,0 @@
1
- ---
2
- description: Creates calculated function fields in Hailer workflows
3
- mode: subagent
4
- model: anthropic/claude-sonnet-4-5
5
- tools:
6
- read: true
7
- glob: true
8
- write: true
9
- edit: true
10
- bash: true
11
- ---
12
-
13
- I am Alejandro, master of calculated fields. Every formula must be elegant, tested, and version controlled. SDK v0.8.4.
14
-
15
- ## Handles
16
- - Create calculated function fields (arithmetic, conditionals, dates)
17
- - Edit existing function field formulas
18
- - Field dependency mapping with functionVariables (=, >, <, ?)
19
- - Testing functions locally before deployment
20
-
21
- **DOES NOT HANDLE:** nameField, nameFunction - That's NORA's domain.
22
-
23
- ## Rules
24
- 1. **NEVER FABRICATE** - Must call tools.
25
- 2. **CRITICAL: Pull OVERWRITES local changes** - Push before pulling.
26
- 3. **Add to fields.ts** - Use "function" and "functionVariables".
27
- 4. **NEVER run fields-push** - Return command for orchestrator.
28
- 5. **Use enums from enums.ts** - Never hardcode field IDs.
29
- 6. **Vanilla JS only** - No TypeScript syntax in function body.
30
- 7. **NEVER return null/undefined** - Always return valid value.
31
- 8. **JSON ONLY** - Output closing brace, then STOP.
32
-
33
- ## Variable Types
34
- - "=" - Current activity field → data: [FieldId]
35
- - ">" - Forward link → data: [LinkFieldId, TargetFieldId]
36
- - "<" - Backlink → data: [WorkflowId, TargetFieldId] (returns ARRAY)
37
-
38
- ## Protocol
39
- Output: { "status": "success|error|ready_to_push", "result": { "function_created": true, "variables": 0 }, "commands": [], "summary": "" }