@hailer/mcp 1.1.16 → 1.1.17-beta.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 (313) hide show
  1. package/.claude/CLAUDE.md +117 -320
  2. package/.claude/commands/app-squad.md +86 -90
  3. package/.claude/commands/audit-squad.md +19 -19
  4. package/.claude/commands/autoplan.md +3 -3
  5. package/.claude/commands/cleanup-squad.md +16 -16
  6. package/.claude/commands/config-squad.md +30 -30
  7. package/.claude/commands/crud-squad.md +23 -23
  8. package/.claude/commands/data-squad.md +21 -21
  9. package/.claude/commands/debug-squad.md +44 -44
  10. package/.claude/commands/doc-squad.md +16 -16
  11. package/.claude/commands/help:agents.md +130 -99
  12. package/.claude/commands/help:commands.md +15 -15
  13. package/.claude/commands/help:faq.md +17 -17
  14. package/.claude/commands/help:plugins.md +1 -1
  15. package/.claude/commands/help:skills.md +18 -24
  16. package/.claude/commands/hotfix-squad.md +22 -22
  17. package/.claude/commands/integration-squad.md +22 -22
  18. package/.claude/commands/janitor-squad.md +31 -31
  19. package/.claude/commands/learn-auto.md +5 -5
  20. package/.claude/commands/learn.md +12 -20
  21. package/.claude/commands/onboard-squad.md +39 -49
  22. package/.claude/commands/plan-workspace.md +2 -2
  23. package/.claude/commands/publish.md +32 -37
  24. package/.claude/commands/review-squad.md +27 -27
  25. package/.claude/commands/stats.md +26 -12
  26. package/.claude/commands/swarm.md +25 -25
  27. package/.claude/skills/chrome-mcp-reference/SKILL.md +5 -0
  28. package/.claude/skills/hailer-api-client/SKILL.md +55 -16
  29. package/.claude/skills/hailer-app-builder/SKILL.md +4 -270
  30. package/.claude/skills/hailer-apps-pictures/SKILL.md +3 -3
  31. package/.claude/skills/hailer-design-system/SKILL.md +96 -4
  32. package/.claude/skills/hailer-monolith-automations/SKILL.md +138 -116
  33. package/.claude/skills/hailer-permissions-system/SKILL.md +6 -9
  34. package/.claude/skills/hailer-project-protocol/SKILL.md +20 -110
  35. package/.claude/skills/integration-patterns/SKILL.md +6 -6
  36. package/.claude/skills/lsp-setup/SKILL.md +8 -9
  37. package/.claude/skills/sdk-activity-patterns/SKILL.md +238 -0
  38. package/.claude/skills/{SDK-document-templates → sdk-document-templates}/SKILL.md +13 -340
  39. package/.claude/skills/{SDK-function-fields → sdk-function-fields}/SKILL.md +8 -40
  40. package/.claude/skills/{SDK-insight-queries → sdk-insight-queries}/SKILL.md +114 -392
  41. package/.claude/skills/{SDK-ws-config-skill → sdk-ws-config-skill}/SKILL.md +79 -310
  42. package/.claude/skills/zapier-hailer-patterns/SKILL.md +84 -361
  43. package/.opencode/package-lock.json +117 -0
  44. package/CLAUDE.md +5 -358
  45. package/dist/app.d.ts.map +1 -1
  46. package/dist/app.js +10 -127
  47. package/dist/app.js.map +1 -1
  48. package/dist/bot/bot-manager.d.ts +3 -14
  49. package/dist/bot/bot-manager.d.ts.map +1 -1
  50. package/dist/bot/bot-manager.js +13 -4
  51. package/dist/bot/bot-manager.js.map +1 -1
  52. package/dist/bot/bot.d.ts +23 -102
  53. package/dist/bot/bot.d.ts.map +1 -1
  54. package/dist/bot/bot.js +356 -1212
  55. package/dist/bot/bot.js.map +1 -1
  56. package/dist/bot/services/bot-permissions.d.ts +50 -0
  57. package/dist/bot/services/bot-permissions.d.ts.map +1 -0
  58. package/dist/bot/services/bot-permissions.js +198 -0
  59. package/dist/bot/services/bot-permissions.js.map +1 -0
  60. package/dist/bot/services/index.d.ts +4 -2
  61. package/dist/bot/services/index.d.ts.map +1 -1
  62. package/dist/bot/services/index.js +10 -5
  63. package/dist/bot/services/index.js.map +1 -1
  64. package/dist/bot/services/message-classifier.d.ts +1 -1
  65. package/dist/bot/services/message-classifier.d.ts.map +1 -1
  66. package/dist/bot/services/message-classifier.js.map +1 -1
  67. package/dist/bot/services/signal-router.d.ts +32 -0
  68. package/dist/bot/services/signal-router.d.ts.map +1 -0
  69. package/dist/bot/services/signal-router.js +132 -0
  70. package/dist/bot/services/signal-router.js.map +1 -0
  71. package/dist/bot/services/system-prompt.d.ts +12 -0
  72. package/dist/bot/services/system-prompt.d.ts.map +1 -0
  73. package/dist/bot/services/system-prompt.js +93 -0
  74. package/dist/bot/services/system-prompt.js.map +1 -0
  75. package/dist/bot/services/types.d.ts +7 -34
  76. package/dist/bot/services/types.d.ts.map +1 -1
  77. package/dist/bot/services/types.js +0 -3
  78. package/dist/bot/services/types.js.map +1 -1
  79. package/dist/bot/services/workspace-refresh.d.ts +47 -0
  80. package/dist/bot/services/workspace-refresh.d.ts.map +1 -0
  81. package/dist/bot/services/workspace-refresh.js +154 -0
  82. package/dist/bot/services/workspace-refresh.js.map +1 -0
  83. package/dist/bot-config/constants.d.ts +0 -36
  84. package/dist/bot-config/constants.d.ts.map +1 -1
  85. package/dist/bot-config/constants.js +1 -76
  86. package/dist/bot-config/constants.js.map +1 -1
  87. package/dist/bot-config/context.d.ts +2 -42
  88. package/dist/bot-config/context.d.ts.map +1 -1
  89. package/dist/bot-config/context.js +13 -134
  90. package/dist/bot-config/context.js.map +1 -1
  91. package/dist/bot-config/index.d.ts +6 -15
  92. package/dist/bot-config/index.d.ts.map +1 -1
  93. package/dist/bot-config/index.js +5 -80
  94. package/dist/bot-config/index.js.map +1 -1
  95. package/dist/bot-config/loader.d.ts +16 -4
  96. package/dist/bot-config/loader.d.ts.map +1 -1
  97. package/dist/bot-config/loader.js +187 -96
  98. package/dist/bot-config/loader.js.map +1 -1
  99. package/dist/bot-config/persistence.d.ts +1 -52
  100. package/dist/bot-config/persistence.d.ts.map +1 -1
  101. package/dist/bot-config/persistence.js +3 -213
  102. package/dist/bot-config/persistence.js.map +1 -1
  103. package/dist/bot-config/state.d.ts +0 -41
  104. package/dist/bot-config/state.d.ts.map +1 -1
  105. package/dist/bot-config/state.js +0 -151
  106. package/dist/bot-config/state.js.map +1 -1
  107. package/dist/bot-config/tools.d.ts +1 -1
  108. package/dist/bot-config/tools.js +27 -27
  109. package/dist/bot-config/tools.js.map +1 -1
  110. package/dist/bot-config/types.d.ts +39 -32
  111. package/dist/bot-config/types.d.ts.map +1 -1
  112. package/dist/bot-config/types.js +0 -3
  113. package/dist/bot-config/types.js.map +1 -1
  114. package/dist/bot-config/webhooks.d.ts +0 -4
  115. package/dist/bot-config/webhooks.d.ts.map +1 -1
  116. package/dist/bot-config/webhooks.js +0 -13
  117. package/dist/bot-config/webhooks.js.map +1 -1
  118. package/dist/commands/seed-config.js +16 -31
  119. package/dist/commands/seed-config.js.map +1 -1
  120. package/dist/config.d.ts +0 -9
  121. package/dist/config.d.ts.map +1 -1
  122. package/dist/config.js +0 -15
  123. package/dist/config.js.map +1 -1
  124. package/dist/mcp/hailer-clients.js +2 -2
  125. package/dist/mcp/hailer-clients.js.map +1 -1
  126. package/dist/mcp/tool-registry.d.ts +10 -115
  127. package/dist/mcp/tool-registry.d.ts.map +1 -1
  128. package/dist/mcp/tool-registry.js +39 -363
  129. package/dist/mcp/tool-registry.js.map +1 -1
  130. package/dist/mcp/tools/activity.d.ts +3 -0
  131. package/dist/mcp/tools/activity.d.ts.map +1 -1
  132. package/dist/mcp/tools/activity.js +8 -1
  133. package/dist/mcp/tools/activity.js.map +1 -1
  134. package/dist/mcp/tools/app-core.d.ts +3 -0
  135. package/dist/mcp/tools/app-core.d.ts.map +1 -1
  136. package/dist/mcp/tools/app-core.js +9 -2
  137. package/dist/mcp/tools/app-core.js.map +1 -1
  138. package/dist/mcp/tools/app-marketplace.d.ts +3 -0
  139. package/dist/mcp/tools/app-marketplace.d.ts.map +1 -1
  140. package/dist/mcp/tools/app-marketplace.js +13 -1
  141. package/dist/mcp/tools/app-marketplace.js.map +1 -1
  142. package/dist/mcp/tools/app-member.d.ts +3 -0
  143. package/dist/mcp/tools/app-member.d.ts.map +1 -1
  144. package/dist/mcp/tools/app-member.js +6 -1
  145. package/dist/mcp/tools/app-member.js.map +1 -1
  146. package/dist/mcp/tools/app-scaffold.d.ts +3 -0
  147. package/dist/mcp/tools/app-scaffold.d.ts.map +1 -1
  148. package/dist/mcp/tools/app-scaffold.js +19 -11
  149. package/dist/mcp/tools/app-scaffold.js.map +1 -1
  150. package/dist/mcp/tools/company.d.ts +3 -0
  151. package/dist/mcp/tools/company.d.ts.map +1 -1
  152. package/dist/mcp/tools/company.js +5 -1
  153. package/dist/mcp/tools/company.js.map +1 -1
  154. package/dist/mcp/tools/discussion.d.ts +3 -0
  155. package/dist/mcp/tools/discussion.d.ts.map +1 -1
  156. package/dist/mcp/tools/discussion.js +13 -2
  157. package/dist/mcp/tools/discussion.js.map +1 -1
  158. package/dist/mcp/tools/file.d.ts +3 -0
  159. package/dist/mcp/tools/file.d.ts.map +1 -1
  160. package/dist/mcp/tools/file.js +6 -1
  161. package/dist/mcp/tools/file.js.map +1 -1
  162. package/dist/mcp/tools/index.d.ts +7 -0
  163. package/dist/mcp/tools/index.d.ts.map +1 -0
  164. package/dist/mcp/tools/index.js +34 -0
  165. package/dist/mcp/tools/index.js.map +1 -0
  166. package/dist/mcp/tools/insight.d.ts +3 -0
  167. package/dist/mcp/tools/insight.d.ts.map +1 -1
  168. package/dist/mcp/tools/insight.js +18 -8
  169. package/dist/mcp/tools/insight.js.map +1 -1
  170. package/dist/mcp/tools/user.d.ts +3 -0
  171. package/dist/mcp/tools/user.d.ts.map +1 -1
  172. package/dist/mcp/tools/user.js +6 -1
  173. package/dist/mcp/tools/user.js.map +1 -1
  174. package/dist/mcp/tools/workflow-permissions.d.ts +3 -0
  175. package/dist/mcp/tools/workflow-permissions.d.ts.map +1 -1
  176. package/dist/mcp/tools/workflow-permissions.js +8 -1
  177. package/dist/mcp/tools/workflow-permissions.js.map +1 -1
  178. package/dist/mcp/tools/workflow.d.ts +3 -0
  179. package/dist/mcp/tools/workflow.d.ts.map +1 -1
  180. package/dist/mcp/tools/workflow.js +29 -28
  181. package/dist/mcp/tools/workflow.js.map +1 -1
  182. package/dist/mcp/utils/index.d.ts +4 -11
  183. package/dist/mcp/utils/index.d.ts.map +1 -1
  184. package/dist/mcp/utils/index.js +5 -36
  185. package/dist/mcp/utils/index.js.map +1 -1
  186. package/dist/mcp/utils/role-utils.d.ts +0 -32
  187. package/dist/mcp/utils/role-utils.d.ts.map +1 -1
  188. package/dist/mcp/utils/role-utils.js +0 -73
  189. package/dist/mcp/utils/role-utils.js.map +1 -1
  190. package/dist/mcp/utils/tool-helpers.d.ts +0 -25
  191. package/dist/mcp/utils/tool-helpers.d.ts.map +1 -1
  192. package/dist/mcp/utils/tool-helpers.js +0 -34
  193. package/dist/mcp/utils/tool-helpers.js.map +1 -1
  194. package/dist/mcp/webhook-handler.d.ts +4 -34
  195. package/dist/mcp/webhook-handler.d.ts.map +1 -1
  196. package/dist/mcp/webhook-handler.js +57 -74
  197. package/dist/mcp/webhook-handler.js.map +1 -1
  198. package/dist/mcp-server.d.ts.map +1 -1
  199. package/dist/mcp-server.js +3 -78
  200. package/dist/mcp-server.js.map +1 -1
  201. package/package.json +1 -2
  202. package/.claude/agents/agent-ada-skill-builder.md +0 -94
  203. package/.claude/agents/agent-alejandro-function-fields.md +0 -342
  204. package/.claude/agents/agent-bjorn-config-audit.md +0 -103
  205. package/.claude/agents/agent-builder-agent-creator.md +0 -130
  206. package/.claude/agents/agent-code-simplifier.md +0 -53
  207. package/.claude/agents/agent-dmitri-activity-crud.md +0 -159
  208. package/.claude/agents/agent-giuseppe-app-builder.md +0 -208
  209. package/.claude/agents/agent-gunther-mcp-tools.md +0 -39
  210. package/.claude/agents/agent-helga-workflow-config.md +0 -204
  211. package/.claude/agents/agent-igor-activity-mover-automation.md +0 -125
  212. package/.claude/agents/agent-ingrid-doc-templates.md +0 -261
  213. package/.claude/agents/agent-ivan-monolith.md +0 -154
  214. package/.claude/agents/agent-kenji-data-reader.md +0 -86
  215. package/.claude/agents/agent-lars-code-inspector.md +0 -102
  216. package/.claude/agents/agent-marco-mockup-builder.md +0 -110
  217. package/.claude/agents/agent-marcus-api-documenter.md +0 -323
  218. package/.claude/agents/agent-marketplace-publisher.md +0 -280
  219. package/.claude/agents/agent-marketplace-reviewer.md +0 -309
  220. package/.claude/agents/agent-permissions-handler.md +0 -208
  221. package/.claude/agents/agent-simple-writer.md +0 -48
  222. package/.claude/agents/agent-svetlana-code-review.md +0 -171
  223. package/.claude/agents/agent-tanya-test-runner.md +0 -333
  224. package/.claude/agents/agent-ui-designer.md +0 -100
  225. package/.claude/agents/agent-viktor-sql-insights.md +0 -212
  226. package/.claude/agents/agent-web-search.md +0 -55
  227. package/.claude/agents/agent-yevgeni-discussions.md +0 -45
  228. package/.claude/agents/agent-zara-zapier.md +0 -159
  229. package/.claude/skills/SDK-activity-patterns/SKILL.md +0 -428
  230. package/.claude/skills/SDK-generate-skill/SKILL.md +0 -92
  231. package/.claude/skills/SDK-init-skill/SKILL.md +0 -127
  232. package/.claude/skills/agent-structure/SKILL.md +0 -98
  233. package/.claude/skills/delegation-routing/SKILL.md +0 -202
  234. package/.claude/skills/frontend-design/SKILL.md +0 -254
  235. package/.claude/skills/hailer-activity-mover/SKILL.md +0 -213
  236. package/.claude/skills/hailer-rest-api/SKILL.md +0 -61
  237. package/.claude/skills/hailer-rest-api/hailer-activities.md +0 -184
  238. package/.claude/skills/hailer-rest-api/hailer-admin.md +0 -473
  239. package/.claude/skills/hailer-rest-api/hailer-calendar.md +0 -256
  240. package/.claude/skills/hailer-rest-api/hailer-feed.md +0 -249
  241. package/.claude/skills/hailer-rest-api/hailer-insights.md +0 -195
  242. package/.claude/skills/hailer-rest-api/hailer-messaging.md +0 -276
  243. package/.claude/skills/hailer-rest-api/hailer-workflows.md +0 -283
  244. package/.claude/skills/insight-join-patterns/SKILL.md +0 -174
  245. package/.claude/skills/json-only-output/SKILL.md +0 -72
  246. package/.claude/skills/mcp-direct-tools/SKILL.md +0 -153
  247. package/.claude/skills/optional-parameters/SKILL.md +0 -72
  248. package/.claude/skills/tool-parameter-usage/SKILL.md +0 -126
  249. package/.claude/skills/tool-response-verification/SKILL.md +0 -92
  250. package/.opencode/agent/agent-ada-skill-builder.md +0 -35
  251. package/.opencode/agent/agent-alejandro-function-fields.md +0 -39
  252. package/.opencode/agent/agent-bjorn-config-audit.md +0 -36
  253. package/.opencode/agent/agent-builder-agent-creator.md +0 -39
  254. package/.opencode/agent/agent-code-simplifier.md +0 -31
  255. package/.opencode/agent/agent-dmitri-activity-crud.md +0 -40
  256. package/.opencode/agent/agent-giuseppe-app-builder.md +0 -37
  257. package/.opencode/agent/agent-gunther-mcp-tools.md +0 -39
  258. package/.opencode/agent/agent-helga-workflow-config.md +0 -204
  259. package/.opencode/agent/agent-igor-activity-mover-automation.md +0 -46
  260. package/.opencode/agent/agent-ingrid-doc-templates.md +0 -39
  261. package/.opencode/agent/agent-ivan-monolith.md +0 -46
  262. package/.opencode/agent/agent-kenji-data-reader.md +0 -53
  263. package/.opencode/agent/agent-lars-code-inspector.md +0 -28
  264. package/.opencode/agent/agent-marco-mockup-builder.md +0 -42
  265. package/.opencode/agent/agent-marcus-api-documenter.md +0 -53
  266. package/.opencode/agent/agent-marketplace-publisher.md +0 -44
  267. package/.opencode/agent/agent-marketplace-reviewer.md +0 -42
  268. package/.opencode/agent/agent-permissions-handler.md +0 -50
  269. package/.opencode/agent/agent-simple-writer.md +0 -45
  270. package/.opencode/agent/agent-svetlana-code-review.md +0 -39
  271. package/.opencode/agent/agent-tanya-test-runner.md +0 -57
  272. package/.opencode/agent/agent-ui-designer.md +0 -56
  273. package/.opencode/agent/agent-viktor-sql-insights.md +0 -34
  274. package/.opencode/agent/agent-web-search.md +0 -42
  275. package/.opencode/agent/agent-yevgeni-discussions.md +0 -37
  276. package/.opencode/agent/agent-zara-zapier.md +0 -53
  277. package/.opencode/commands/app-squad.md +0 -135
  278. package/.opencode/commands/audit-squad.md +0 -158
  279. package/.opencode/commands/autoplan.md +0 -563
  280. package/.opencode/commands/cleanup-squad.md +0 -98
  281. package/.opencode/commands/config-squad.md +0 -106
  282. package/.opencode/commands/crud-squad.md +0 -87
  283. package/.opencode/commands/data-squad.md +0 -97
  284. package/.opencode/commands/debug-squad.md +0 -303
  285. package/.opencode/commands/doc-squad.md +0 -65
  286. package/.opencode/commands/handoff.md +0 -137
  287. package/.opencode/commands/health.md +0 -49
  288. package/.opencode/commands/help-agents.md +0 -151
  289. package/.opencode/commands/help-commands.md +0 -32
  290. package/.opencode/commands/help-faq.md +0 -29
  291. package/.opencode/commands/help-plugins.md +0 -28
  292. package/.opencode/commands/help-skills.md +0 -7
  293. package/.opencode/commands/help-tools.md +0 -40
  294. package/.opencode/commands/help.md +0 -28
  295. package/.opencode/commands/hotfix-squad.md +0 -112
  296. package/.opencode/commands/integration-squad.md +0 -82
  297. package/.opencode/commands/janitor-squad.md +0 -167
  298. package/.opencode/commands/learn-auto.md +0 -120
  299. package/.opencode/commands/learn.md +0 -120
  300. package/.opencode/commands/mcp-list.md +0 -27
  301. package/.opencode/commands/onboard-squad.md +0 -140
  302. package/.opencode/commands/plan-workspace.md +0 -732
  303. package/.opencode/commands/prd.md +0 -131
  304. package/.opencode/commands/project-status.md +0 -82
  305. package/.opencode/commands/publish.md +0 -138
  306. package/.opencode/commands/recap.md +0 -69
  307. package/.opencode/commands/restore.md +0 -64
  308. package/.opencode/commands/review-squad.md +0 -152
  309. package/.opencode/commands/save.md +0 -24
  310. package/.opencode/commands/stats.md +0 -19
  311. package/.opencode/commands/swarm.md +0 -210
  312. package/.opencode/commands/tool-builder.md +0 -39
  313. package/.opencode/commands/ws-pull.md +0 -44
@@ -1,8 +1,52 @@
1
1
  ---
2
- name: SDK-ws-config-skill
2
+ name: sdk-ws-config-skill
3
3
  description: Comprehensive workspace configuration - workflows, fields, phases
4
- version: 1.7.1
5
- triggers: Create workflow, add field, configure phase, field visibility, phase transitions
4
+ version: 1.8.0
5
+ triggers: Create workflow, add field, configure phase, field visibility, phase transitions, new project, init workspace, setup SDK, create workspace
6
+ ---
7
+
8
+ # New Project Setup
9
+
10
+ ```bash
11
+ mkdir my-hailer-project && cd my-hailer-project
12
+ npm init -y
13
+ npm install @hailer/sdk typescript vitest --save-dev
14
+ ```
15
+
16
+ Create `.env`:
17
+ ```
18
+ HAILER_API_KEY=your_api_key
19
+ HAILER_WORKSPACE_ID=your_workspace_id
20
+ ```
21
+
22
+ Create `config.json`:
23
+ ```json
24
+ { "workspaceId": "your_workspace_id", "apiUrl": "https://api.hailer.com" }
25
+ ```
26
+
27
+ ```bash
28
+ npm run pull # Download workspace config into workspace/
29
+ git init
30
+ echo ".env" >> .gitignore
31
+ echo "node_modules" >> .gitignore
32
+ ```
33
+
34
+ **Project structure after pull:**
35
+ ```
36
+ workspace/
37
+ ├── workflows.ts, enums.ts (AUTO-GENERATED), teams.ts, groups.ts
38
+ ├── hailer.d.ts ← AUTO-GENERATED (never edit)
39
+ └── [Workflow]_[id]/
40
+ ├── main.ts, fields.ts, phases.ts
41
+ └── functions/*.ts
42
+ ```
43
+
44
+ **`npm run pull` vs `npm run generate`:**
45
+ - `npm run pull` — Downloads workspace config into `workspace/` (editable TypeScript files: fields, phases, workflows, enums, etc.)
46
+ - `npm run generate` — Generates `hailer-types.ts` (a single file with workflow/phase/field enums for use in app code). These are separate commands serving different purposes.
47
+
48
+ **After setup:** Always set a default team on each workflow (see CRITICAL rule below).
49
+
6
50
  ---
7
51
 
8
52
  # Workspace Configuration
@@ -13,6 +57,7 @@ triggers: Create workflow, add field, configure phase, field visibility, phase t
13
57
  workspace/
14
58
  ├── workflows.ts ← Workflow registry
15
59
  ├── enums.ts ← AUTO-GENERATED (never edit)
60
+ ├── hailer.d.ts ← AUTO-GENERATED (never edit)
16
61
  ├── teams.ts, groups.ts ← Access control
17
62
  ├── insights.ts ← SQL-like reports
18
63
  └── [Workflow]_[id]/
@@ -379,312 +424,51 @@ The `key` property is an optional URL-safe identifier for the field. If omitted,
379
424
  - Always for fields referenced in insights or functions
380
425
  - Optional for internal-only fields (auto-generated is fine)
381
426
 
382
- ### Field Descriptions
383
-
384
- The `description` property adds help text below the field input in Hailer forms.
385
-
386
- **When to use:**
387
- - Fields with non-obvious formats ("Enter date as DD.MM.YYYY")
388
- - Fields requiring specific values ("Must be 8-digit code")
389
- - Fields with business rules ("Leave empty to use default pricing")
390
- - Fields that differ from similar-named fields in other workflows
391
-
392
- **Examples:**
393
- ```typescript
394
- {
395
- label: "Project Code",
396
- type: "text",
397
- key: "project_code",
398
- description: "8-character code from the ERP system (e.g., PRJ-12345)"
399
- }
400
-
401
- {
402
- label: "Discount %",
403
- type: "numeric",
404
- key: "discount_pct",
405
- description: "Enter 0-100. Applied to subtotal before VAT."
406
- }
407
- ```
408
-
409
- ### Field Types Reference
410
-
411
- Complete reference of all Hailer field types. Source: `hailer.d.ts` HailerFieldType.
412
-
413
- #### Quick Reference Table
414
-
415
- | Type | Use For | Value Format (CRUD) | Notes |
416
- |------|---------|---------------------|-------|
417
- | `text` | Short text (single line) | `"string"` | |
418
- | `textarea` | Long text (multi-line) | `"string"` | Plain text |
419
- | `textunit` | Text with unit suffix | `"string"` | Display unit |
420
- | `numeric` | Numbers | `123` or `45.67` | |
421
- | `numericunit` | Numbers with unit | `123` | Unit in display |
422
- | `date` | Single date | `1730937600000` (ms) | Unix timestamp |
423
- | `datetime` | Date + time | `1730937600000` (ms) | Unix timestamp |
424
- | `daterange` | Date span | `{start, end}` | Both timestamps |
425
- | `datetimerange` | Date+time span | `{start, end}` | Both timestamps |
426
- | `time` | Time only | `1765863000000` (ms) | Timestamp, but only time shown (e.g., "17:00") |
427
- | `timerange` | Time span | `{start, end}` | Timestamps, shown as "17:00 - 18:00" |
428
- | `textpredefinedoptions` | Dropdown select | `"Option"` | **STRING not array!** See section below. |
429
- | `users` | Single user | `"userId"` | STRING not array! |
430
- | `teams` | Team | `"teamId"` | Team selector |
431
- | `activitylink` | Link to activity | `"activityId"` | STRING not array! |
432
- | `linkedfrom` | Backlink (read-only) | N/A | Auto-populated |
433
- | `country` | Country picker | `"FI"` | ISO country code |
434
- | `subheader` | Section divider | N/A | UI only, no data |
435
- | `numeric` + `modifier.checkbox` | Checkbox/boolean | `1` or `0` | See Modified Fields |
436
- | `text` + `modifier.file` | File/picture upload | Object | See Modified Fields |
437
-
438
- **Note:** No multi-select types exist. For multiple values, use multiple fields or comma-separated text.
439
-
440
- ---
441
-
442
- #### Text Fields
443
-
444
- ```typescript
445
- // Short text (single line)
446
- { type: "text", label: "Title" }
447
-
448
- // Long text (multi-line, plain)
449
- { type: "textarea", label: "Description" }
450
-
451
- // Text with unit suffix (e.g., "100 pcs")
452
- { type: "textunit", label: "Quantity Text", unit: "pcs" }
453
- ```
454
-
455
- **When to use:**
456
- - `text` - Names, titles, short answers
457
- - `textarea` - Descriptions, comments, notes
458
- - `textunit` - Text that needs a unit suffix displayed
459
-
460
- ---
461
-
462
- #### Number Fields
463
-
464
- ```typescript
465
- // Plain number
466
- { type: "numeric", label: "Quantity" }
467
-
468
- // Number with display unit
469
- { type: "numericunit", label: "Price", unit: "€" }
470
- { type: "numericunit", label: "Weight", unit: "kg" }
471
- ```
472
-
473
- **CRITICAL:** Type is `numeric`, NOT `number`!
474
-
475
- **When to use:**
476
- - `numeric` - Quantities, counts, raw numbers
477
- - `numericunit` - Prices, measurements, amounts with units
478
-
479
- ---
480
-
481
- #### Date/Time Fields
482
-
483
- ```typescript
484
- // Single date (no time)
485
- { type: "date", label: "Due Date" }
486
-
487
- // Date with time
488
- { type: "datetime", label: "Meeting Start" }
489
-
490
- // Date range (start + end dates)
491
- { type: "daterange", label: "Project Period" }
492
-
493
- // Date+time range
494
- { type: "datetimerange", label: "Event" }
495
-
496
- // Time only (no date)
497
- { type: "time", label: "Start Time" }
498
-
499
- // Time range
500
- { type: "timerange", label: "Working Hours" }
501
- ```
502
-
503
- **Value format (CRUD):**
504
- - `date`, `datetime`: Unix timestamp in milliseconds → `1730937600000`
505
- - `daterange`, `datetimerange`: `{ start: 1730937600000, end: 1731024000000 }`
506
- - `time`: Unix timestamp (ms) → `1765863000000` (date arbitrary, only time displayed as "09:30")
507
- - `timerange`: `{ start: 1765863000000, end: 1765892400000 }` (shown as "09:30 - 17:30")
508
-
509
- **Time field note:** Stored as full timestamp but UI only shows time. Extract time portion when displaying:
510
- ```javascript
511
- const date = new Date(timeValue);
512
- const hours = date.getUTCHours();
513
- const minutes = date.getUTCMinutes();
514
- ```
515
-
516
- **When to use:**
517
- - `date` - Due dates, deadlines, birthdays
518
- - `datetime` - Meetings, appointments with specific time
519
- - `daterange` - Projects, events, bookings with duration
520
- - `datetimerange` - Events with specific start/end times
521
- - `time` - Daily schedules, opening hours
522
- - `timerange` - Shifts, time slots
523
-
524
- ---
525
-
526
- #### Selection Fields
527
-
528
- ```typescript
529
- // Dropdown - MUST use "textpredefinedoptions"
530
- {
531
- type: "textpredefinedoptions",
532
- label: "Priority",
533
- data: ["High", "Medium", "Low"] // String array only!
534
- }
535
- ```
536
-
537
- **CRITICAL FORMAT RULES:**
538
- - Type: `textpredefinedoptions` (NOT `dropdown`, `predefinedoptions`, `select`)
539
- - Property: `data` (NOT `options`)
540
- - Format: `["A", "B"]` (NOT `[{label: "A", value: "a"}]`)
541
- - **No multi-select exists** - use multiple fields if needed
427
+ ### Non-Obvious Field Type Notes
542
428
 
543
- **Value format (CRUD):** `"High"` (STRING, not array!)
429
+ **Checkbox** not a distinct type. Use `numeric` + `modifier.checkbox: true` (stores `1`/`0`).
544
430
 
545
- ```typescript
546
- // ✅ CORRECT
547
- { type: "textpredefinedoptions", data: ["High", "Medium", "Low"] }
548
-
549
- // ❌ WRONG
550
- { type: "dropdown", ... } // Wrong type name
551
- { type: "predefinedoptions", ... } // Missing "text" prefix
552
- { options: ["A", "B"] } // Use data, not options
553
- { data: [{label: "A", value: "a"}] } // Use strings only
554
- ```
555
-
556
- ---
557
-
558
- #### User & Team Fields
431
+ **File upload** — use `text` + `modifier.file: true`.
559
432
 
560
433
  ```typescript
561
- // Single user
562
- {
563
- type: "users",
564
- label: "Assignee",
565
- inviteToDiscussionOnChange: true // Auto-invite when assigned
566
- }
434
+ // Checkbox
435
+ { label: "Is Active", type: "numeric", modifier: { checkbox: true, file: false } }
567
436
 
568
- // Team
569
- {
570
- type: "teams",
571
- label: "Responsible Team"
572
- }
437
+ // File upload
438
+ { label: "Attachments", type: "text", modifier: { checkbox: false, file: true } }
573
439
  ```
574
440
 
575
- **Value format (CRUD):**
576
- - `users`: `"5f8a1b2c3d4e5f6a7b8c9d0e"` (STRING user ID)
577
- - `teams`: `"teamId"` (STRING team ID)
578
-
579
- **Note:** No multi-select for users/teams. Use multiple fields if needed.
580
-
581
- ---
582
-
583
- #### Link Fields
441
+ **`linkedfrom`** (backlink) — read-only, auto-populated. Supports `modifier.quickAdd` to create related activities inline:
584
442
 
585
443
  ```typescript
586
- // Activity link (THIS → other activity)
587
- {
588
- type: "activitylink",
589
- label: "Customer",
590
- data: [WorkflowIds.customers_abc] // Plain string array!
591
- }
592
-
593
- // Multiple workflow link (can link to different workflow types)
594
- {
595
- type: "activitylink",
596
- label: "Related Item",
597
- data: [WorkflowIds.customers, WorkflowIds.projects]
598
- }
599
-
600
- // Linked from (backlink - others → THIS) - READ ONLY
601
444
  {
602
445
  type: "linkedfrom",
603
446
  label: "Orders",
604
447
  data: [WorkflowIds.orders_def],
605
448
  modifier: {
606
449
  quickAdd: {
607
- fieldIds: [], // Fields in quick-add form
450
+ fieldIds: [], // Fields shown in quick-add form
608
451
  targetFieldId: Orders_FieldIds.customer_link
609
452
  }
610
453
  }
611
454
  }
612
455
  ```
613
456
 
614
- **CRITICAL FORMAT RULES:**
457
+ **`activitylink`** `data` must be a plain string array of workflow IDs (not objects):
615
458
  ```typescript
616
- // ✅ CORRECT - plain string array
617
- data: ["697b9b54477b7e412ee08b9d"]
618
- data: [WorkflowIds.customers_abc]
619
-
620
- // ❌ WRONG - objects (causes API error)
621
- data: [{ workflowId: "697b9b54477b7e412ee08b9d" }]
459
+ data: [WorkflowIds.customers_abc] // ✅
460
+ data: [{ workflowId: "697b9b54..." }] // ❌ causes API error
622
461
  ```
623
462
 
624
- **Value format (CRUD):**
625
- - `activitylink`: `"692abc123def456"` (STRING activity ID, not array!)
626
-
627
- **When to use:**
628
- - `activitylink` - Customer on order, project on task, parent-child relations
629
- - `linkedfrom` - Show related items (read-only, auto-populated from links)
630
-
631
- ---
632
-
633
- #### Modified Fields (Checkbox & File Upload)
634
-
635
- Fields can have a `modifier` object that changes their behavior:
636
-
463
+ **`textpredefinedoptions`** `data` is a string array (not `options`, not objects):
637
464
  ```typescript
638
- // Checkbox field = numeric + modifier.checkbox: true
639
- {
640
- label: "Is Active",
641
- type: "numeric",
642
- modifier: {
643
- checkbox: true,
644
- file: false
645
- }
646
- }
647
-
648
- // File/Picture upload = text + modifier.file: true
649
- {
650
- label: "Attachments",
651
- type: "text",
652
- modifier: {
653
- checkbox: false,
654
- file: true
655
- }
656
- }
657
- ```
658
-
659
- **Value format (CRUD):**
660
- - Checkbox: `1` (true) or `0` (false) - stored as number
661
- - File: File reference object (handled by Hailer UI)
662
-
663
- **When to use:**
664
- - `modifier.checkbox: true` - Boolean yes/no, toggles
665
- - `modifier.file: true` - File uploads, images, attachments
666
-
667
- ---
668
-
669
- #### Other Fields
670
-
671
- ```typescript
672
- // Country picker
673
- { type: "country", label: "Country" }
674
-
675
- // UI organization (section divider)
676
- { type: "subheader", label: "Financial Details", collapsedByDefault: true }
465
+ { type: "textpredefinedoptions", data: ["High", "Medium", "Low"] } // ✅
466
+ { type: "dropdown", options: [...] } // ❌
677
467
  ```
678
468
 
679
- **Value format (CRUD):**
680
- - `country`: ISO country code → `"FI"`, `"SE"`, `"US"`
681
- - `subheader`: No data (UI only)
682
-
683
- **When to use:**
684
- - `country` - Address country, nationality
685
- - `subheader` - Group related fields visually
469
+ **No multi-select types exist.** Use multiple fields if needed.
686
470
 
687
- **Note:** For contact info (email, phone, URL), use `text` fields.
471
+ **`time` / `timerange`** stored as full Unix timestamp (ms) but UI shows only the time portion. Extract with `new Date(val).getUTCHours()`.
688
472
 
689
473
  ---
690
474
 
@@ -711,7 +495,7 @@ Fields can have a `modifier` object that changes their behavior:
711
495
  }
712
496
  ```
713
497
 
714
- **See `SDK-function-fields` skill for complete function field guide.**
498
+ **See `sdk-function-fields` skill for complete function field guide.**
715
499
 
716
500
  ---
717
501
 
@@ -724,31 +508,6 @@ Fields can have a `modifier` object that changes their behavior:
724
508
  | **richtext size** | Large HTML can slow down activity loading |
725
509
  | **attachment storage** | Files stored in Hailer, count toward workspace storage |
726
510
 
727
- ### Calculated Function Fields
728
-
729
- ```typescript
730
- {
731
- _id: Tasks_FieldIds.total_abc,
732
- label: "Total",
733
- type: "numericunit",
734
- unit: "€",
735
- functionEnabled: true,
736
- function: "@function:total_abc",
737
- functionVariables: {
738
- quantity: {
739
- type: "=",
740
- data: [Tasks_FieldIds.quantity_def]
741
- },
742
- price: {
743
- type: "=",
744
- data: [Tasks_FieldIds.unit_price_ghi]
745
- }
746
- }
747
- }
748
- ```
749
-
750
- See `SDK-function-field-variables` skill for variable types (=, >, <, ?).
751
-
752
511
  ---
753
512
 
754
513
  ## Phases
@@ -920,6 +679,18 @@ Each phase has a `fields` array that controls which fields are visible when an a
920
679
  **:force variants** may delete resources not in local files.
921
680
  **Non-force variants** only update, never delete.
922
681
 
682
+ ### Push vs Sync — What Each Command Does
683
+
684
+ | Command | Creates | Updates | Deletes |
685
+ |---------|---------|---------|---------|
686
+ | `workflows push` | No | Yes | No |
687
+ | `workflows sync` | Yes | No | Yes |
688
+ | `fields push` | Yes | Yes | Yes (with confirmation) |
689
+ | `templates push` | No | Yes | No |
690
+ | `templates sync` | Yes | No | Yes |
691
+
692
+ **Key rule:** Use `sync` to create or delete; use `push` to update existing config. For fields, `push` handles all three operations.
693
+
923
694
  ### CRITICAL: Push/Pull Order
924
695
 
925
696
  **Push FIRST, then pull.** Running pull before push overwrites local changes.
@@ -1096,11 +867,9 @@ const allPhases = [
1096
867
  | Forgetting to add field to phases | New fields need to be in `phase.fields` |
1097
868
  | Changing field type via API | Field types CANNOT be changed - see below |
1098
869
  | Including `key` on existing phases | `key` only for NEW phases - push fails on existing |
1099
- | Using `predefinedoptions` or `dropdown` | Use `textpredefinedoptions` (with "text" prefix) |
1100
- | Using `options: [...]` for dropdowns | Use `data: [...]` (not options) |
1101
- | `data: [{workflowId: "..."}]` for links | Use `data: ["workflowId"]` (plain string array) |
1102
870
  | Forgetting `possibleNextPhase` | Activities stuck without phase transition links |
1103
871
  | Missing `primaryDateField` | Activities won't show on calendar |
872
+ | Two fields with same name/label | One will be removed during push — deduplicate labels! |
1104
873
 
1105
874
  ---
1106
875