@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.
- package/.claude/skills/create-and-publish-app/SKILL.md +44 -56
- package/.claude/skills/hailer-app-builder/SKILL.md +414 -970
- package/.claude/skills/hailer-app-primitives/SKILL.md +742 -0
- package/.claude/skills/hailer-apps-pictures/SKILL.md +191 -87
- package/.claude/skills/hailer-design-patterns/SKILL.md +317 -0
- package/.claude/skills/hailer-design-system/SKILL.md +202 -149
- package/.claude/skills/hailer-workflow-archetypes/SKILL.md +301 -0
- package/.claude/skills/insight-join-patterns/SKILL.md +313 -0
- package/.claude/skills/publish-hailer-app/SKILL.md +211 -0
- package/.claude/skills/sdk-activity-patterns/SKILL.md +257 -105
- package/.claude/skills/sdk-function-fields/SKILL.md +253 -492
- package/.claude/skills/sdk-insight-calculations/SKILL.md +364 -0
- package/.claude/skills/sdk-insight-queries/SKILL.md +192 -397
- package/.claude/skills/sdk-ws-config-skill/SKILL.md +265 -720
- package/.claude/skills/tool-response-verification/SKILL.md +143 -0
- package/CLAUDE.md +50 -19
- package/dist/bot/bot.d.ts.map +1 -1
- package/dist/bot/bot.js +26 -34
- package/dist/bot/bot.js.map +1 -1
- package/dist/bot/services/helper-prompt.d.ts +1 -1
- package/dist/bot/services/helper-prompt.d.ts.map +1 -1
- package/dist/bot/services/helper-prompt.js +62 -82
- package/dist/bot/services/helper-prompt.js.map +1 -1
- package/dist/bot/services/system-prompt.js +4 -4
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -1
- package/dist/mcp/hailer-rpc.d.ts +1 -0
- package/dist/mcp/hailer-rpc.d.ts.map +1 -1
- package/dist/mcp/hailer-rpc.js +4 -0
- package/dist/mcp/hailer-rpc.js.map +1 -1
- package/dist/mcp/tools/activity.d.ts.map +1 -1
- package/dist/mcp/tools/activity.js +8 -2
- package/dist/mcp/tools/activity.js.map +1 -1
- package/dist/mcp/tools/app-core.d.ts.map +1 -1
- package/dist/mcp/tools/app-core.js +6 -3
- package/dist/mcp/tools/app-core.js.map +1 -1
- package/dist/mcp/tools/app-marketplace.d.ts.map +1 -1
- package/dist/mcp/tools/app-marketplace.js +5 -1
- package/dist/mcp/tools/app-marketplace.js.map +1 -1
- package/dist/mcp/webhook-handler.d.ts.map +1 -1
- package/dist/mcp/webhook-handler.js +27 -0
- package/dist/mcp/webhook-handler.js.map +1 -1
- package/dist/public-chat/graduate.d.ts.map +1 -1
- package/dist/public-chat/graduate.js +153 -53
- package/dist/public-chat/graduate.js.map +1 -1
- package/dist/public-chat/rate-limit.js +1 -1
- package/dist/public-chat/rate-limit.js.map +1 -1
- package/dist/public-chat/studio-prewarm.js +2 -2
- package/dist/public-chat/studio-prewarm.js.map +1 -1
- package/dist/public-chat/system-prompt.d.ts.map +1 -1
- package/dist/public-chat/system-prompt.js +41 -25
- package/dist/public-chat/system-prompt.js.map +1 -1
- package/package.json +1 -1
- package/.claude/skills/hailer-project-protocol/SKILL.md +0 -398
- package/.opencode/package-lock.json +0 -117
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-and-publish-app
|
|
3
|
-
description: Scaffold, develop, and publish Hailer apps with @hailer/create-app — dev iteration,
|
|
4
|
-
version: 2.
|
|
3
|
+
description: Scaffold, develop, and publish Hailer apps with @hailer/create-app — load when scaffolding a new app, setting up dev iteration, publishing to production, or troubleshooting publish failures
|
|
4
|
+
version: 2.5.0
|
|
5
5
|
triggers:
|
|
6
6
|
- create-app
|
|
7
7
|
- npx create-app
|
|
@@ -31,14 +31,14 @@ npx @hailer/create-app <project-name> --template react-ts
|
|
|
31
31
|
npx hailer-mcp prep-app <project-name>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
**Run `npx hailer-mcp prep-app <project-name>` immediately after scaffolding — it neutralizes the scaffold papercuts
|
|
34
|
+
**Run `npx hailer-mcp prep-app <project-name>` immediately after scaffolding** — it neutralizes the scaffold's built-in papercuts: clears the placeholder `appId` (`65143728…`) and fake "Magic Apps Ltd." author from `public/manifest.json`, fixes the `StoreSet` tsc error in `src/hailer/use-app.ts`, writes a `.npmrc` with `include=dev` (so `npm install` pulls build deps even under `NODE_ENV=production`), and wires the `publish-*` scripts with `--env-file ../../.env` (per-project publish auth). Idempotent and safe to re-run. After prep-app, run `npm install --include=dev` once more to pull any devDeps that first install skipped.
|
|
35
35
|
|
|
36
36
|
**This exact form is non-interactive — it runs with zero prompts. Do NOT deviate:**
|
|
37
|
-
- **`<project-name>` is a POSITIONAL argument, not a flag.** `--name <x>` is silently ignored and the CLI drops to an interactive "Project name:" prompt that hangs
|
|
38
|
-
- **`--template`
|
|
39
|
-
- **Use a fresh, lowercase, kebab-case name** in an empty target dir — that skips the overwrite prompt AND the package-name prompt.
|
|
40
|
-
- Never run `npx @hailer/create-app` bare and never pipe input to it
|
|
41
|
-
- Run from a parent directory (`mkdir -p apps` first if needed), NEVER copy an existing app, then `cd <project-name> && npm install --include=dev
|
|
37
|
+
- **`<project-name>` is a POSITIONAL argument, not a flag.** `--name <x>` is silently ignored and the CLI drops to an interactive "Project name:" prompt that hangs. Put the name first, bare.
|
|
38
|
+
- **`--template react-ts` is the ONLY valid value** (`TEMPLATES = ['react-ts']`; all other frameworks are commented out). Any other name — `react`, `vanilla-ts`, `svelte`, `minimal` — drops to a "Select a framework" prompt that hangs.
|
|
39
|
+
- **Use a fresh, lowercase, kebab-case name** in an empty target dir — that skips the overwrite prompt AND the package-name prompt.
|
|
40
|
+
- Never run `npx @hailer/create-app` bare and never pipe input to it.
|
|
41
|
+
- Run from a parent directory (`mkdir -p apps` first if needed), NEVER copy an existing app, then `cd <project-name> && npm install --include=dev`.
|
|
42
42
|
</scaffold>
|
|
43
43
|
|
|
44
44
|
<build>
|
|
@@ -53,8 +53,8 @@ Replace `src/App.tsx` and add components (load `hailer-app-builder` + `hailer-de
|
|
|
53
53
|
- Apps must render outside Hailer too — empty state, never an error
|
|
54
54
|
|
|
55
55
|
**Two scaffold facts that save a rabbit hole every build:**
|
|
56
|
-
1. **The scaffold ships with ONE known `tsc` error** — `src/hailer/use-app.ts` types `StoreSet` `replace?: boolean`; it must be `replace?: false`. Fix that one line
|
|
57
|
-
2. **Verify with `npm run build-production`, NOT `tsc` / `npm run build`.** `build-production` is vite-only — it's the exact command the publish runs. `npm run build` and `npx tsc --noEmit` run `tsc`, which trips on the scaffold error above
|
|
56
|
+
1. **The scaffold ships with ONE known `tsc` error** — `src/hailer/use-app.ts` types `StoreSet` `replace?: boolean`; it must be `replace?: false`. Fix that one line first and tsc is clean.
|
|
57
|
+
2. **Verify with `npm run build-production`, NOT `tsc` / `npm run build`.** `build-production` is vite-only — it's the exact command the publish runs. `npm run build` and `npx tsc --noEmit` run `tsc`, which trips on the scaffold error above.
|
|
58
58
|
</build>
|
|
59
59
|
|
|
60
60
|
<dev-publish>
|
|
@@ -79,25 +79,22 @@ After the first publish `public/manifest.json` holds the dev `appId`; later iter
|
|
|
79
79
|
<credentials>
|
|
80
80
|
## Credentials — Read This Before Publishing Fails
|
|
81
81
|
|
|
82
|
-
The publish CLI (`@hailer/app-sdk`'s `publish.cjs`, wrapped as `npm run publish-*`)
|
|
82
|
+
The publish CLI (`@hailer/app-sdk`'s `publish.cjs`, wrapped as `npm run publish-*`) picks the API key as **`--user-api-key` flag → `USER_API_KEY` env → `HAILER_USER_API_KEY` env**. Those env vars are populated by dotenv from `--env-file` (loaded first) then `~/.env`; dotenv never overrides an already-set var, so a real env var wins, and `--env-file` wins over `~/.env`. (`--email` triggers interactive password auth instead — avoid it in agents.)
|
|
83
83
|
|
|
84
84
|
- **Hailer Studio:** `~/.env` is auto-injected — publishing just works, no flags.
|
|
85
|
-
- **Local machines:**
|
|
86
|
-
-
|
|
87
|
-
- **
|
|
88
|
-
- **If publishing still hits exit code 10** (no auth — the CLI prints usage and quits): the local server hasn't run yet, or injection was disabled. Start `npx hailer-mcp` once, OR ask the user for a Hailer user API key (Hailer → profile → API keys) and pass `-- --user-api-key <key>`. **Never read passwords from .env, never log in via curl, never probe API endpoints for keys.**
|
|
85
|
+
- **Local machines:** `npx hailer-mcp` self-provisions on first boot — it mints a user API key from the project bot's credentials and writes `HAILER_USER_API_KEY` to the project-root `.env`. `prep-app` wires each app's `publish-*` script with `--env-file ../../.env`, so every project publishes to its own workspace. Once the local server has run once, publishing needs no auth flags.
|
|
86
|
+
- **ALWAYS pass `-- --force`.** Without it the publish stops at an interactive `Overwrite the app? (Y/n)` prompt — which hangs indefinitely. `npm run publish-production -- --force` appends `--force` correctly; no manual `npm pack` step is needed.
|
|
87
|
+
- **If publishing hits exit code 10** (no auth): start `npx hailer-mcp` once, OR ask the user for a Hailer user API key (Hailer → profile → API keys) and pass `-- --user-api-key <key>`.
|
|
89
88
|
|
|
90
|
-
Other exit codes: 8 = login failed (bad key/credentials), 7 = bundle isn't a .tgz (build problem),
|
|
89
|
+
Other exit codes: 8 = login failed (bad key/credentials), 9 = upload/HTTP error, 7 = bundle isn't a .tgz (build problem), 2 = appId not found in this workspace, 6 = bad publish response. With `--create`: 11 = missing `--app-name`, 12 = missing `--workspace`, 13 = app-creation API call failed. 10 also fires on `--market` without `version`/`versionDescription` in the manifest.
|
|
91
90
|
</credentials>
|
|
92
91
|
|
|
93
92
|
<validate>
|
|
94
93
|
## Step 4 — Validate BEFORE Any Production Publish
|
|
95
94
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
2. `appId` exists, 24 chars — required for any non-`--create` publish (auto-written by `--create`)
|
|
100
|
-
3. `version` + `versionDescription` non-empty — strictly required for `--market` publishes (the CLI errors loudly without them); keep them set always, `versionDescription` doubles as the app description
|
|
95
|
+
1. Read `public/manifest.json` (the source of truth; the publish actually reads the appId from the built `dist/manifest.json`, so edits to `public/` need a rebuild — `build-production` runs as part of `publish-*` — to take effect)
|
|
96
|
+
2. `appId` exists, 24 chars — required for any non-`--create` publish
|
|
97
|
+
3. `version` + `versionDescription` non-empty — strictly required for `--market` publishes
|
|
101
98
|
4. `vite.config.ts` has `base: './'` — without it assets resolve to the root domain and production 403/404s while localhost works
|
|
102
99
|
5. `index.html` has no-cache meta tags (apps.hailer.com is static hosting; server headers aren't controllable):
|
|
103
100
|
|
|
@@ -106,66 +103,56 @@ Check before publishing:
|
|
|
106
103
|
<meta http-equiv="Pragma" content="no-cache" />
|
|
107
104
|
<meta http-equiv="Expires" content="0" />
|
|
108
105
|
```
|
|
109
|
-
|
|
110
|
-
If a publish reports success but the app still serves the old/localhost version, re-check 2–5 — historical silent failures trace back to these.
|
|
111
106
|
</validate>
|
|
112
107
|
|
|
113
108
|
<prod-publish>
|
|
114
109
|
## Step 5 — Production Publish (only when the user explicitly asks)
|
|
115
110
|
|
|
116
|
-
**
|
|
111
|
+
**FIRST, decide first-publish vs update by READING `public/manifest.json` — never guess, never fail-first.**
|
|
117
112
|
|
|
118
|
-
|
|
113
|
+
The scaffold ships a placeholder `appId` of `65143728d2bd678b13daf289` (the "Magic Apps" demo). That value, or empty/missing, means this app has never been published:
|
|
119
114
|
|
|
120
115
|
| manifest `appId` | This is a… | Command |
|
|
121
116
|
|---|---|---|
|
|
122
|
-
| `65143728d2bd678b13daf289`, `""`, or missing | **FIRST publish** | `--create --app-name "<Name>" --workspace <wsId> --force`
|
|
117
|
+
| `65143728d2bd678b13daf289`, `""`, or missing | **FIRST publish** | `--create --app-name "<Name>" --workspace <wsId> --force` |
|
|
123
118
|
| a real 24-char id you created earlier | **update** | `--force` only |
|
|
124
119
|
|
|
125
|
-
A plain publish against the scaffold's placeholder appId silently uploads to the demo app (wrong) or errors — so on a fresh scaffold, ALWAYS take the `--create` path on the very first publish. Get `<wsId>` from `config.json` (`workspaceId`); derive `<Name>` from the project (e.g. "Upcoming Matches") or ask.
|
|
126
|
-
|
|
127
120
|
```bash
|
|
128
121
|
# FIRST publish (fresh scaffold) — local machine
|
|
129
122
|
npm run publish-production -- --create --app-name "<App Name>" --workspace <workspaceId> --force
|
|
130
123
|
|
|
131
|
-
# FIRST publish — Hailer Studio
|
|
124
|
+
# FIRST publish — Hailer Studio
|
|
132
125
|
npm run publish-production -- --host https://api.hailer.com --create --app-name "<App Name>" --workspace <workspaceId> --force
|
|
133
126
|
|
|
134
127
|
# UPDATE (manifest already has a real appId)
|
|
135
128
|
npm run publish-production -- --force
|
|
136
129
|
```
|
|
137
130
|
|
|
138
|
-
**PUBLISH FAILURE PLAYBOOK
|
|
131
|
+
**PUBLISH FAILURE PLAYBOOK:**
|
|
139
132
|
| Failure | Meaning | Action |
|
|
140
133
|
|---|---|---|
|
|
141
|
-
| exit 10, usage printed | no auth | start `npx hailer-mcp` once
|
|
142
|
-
| exit 2, "app was not found using
|
|
143
|
-
| exit 8 | login failed |
|
|
134
|
+
| exit 10, usage printed | no auth | start `npx hailer-mcp` once, or pass `-- --user-api-key <key>` |
|
|
135
|
+
| exit 2, "app was not found using…" | manifest appId doesn't belong to this workspace | re-run with `--create --app-name "<Name>" --workspace <wsId> --force` (all three required) |
|
|
136
|
+
| exit 8 | login failed | bad key — re-mint or ask the user |
|
|
144
137
|
| hangs at "Overwrite the app? (Y/n)" | missing `--force` | always pass it |
|
|
145
138
|
|
|
146
|
-
**Manifest hand-edit rules:** never invent or copy an `appId` (only `--create` or a previous publish writes it); never delete `version`/`versionDescription` (versionDescription doubles as the app description, both are required for `--market`); do fix the placeholder `author` ("Magic Apps Ltd.") to the real one. apps.ts is for SHARING an app that already exists — after publish, `npm run pull` brings the entry in; edit members there.
|
|
147
|
-
|
|
148
139
|
**FIRST-PUBLISH GOTCHA — the `--create` bundle embeds a stale manifest. Do these two things:**
|
|
149
|
-
1.
|
|
150
|
-
2.
|
|
151
|
-
|
|
152
|
-
**What the CLI itself does** (`@hailer/app-sdk` publish.cjs): `--create` makes the app entry (`v3.app.create`) and writes the `appId` to the manifest; the bundle is packed (`package/` prefix) and POSTed to `/app/publish`; the server hosts it at `https://apps.hailer.com/{workspaceId}/{appId}/`.
|
|
140
|
+
1. Before publishing, fix `public/manifest.json` placeholder `author` and `description`.
|
|
141
|
+
2. After the `--create` publish, republish once (`npm run publish-production -- --force`). Reason: the script packs the tarball *before* `--create` learns the new `appId`, so the first uploaded bundle has the placeholder `appId` baked in. The second publish embeds the correct one.
|
|
153
142
|
|
|
154
|
-
**What the CLI does NOT do:** icon, name/description updates, workspace sharing.
|
|
143
|
+
**What the CLI does NOT do:** icon, name/description updates, workspace sharing. After publishing: share with `manage_app({ action: 'add_member', appId, member: 'network_<wsId>' })`, set icon with `manage_app({ action: 'update', appId, image: <fileId> })` (icon files MUST be uploaded `isPublic: true`, PNG/JPEG only).
|
|
155
144
|
|
|
156
145
|
| Flag | Purpose |
|
|
157
146
|
|------|---------|
|
|
158
|
-
| `--create` | New app entry (
|
|
159
|
-
| `--app-name` | Name shown in Hailer
|
|
160
|
-
| `--workspace` | Workspace ID (`config.json` at project root
|
|
161
|
-
| `--market` | Also publish
|
|
147
|
+
| `--create` | New app entry (requires `--app-name` AND `--workspace`) |
|
|
148
|
+
| `--app-name` | Name shown in Hailer |
|
|
149
|
+
| `--workspace` | Workspace ID (from `config.json` at project root) |
|
|
150
|
+
| `--market` | Also publish to the marketplace (requires `version` + `versionDescription`) |
|
|
162
151
|
| `--force` | Skip confirmation prompt |
|
|
163
|
-
| `--host` | API URL override — required in cluster environments |
|
|
164
|
-
| `--
|
|
165
|
-
| `--
|
|
166
|
-
| `--production` / `--development` / `--staging`
|
|
167
|
-
|
|
168
|
-
**Subsequent publishes:** just `npm run publish-production -- --force` (+ `--host` in Studio) — the manifest `appId` picks the target. Bump `version`/`versionDescription` per release.
|
|
152
|
+
| `--host` | API URL override — required in Studio / cluster environments |
|
|
153
|
+
| `--env-file <path>` | Load an env file before `~/.env` (wins on conflicts) |
|
|
154
|
+
| `--user-api-key` | Explicit auth key |
|
|
155
|
+
| `--production` / `--development` / `--staging` | Environment preset |
|
|
169
156
|
|
|
170
157
|
**Environments:** `publish-production` → api.hailer.com, `publish-development` → testapi.hailer.biz, `publish-staging` → api.hailer.biz.
|
|
171
158
|
|
|
@@ -176,23 +163,24 @@ npm run publish-production -- --force
|
|
|
176
163
|
## Marketplace Publishing
|
|
177
164
|
|
|
178
165
|
Two different things:
|
|
179
|
-
1. **App version publish** (`npm run publish-production -- --market --force`) — uploads files AND registers the version on the marketplace.
|
|
166
|
+
1. **App version publish** (`npm run publish-production -- --market --force`) — uploads files AND registers the version on the marketplace. The server returns a `targetId`, auto-saved to `public/manifest.json`.
|
|
180
167
|
2. **Marketplace listing** (MCP `publish_marketplace` with `type: 'app'`) — title, description, icon, images on the listing. Does NOT upload app files.
|
|
181
168
|
|
|
182
|
-
First-time: publish with `--market` (get `targetId`) → `publish_marketplace({ type: 'app', appId, versionId: <targetId>, title, ... })` → note the returned `productId`.
|
|
169
|
+
First-time: publish with `--market` (get `targetId`) → `publish_marketplace({ type: 'app', appId, versionId: <targetId>, title, ... })` → note the returned `productId`.
|
|
183
170
|
|
|
184
171
|
| ID | What | Where |
|
|
185
172
|
|----|------|-------|
|
|
186
173
|
| `appId` | The app itself | manifest.json |
|
|
187
174
|
| `targetId` | Version entry for marketplace | manifest.json (auto-saved) |
|
|
188
|
-
| `productId` | Marketplace listing | returned by first `publish_marketplace
|
|
175
|
+
| `productId` | Marketplace listing | returned by first `publish_marketplace` |
|
|
189
176
|
</marketplace>
|
|
190
177
|
|
|
191
178
|
<gotchas>
|
|
192
179
|
## Gotchas
|
|
193
180
|
|
|
194
|
-
- **Icons must be uploaded `isPublic: true`** — private files render as broken/transparent images.
|
|
195
|
-
- **No SVG icons** — the backend image pipeline (sharp) doesn't serve them; use PNG/JPEG.
|
|
181
|
+
- **Icons must be uploaded `isPublic: true`** — private files render as broken/transparent images.
|
|
182
|
+
- **No SVG icons** — the backend image pipeline (sharp) doesn't serve them; use PNG/JPEG.
|
|
196
183
|
- **`StoreSet` type error** in scaffolded `src/hailer/use-app.ts`: `replace?: false`, not `boolean`.
|
|
197
|
-
-
|
|
184
|
+
- **Wrong-workspace key:** "The app was not found using: the provided API key" fires after auth succeeds — the key belongs to a different workspace. Primary fix: `npm run publish-production -- --env-file /absolute/path/to/project/.env --force`. `dotenv` loads `--env-file` before `~/.env` and strips surrounding double quotes itself.
|
|
185
|
+
- **`@hailer/app-sdk` v1.0.3 publish bug:** v1's `publish.cjs` ignores `--user-api-key`, requires interactive password. Bump to `^2.5.0` + `npm install` to resolve.
|
|
198
186
|
</gotchas>
|