@hailer/mcp 1.2.0 → 1.2.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-and-publish-app
|
|
3
3
|
description: How to scaffold, create and publish Hailer apps using @hailer/create-app npm package (CLI-based alternative to scaffold_hailer_app MCP tool)
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
triggers:
|
|
6
6
|
- create-app
|
|
7
7
|
- npx create-app
|
|
@@ -25,6 +25,8 @@ Scaffold, create and publish Hailer apps using `@hailer/create-app` npm package.
|
|
|
25
25
|
| `scaffold_hailer_app` MCP tool | MCP-based scaffolding, `publish_hailer_app` MCP tool for publishing |
|
|
26
26
|
|
|
27
27
|
Both create valid Hailer apps. This skill covers the npm CLI path.
|
|
28
|
+
|
|
29
|
+
**IMPORTANT: The `scaffold_hailer_app` MCP tool uses `/bin/sh` internally. In Hailer Studio (cluster environment), `/bin/sh` is not at the standard path and the MCP tool will fail with `spawnSync /bin/sh ENOENT`. Always use `npx @hailer/create-app` in Hailer Studio.**
|
|
28
30
|
</when-to-use>
|
|
29
31
|
|
|
30
32
|
<step-1>
|
|
@@ -34,9 +36,10 @@ Both create valid Hailer apps. This skill covers the npm CLI path.
|
|
|
34
36
|
npx @hailer/create-app <project-name> --template react-ts
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
- Run from
|
|
39
|
+
- Run from a parent directory (e.g. project root or an `apps/` subfolder — create it first if needed: `mkdir -p apps`)
|
|
38
40
|
- `react-ts` is the recommended template
|
|
39
41
|
- **CRITICAL:** The CLI is interactive-only when called via `npm create` — always use `npx @hailer/create-app` with the name and template as arguments to avoid prompts
|
|
42
|
+
- **Hailer Studio only:** Do NOT use `scaffold_hailer_app` MCP tool — it fails with `spawnSync /bin/sh ENOENT` in the cluster environment
|
|
40
43
|
</step-1>
|
|
41
44
|
|
|
42
45
|
<step-2>
|
|
@@ -61,67 +64,141 @@ Replace `src/App.tsx` and add components. Key patterns:
|
|
|
61
64
|
</step-3>
|
|
62
65
|
|
|
63
66
|
<step-4>
|
|
64
|
-
## Step 4 —
|
|
67
|
+
## Step 4 — Publish Dev Version
|
|
68
|
+
|
|
69
|
+
**Do NOT publish as production yet WHEN IN HAILER STUDIO.** Publish the app under the name `<App Name> - Dev` so it can be tested inside Hailer. This is the dev iteration loop — build, publish as Dev, test, fix, repeat.
|
|
70
|
+
|
|
71
|
+
### Hailer Studio (cluster)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm run publish-production -- --host http://hailer-api:1337 --create --app-name "<App Name> - Dev" --workspace <workspaceId> --force
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
After the first publish, `public/manifest.json` is updated with the dev app's `appId`. Subsequent dev publishes just need `--force` — no `--create` or `--app-name` needed.
|
|
78
|
+
|
|
79
|
+
Then share it with the workspace:
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
add_app_member({ appId: "<devAppId>", member: "network_<workspaceId>" })
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Why not localhost:3000?** In Hailer Studio the sandbox is not reachable from outside — `localhost:3000` is inaccessible to the user. Publishing is the only way to test the app inside Hailer.
|
|
86
|
+
|
|
87
|
+
**Only proceed to Step 5 when the user explicitly says they are happy and want to publish to production.**
|
|
88
|
+
</step-4>
|
|
89
|
+
|
|
90
|
+
<step-5>
|
|
91
|
+
## Step 5 — Publish to Production (Only When User Explicitly Asks)
|
|
92
|
+
|
|
93
|
+
When the user confirms they are happy with the dev version and explicitly asks to publish:
|
|
94
|
+
|
|
95
|
+
Update `public/manifest.json` — clear the `appId` (or use a different one) so `--create` makes a new separate production app entry. Then:
|
|
96
|
+
|
|
97
|
+
### On a developer's local machine (can reach api.hailer.com)
|
|
65
98
|
|
|
66
99
|
```bash
|
|
67
100
|
npm run publish-production -- --create --app-name "<App Name>" --workspace <workspaceId> --force
|
|
68
101
|
```
|
|
69
102
|
|
|
103
|
+
### In Hailer Studio (cluster environment — cannot reach api.hailer.com)
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm run publish-production -- --host http://hailer-api:1337 --create --app-name "<App Name>" --workspace <workspaceId> --force
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The `--host` flag overrides the hardcoded `https://api.hailer.com` default. Credentials are picked up automatically from `~/.env`.
|
|
110
|
+
|
|
70
111
|
| Flag | Purpose |
|
|
71
112
|
|------|---------|
|
|
72
113
|
| `--create` | Creates a brand new app entry in Hailer |
|
|
73
114
|
| `--app-name` | Name shown in Hailer |
|
|
74
115
|
| `--workspace` | Workspace ID from `config.json` at project root |
|
|
75
116
|
| `--force` | Skips confirmation prompt |
|
|
117
|
+
| `--host` | API URL — required in cluster environments |
|
|
118
|
+
| `--user-api-key` | API key — read from `~/.env` if not provided as flag |
|
|
76
119
|
|
|
77
|
-
**
|
|
120
|
+
**Credential resolution order:**
|
|
78
121
|
1. `--user-api-key` or `--email` flags
|
|
79
122
|
2. `USER_API_KEY` or `HAILER_USER_API_KEY` environment variables
|
|
80
|
-
3. `HAILER_USER_API_KEY` from `~/.env` ←
|
|
123
|
+
3. `HAILER_USER_API_KEY` from `~/.env` ← auto-injected by Hailer Studio
|
|
81
124
|
|
|
82
125
|
After running, `public/manifest.json` is auto-updated with the new `appId`.
|
|
83
|
-
</step-4>
|
|
84
126
|
|
|
85
|
-
|
|
86
|
-
|
|
127
|
+
### After publishing — share with workspace
|
|
128
|
+
|
|
129
|
+
The CLI publish does NOT auto-share. Share manually via MCP:
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
add_app_member({ appId: "<appId>", member: "network_<workspaceId>" })
|
|
133
|
+
```
|
|
134
|
+
</step-5>
|
|
135
|
+
|
|
136
|
+
<step-6>
|
|
137
|
+
## Step 6 — Subsequent Publishes
|
|
138
|
+
|
|
139
|
+
### Local machine
|
|
87
140
|
|
|
88
141
|
```bash
|
|
89
142
|
npm run publish-production -- --force
|
|
90
143
|
```
|
|
91
144
|
|
|
92
|
-
|
|
93
|
-
|
|
145
|
+
### Hailer Studio (cluster)
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
npm run publish-production -- --host http://hailer-api:1337 --force
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The `appId` in `manifest.json` determines which app gets updated.
|
|
152
|
+
</step-6>
|
|
94
153
|
|
|
95
154
|
<dev-vs-prod>
|
|
96
155
|
## Dev vs Production Strategy
|
|
97
156
|
|
|
98
|
-
|
|
157
|
+
Always maintain two separate published app entries in Hailer:
|
|
99
158
|
|
|
100
|
-
| App | Purpose |
|
|
101
|
-
|
|
102
|
-
| My App Dev | Publish here during
|
|
103
|
-
| My App | Publish here only when
|
|
159
|
+
| App | Name convention | Purpose |
|
|
160
|
+
|-----|----------------|---------|
|
|
161
|
+
| Dev | `My App - Dev` | Publish here repeatedly during development and testing |
|
|
162
|
+
| Production | `My App` | Publish here only when user confirms they are happy |
|
|
104
163
|
|
|
105
|
-
|
|
164
|
+
**In Hailer Studio, `localhost:3000` is not accessible to the user — publishing is the only way to test inside Hailer. This means the dev app gets published and re-published on every iteration.**
|
|
165
|
+
|
|
166
|
+
To switch between dev and production app entries, keep track of both `appId` values. Before publishing production, set `appId` in `public/manifest.json` to the production app's ID (or use `--create` to make a new one).
|
|
106
167
|
</dev-vs-prod>
|
|
107
168
|
|
|
108
169
|
<environments>
|
|
109
170
|
## Environments
|
|
110
171
|
|
|
111
|
-
| Command |
|
|
112
|
-
|
|
113
|
-
| `npm run publish-production` |
|
|
114
|
-
| `npm run publish-development` |
|
|
115
|
-
| `npm run publish-staging` |
|
|
172
|
+
| Command | Default target |
|
|
173
|
+
|---------|---------------|
|
|
174
|
+
| `npm run publish-production` | https://api.hailer.com |
|
|
175
|
+
| `npm run publish-development` | https://testapi.hailer.biz |
|
|
176
|
+
| `npm run publish-staging` | https://api.hailer.biz |
|
|
177
|
+
|
|
178
|
+
**In Hailer Studio**, append `-- --host http://hailer-api:1337` to any of the above to override the default host:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npm run publish-production -- --host http://hailer-api:1337 --force
|
|
182
|
+
```
|
|
116
183
|
</environments>
|
|
117
184
|
|
|
118
185
|
<checklist>
|
|
119
|
-
## Checklist
|
|
186
|
+
## Dev App Checklist (Step 4 — do this first)
|
|
187
|
+
|
|
188
|
+
- [ ] Published as `<App Name> - Dev` using `--create --app-name "<App Name> - Dev"`
|
|
189
|
+
- [ ] Shared dev app with workspace via MCP `add_app_member`
|
|
190
|
+
- [ ] App opens and works correctly inside Hailer
|
|
191
|
+
- [ ] Iterate: fix → `npm run publish-production -- --host ... --force` → test in Hailer → repeat
|
|
192
|
+
|
|
193
|
+
## Production Publish Checklist (Step 5 — only when user asks to publish)
|
|
120
194
|
|
|
121
|
-
- [ ]
|
|
195
|
+
- [ ] User has explicitly requested publishing/deploying
|
|
196
|
+
- [ ] Read `<project-name>/README.md` — it always has the latest commands for that version
|
|
122
197
|
- [ ] Verify `public/manifest.json` has the correct `appId` for the target app
|
|
123
198
|
- [ ] `version` and `versionDescription` in manifest are only required for marketplace publishes
|
|
124
199
|
- [ ] Build runs automatically as part of the publish script — no separate build step needed
|
|
125
200
|
- [ ] Workspace ID is in `config.json` at the project root
|
|
126
|
-
- [ ]
|
|
201
|
+
- [ ] Fixed `StoreSet` type error in `src/hailer/use-app.ts` (`replace?: false` not `boolean`)
|
|
202
|
+
- [ ] **Hailer Studio:** Append `-- --host http://hailer-api:1337` to `npm run publish-*`
|
|
203
|
+
- [ ] **After first publish:** Manually share via MCP `add_app_member` — CLI does not auto-share
|
|
127
204
|
</checklist>
|