@hailer/mcp 1.3.14 → 1.3.23

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 (57) hide show
  1. package/.claude/skills/create-and-publish-app/SKILL.md +44 -56
  2. package/.claude/skills/hailer-app-builder/SKILL.md +414 -970
  3. package/.claude/skills/hailer-app-primitives/SKILL.md +742 -0
  4. package/.claude/skills/hailer-apps-pictures/SKILL.md +191 -87
  5. package/.claude/skills/hailer-design-patterns/SKILL.md +317 -0
  6. package/.claude/skills/hailer-design-system/SKILL.md +202 -149
  7. package/.claude/skills/hailer-workflow-archetypes/SKILL.md +301 -0
  8. package/.claude/skills/insight-join-patterns/SKILL.md +313 -0
  9. package/.claude/skills/publish-hailer-app/SKILL.md +211 -0
  10. package/.claude/skills/sdk-activity-patterns/SKILL.md +257 -105
  11. package/.claude/skills/sdk-function-fields/SKILL.md +253 -492
  12. package/.claude/skills/sdk-insight-calculations/SKILL.md +364 -0
  13. package/.claude/skills/sdk-insight-queries/SKILL.md +192 -397
  14. package/.claude/skills/sdk-ws-config-skill/SKILL.md +265 -720
  15. package/.claude/skills/tool-response-verification/SKILL.md +143 -0
  16. package/CLAUDE.md +50 -19
  17. package/dist/bot/bot.d.ts.map +1 -1
  18. package/dist/bot/bot.js +26 -34
  19. package/dist/bot/bot.js.map +1 -1
  20. package/dist/bot/services/helper-prompt.d.ts +1 -1
  21. package/dist/bot/services/helper-prompt.d.ts.map +1 -1
  22. package/dist/bot/services/helper-prompt.js +62 -82
  23. package/dist/bot/services/helper-prompt.js.map +1 -1
  24. package/dist/bot/services/system-prompt.js +4 -4
  25. package/dist/config.d.ts +1 -0
  26. package/dist/config.d.ts.map +1 -1
  27. package/dist/config.js +6 -0
  28. package/dist/config.js.map +1 -1
  29. package/dist/mcp/hailer-rpc.d.ts +1 -0
  30. package/dist/mcp/hailer-rpc.d.ts.map +1 -1
  31. package/dist/mcp/hailer-rpc.js +4 -0
  32. package/dist/mcp/hailer-rpc.js.map +1 -1
  33. package/dist/mcp/tools/activity.d.ts.map +1 -1
  34. package/dist/mcp/tools/activity.js +8 -2
  35. package/dist/mcp/tools/activity.js.map +1 -1
  36. package/dist/mcp/tools/app-core.d.ts.map +1 -1
  37. package/dist/mcp/tools/app-core.js +6 -3
  38. package/dist/mcp/tools/app-core.js.map +1 -1
  39. package/dist/mcp/tools/app-marketplace.d.ts.map +1 -1
  40. package/dist/mcp/tools/app-marketplace.js +5 -1
  41. package/dist/mcp/tools/app-marketplace.js.map +1 -1
  42. package/dist/mcp/webhook-handler.d.ts.map +1 -1
  43. package/dist/mcp/webhook-handler.js +27 -0
  44. package/dist/mcp/webhook-handler.js.map +1 -1
  45. package/dist/public-chat/graduate.d.ts.map +1 -1
  46. package/dist/public-chat/graduate.js +153 -53
  47. package/dist/public-chat/graduate.js.map +1 -1
  48. package/dist/public-chat/rate-limit.js +1 -1
  49. package/dist/public-chat/rate-limit.js.map +1 -1
  50. package/dist/public-chat/studio-prewarm.js +2 -2
  51. package/dist/public-chat/studio-prewarm.js.map +1 -1
  52. package/dist/public-chat/system-prompt.d.ts.map +1 -1
  53. package/dist/public-chat/system-prompt.js +41 -25
  54. package/dist/public-chat/system-prompt.js.map +1 -1
  55. package/package.json +1 -1
  56. package/.claude/skills/hailer-project-protocol/SKILL.md +0 -398
  57. package/.opencode/package-lock.json +0 -117
@@ -0,0 +1,211 @@
1
+ ---
2
+ name: publish-hailer-app
3
+ description: Publishing Hailer apps to production — load when asked to publish, deploy, or switch a live app URL; covers manifest validation, CLI publish command, URL switch, sharing, cache busting, and publish gotchas
4
+ version: 3.4.0
5
+ triggers:
6
+ - publish app
7
+ - deploy app
8
+ - production app
9
+ - manifest
10
+ - appId
11
+ ---
12
+
13
+ # Publish Hailer App
14
+
15
+ Guide for publishing Hailer apps to production.
16
+
17
+ <warning>
18
+ ## Publishing Requires Explicit User Request
19
+
20
+ **Default is local development** — scaffold creates a dev app at `http://localhost:3000` automatically.
21
+
22
+ **Only use this skill when the user explicitly asks to publish or deploy to production.**
23
+ </warning>
24
+
25
+ <primary-path>
26
+ ## Primary Publish Path: CLI Script
27
+
28
+ **`npm run publish-production -- --force` is the publish path.** The MCP server does NOT publish apps — it only covers the app registry (`manage_app`, `list_apps`, `remove_app`) and marketplace listings.
29
+
30
+ `npm run publish-production -- --force` appends `--force` to the scaffold's script (which builds, packs, and calls `publish.cjs`), so no manual `npm pack` step is needed — the `--force` is what skips the interactive overwrite prompt that hangs agents.
31
+
32
+ Auth comes from `HAILER_USER_API_KEY` in `~/.env` (auto-minted by `hailer-mcp` on boot). See `create-and-publish-app` skill `<credentials>` for the full auth chain and fallback options.
33
+ </primary-path>
34
+
35
+ <precondition>
36
+ ## Precondition: Verify @hailer/app-sdk Version Before Publishing
37
+
38
+ **Concrete failure signature (v1.0.3):** Stale `@hailer/app-sdk` v1.0.3 makes publish fail — v1's `publish.cjs` ignores `--user-api-key`, requires interactive password (crashes non-TTY). Bumping to `^2.5.0` + `npm install` resolves this.
39
+
40
+ ```bash
41
+ npm view @hailer/app-sdk version # get latest from registry
42
+ cat package.json | grep app-sdk # check installed version
43
+ ```
44
+ </precondition>
45
+
46
+ <manifest-validation>
47
+ ## Validate manifest.json Before Publishing
48
+
49
+ Check these before publishing:
50
+
51
+ 1. Read `public/manifest.json`
52
+ 2. `appId` exists and is 24 characters — if empty/missing or equals `65143728d2bd678b13daf289`, this is a first publish (use `--create`)
53
+ 3. `version` exists and is not empty (e.g., `"1.0.0"`)
54
+ 4. `versionDescription` exists and is not empty
55
+ 5. `vite.config.ts` has `base: './'` — without it assets 403/404 in production while localhost works
56
+ </manifest-validation>
57
+
58
+ <version-bump>
59
+ ## Updating Published Apps (version bump every publish)
60
+
61
+ Every publish must bump the version and update the description.
62
+
63
+ ### Version format: `MAJOR.MINOR.PATCH`
64
+
65
+ | Bump | When |
66
+ |------|------|
67
+ | `0.0.X` | Small fixes, typos, minor tweaks |
68
+ | `0.X.0` | Bigger fixes, improvements, new minor features |
69
+ | `X.0.0` | Major features, redesigns, breaking changes |
70
+
71
+ Update both `version` AND `versionDescription` in `public/manifest.json` before each publish.
72
+ </version-bump>
73
+
74
+ <url-switch>
75
+ ## Switching the App URL to Production
76
+
77
+ Publishing uploads files but does NOT update the app registry entry's URL. After publishing, switch the URL via MCP:
78
+
79
+ ```javascript
80
+ manage_app({
81
+ action: 'update',
82
+ appId: "695816e2ba1d8bef3af7e018",
83
+ name: "My App Name", // REQUIRED even when only updating URL — without it: code 191 "\"[1].name\" is required"
84
+ url: "https://apps.hailer.com/{workspaceId}/{appId}/"
85
+ })
86
+ ```
87
+
88
+ Verify with `list_apps()` — URL should be `https://apps.hailer.com/...`, not localhost.
89
+ </url-switch>
90
+
91
+ <sharing>
92
+ ## Sharing Apps
93
+
94
+ ```javascript
95
+ // Entire workspace
96
+ manage_app({ action: 'add_member', appId: "...", member: "network_{workspaceId}" })
97
+
98
+ // Team
99
+ manage_app({ action: 'add_member', appId: "...", member: "team_{teamId}" })
100
+
101
+ // User
102
+ manage_app({ action: 'add_member', appId: "...", member: "user_{userId}" })
103
+ ```
104
+
105
+ **Pre-created app entry gotcha:** Apps published against a pre-created entry (via `manage_app({ action: 'create', ... })` before first publish) do NOT get the auto-share that `--create` performs. Members stay `[bot user]` only — the app is invisible in everyone's app list. After publishing to a pre-created entry, run `manage_app add_member` with `network_<wsId>` manually.
106
+
107
+ **`"public": true` in the manifest** is required for `hailer.public.*` API methods and standalone loading. Without it the app won't load when accessed via a direct URL.
108
+ </sharing>
109
+
110
+ <vite-config>
111
+ ## Vite Base Path
112
+
113
+ Required for production deployment:
114
+
115
+ ```typescript
116
+ // vite.config.ts
117
+ export default defineConfig({
118
+ base: './', // required for production
119
+ // ... other config
120
+ });
121
+ ```
122
+
123
+ Without this, asset paths resolve to root domain — production returns 403/404 while localhost works fine.
124
+ </vite-config>
125
+
126
+ <cache-busting>
127
+ ## Browser Cache for Published Apps
128
+
129
+ Published Hailer apps can serve stale versions from browser cache. Vite hashes JS/CSS filenames but `index.html` itself gets cached. Meta tags do NOT work in iframes — use a Vite plugin instead:
130
+
131
+ ```typescript
132
+ // vite.config.ts
133
+ function cacheBustPlugin(): Plugin {
134
+ return {
135
+ name: 'cache-bust-html',
136
+ enforce: 'post',
137
+ transformIndexHtml(html) {
138
+ const timestamp = Date.now();
139
+ return html.replace(
140
+ /(src|href)="([^"]+\.(js|css))"/g,
141
+ (match, attr, url) => `${attr}="${url}?v=${timestamp}"`
142
+ );
143
+ },
144
+ };
145
+ }
146
+ ```
147
+
148
+ Without this, users see old versions after publish — especially bad for bug fix deploys.
149
+ </cache-busting>
150
+
151
+ <gotchas>
152
+ ## Publish Gotchas
153
+
154
+ ### "The app was not found using: the provided API key" — Wrong-Workspace Key
155
+
156
+ This error fires **after auth succeeds** — the key is valid but belongs to a different workspace. Root cause: `publish.cjs` resolves the key in order — `--user-api-key` flag → `HAILER_USER_API_KEY` env → `~/.env` via dotenv. Switching projects can leave a valid-but-wrong-workspace key in `~/.env`.
157
+
158
+ **Primary fix — pass the project key file directly:**
159
+
160
+ ```bash
161
+ npm run publish-production -- --env-file /absolute/path/to/project/.env --force
162
+ ```
163
+
164
+ `publish.cjs` loads `--env-file` before `~/.env`; dotenv strips surrounding double quotes itself — fleet `.env` files store `HAILER_USER_API_KEY` double-quoted, and manual extraction without stripping sends a malformed key, which fails auth with **exit 8** and "Failed to authenticate. Check that your API key is valid and has access to this app." Caveat: if `HAILER_USER_API_KEY` is already exported in the shell, dotenv won't replace it — unset it first, or use `--user-api-key <key>` explicitly.
165
+
166
+ ### SvelteKit Manifest Path
167
+
168
+ The CLI publish hardcodes `public/manifest.json`. SvelteKit apps use `static/manifest.json` — the CLI silently rejects them.
169
+
170
+ ### `manage_app update` Requires `name` Even for URL-Only Changes
171
+
172
+ `manage_app({ action: 'update', appId, url })` without `name` fails loudly: `code 191, "\"[1].name\" is required"`.
173
+
174
+ ### `manage_app update` Config Shape
175
+
176
+ The canonical shape the platform writes (and readers expect) is nested:
177
+
178
+ ```javascript
179
+ manage_app({
180
+ action: 'update', appId, name, url,
181
+ config: { fields: { myKey: { value: "...", type: "string" } } }
182
+ })
183
+ ```
184
+
185
+ A flat `{ key: "value" }` config is accepted but readers looking for `config.fields.<key>.value` see nothing.
186
+
187
+ ### Sibling App Lint Failure Blocks Publish
188
+
189
+ The lint gate runs across **all** apps before uploading. A broken lint script in a sibling app blocks publishing an unrelated app.
190
+
191
+ ### Hailer Caches Published Bundles Aggressively
192
+
193
+ After publishing, hard refresh is often not enough. DevTools → Application → Clear storage → reload, then verify via the Network tab that the bundle response contains the new version string.
194
+
195
+ ### Directory URL Returns 403 — Not a Publish Failure
196
+
197
+ `https://apps.hailer.com/<wsId>/<appId>/` returns 403 for the bare directory URL even for correctly published apps. `…/index.html` returns 200 and loads correctly. Inside the Hailer iframe this is never seen.
198
+ </gotchas>
199
+
200
+ <checklist>
201
+ ## Pre-Publish Checklist
202
+
203
+ - [ ] manifest.json `appId` is 24 chars (not the placeholder — if placeholder, use `--create`)
204
+ - [ ] manifest.json `version` is bumped from previous
205
+ - [ ] manifest.json `versionDescription` describes what changed
206
+ - [ ] vite.config.ts has `base: './'`
207
+ - [ ] vite.config.ts has cache-bust plugin (see cache-busting section)
208
+ - [ ] node_modules exists (dependencies installed)
209
+ - [ ] `@hailer/app-sdk` is on latest version (`npm view @hailer/app-sdk version`)
210
+ - [ ] After publish: `manage_app update` called to switch URL to production format
211
+ </checklist>