@hailer/mcp 0.0.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.
- package/.claude/commands/tool-builder.md +37 -0
- package/.claude/commands/ws-pull.md +44 -0
- package/.claude/settings.json +8 -0
- package/.claude/settings.local.json +49 -0
- package/.claude/skills/activity-api/SKILL.md +96 -0
- package/.claude/skills/activity-api/references/activity-endpoints.md +845 -0
- package/.claude/skills/add-app-member-skill/SKILL.md +977 -0
- package/.claude/skills/agent-building/SKILL.md +243 -0
- package/.claude/skills/agent-building/references/architecture-patterns.md +446 -0
- package/.claude/skills/agent-building/references/code-examples.md +587 -0
- package/.claude/skills/agent-building/references/implementation-guide.md +619 -0
- package/.claude/skills/app-api/SKILL.md +219 -0
- package/.claude/skills/app-api/references/app-endpoints.md +759 -0
- package/.claude/skills/building-hailer-apps-skill/SKILL.md +548 -0
- package/.claude/skills/create-app-skill/SKILL.md +1101 -0
- package/.claude/skills/create-insight-skill/SKILL.md +1317 -0
- package/.claude/skills/get-insight-data-skill/SKILL.md +1053 -0
- package/.claude/skills/hailer-api/SKILL.md +283 -0
- package/.claude/skills/hailer-api/references/activities.md +620 -0
- package/.claude/skills/hailer-api/references/authentication.md +216 -0
- package/.claude/skills/hailer-api/references/datasets.md +437 -0
- package/.claude/skills/hailer-api/references/files.md +301 -0
- package/.claude/skills/hailer-api/references/insights.md +469 -0
- package/.claude/skills/hailer-api/references/workflows.md +720 -0
- package/.claude/skills/hailer-api/references/workspaces-users.md +445 -0
- package/.claude/skills/insight-api/SKILL.md +185 -0
- package/.claude/skills/insight-api/references/insight-endpoints.md +514 -0
- package/.claude/skills/install-workflow-skill/SKILL.md +1056 -0
- package/.claude/skills/list-apps-skill/SKILL.md +1010 -0
- package/.claude/skills/list-workflows-minimal-skill/SKILL.md +992 -0
- package/.claude/skills/local-first-skill/SKILL.md +570 -0
- package/.claude/skills/mcp-tools/SKILL.md +419 -0
- package/.claude/skills/mcp-tools/references/api-endpoints.md +499 -0
- package/.claude/skills/mcp-tools/references/data-structures.md +554 -0
- package/.claude/skills/mcp-tools/references/implementation-patterns.md +717 -0
- package/.claude/skills/preview-insight-skill/SKILL.md +1290 -0
- package/.claude/skills/publish-hailer-app-skill/SKILL.md +453 -0
- package/.claude/skills/remove-app-member-skill/SKILL.md +671 -0
- package/.claude/skills/remove-app-skill/SKILL.md +985 -0
- package/.claude/skills/remove-insight-skill/SKILL.md +1011 -0
- package/.claude/skills/remove-workflow-skill/SKILL.md +920 -0
- package/.claude/skills/scaffold-hailer-app-skill/SKILL.md +1034 -0
- package/.claude/skills/skill-testing/README.md +137 -0
- package/.claude/skills/skill-testing/SKILL.md +348 -0
- package/.claude/skills/skill-testing/references/test-patterns.md +705 -0
- package/.claude/skills/skill-testing/references/testing-guide.md +603 -0
- package/.claude/skills/skill-testing/references/validation-checklist.md +537 -0
- package/.claude/skills/tool-builder/SKILL.md +328 -0
- package/.claude/skills/update-app-skill/SKILL.md +970 -0
- package/.claude/skills/update-workflow-field-skill/SKILL.md +1098 -0
- package/.env.example +81 -0
- package/.mcp.json +13 -0
- package/README.md +297 -0
- package/dist/app.d.ts +4 -0
- package/dist/app.js +74 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +5 -0
- package/dist/client/adaptive-documentation-bot.d.ts +108 -0
- package/dist/client/adaptive-documentation-bot.js +475 -0
- package/dist/client/adaptive-documentation-types.d.ts +66 -0
- package/dist/client/adaptive-documentation-types.js +9 -0
- package/dist/client/agent-activity-bot.d.ts +51 -0
- package/dist/client/agent-activity-bot.js +166 -0
- package/dist/client/agent-tracker.d.ts +499 -0
- package/dist/client/agent-tracker.js +659 -0
- package/dist/client/description-updater.d.ts +56 -0
- package/dist/client/description-updater.js +259 -0
- package/dist/client/log-parser.d.ts +72 -0
- package/dist/client/log-parser.js +387 -0
- package/dist/client/mcp-client.d.ts +50 -0
- package/dist/client/mcp-client.js +532 -0
- package/dist/client/message-processor.d.ts +35 -0
- package/dist/client/message-processor.js +352 -0
- package/dist/client/multi-bot-manager.d.ts +24 -0
- package/dist/client/multi-bot-manager.js +74 -0
- package/dist/client/providers/anthropic-provider.d.ts +19 -0
- package/dist/client/providers/anthropic-provider.js +631 -0
- package/dist/client/providers/llm-provider.d.ts +47 -0
- package/dist/client/providers/llm-provider.js +367 -0
- package/dist/client/providers/openai-provider.d.ts +23 -0
- package/dist/client/providers/openai-provider.js +621 -0
- package/dist/client/simple-llm-caller.d.ts +19 -0
- package/dist/client/simple-llm-caller.js +100 -0
- package/dist/client/skill-generator.d.ts +81 -0
- package/dist/client/skill-generator.js +386 -0
- package/dist/client/test-adaptive-bot.d.ts +9 -0
- package/dist/client/test-adaptive-bot.js +82 -0
- package/dist/client/token-pricing.d.ts +38 -0
- package/dist/client/token-pricing.js +127 -0
- package/dist/client/token-tracker.d.ts +232 -0
- package/dist/client/token-tracker.js +457 -0
- package/dist/client/token-usage-bot.d.ts +53 -0
- package/dist/client/token-usage-bot.js +153 -0
- package/dist/client/tool-executor.d.ts +69 -0
- package/dist/client/tool-executor.js +159 -0
- package/dist/client/tool-schema-loader.d.ts +60 -0
- package/dist/client/tool-schema-loader.js +178 -0
- package/dist/client/types.d.ts +69 -0
- package/dist/client/types.js +7 -0
- package/dist/config.d.ts +162 -0
- package/dist/config.js +296 -0
- package/dist/core.d.ts +26 -0
- package/dist/core.js +147 -0
- package/dist/lib/context-manager.d.ts +111 -0
- package/dist/lib/context-manager.js +431 -0
- package/dist/lib/logger.d.ts +74 -0
- package/dist/lib/logger.js +277 -0
- package/dist/lib/materialize.d.ts +3 -0
- package/dist/lib/materialize.js +101 -0
- package/dist/lib/normalizedName.d.ts +7 -0
- package/dist/lib/normalizedName.js +48 -0
- package/dist/lib/prompt-length-manager.d.ts +81 -0
- package/dist/lib/prompt-length-manager.js +457 -0
- package/dist/lib/terminal-prompt.d.ts +9 -0
- package/dist/lib/terminal-prompt.js +108 -0
- package/dist/mcp/UserContextCache.d.ts +56 -0
- package/dist/mcp/UserContextCache.js +163 -0
- package/dist/mcp/auth.d.ts +2 -0
- package/dist/mcp/auth.js +29 -0
- package/dist/mcp/hailer-clients.d.ts +42 -0
- package/dist/mcp/hailer-clients.js +246 -0
- package/dist/mcp/signal-handler.d.ts +45 -0
- package/dist/mcp/signal-handler.js +317 -0
- package/dist/mcp/tool-registry.d.ts +100 -0
- package/dist/mcp/tool-registry.js +306 -0
- package/dist/mcp/tools/activity.d.ts +15 -0
- package/dist/mcp/tools/activity.js +955 -0
- package/dist/mcp/tools/app.d.ts +20 -0
- package/dist/mcp/tools/app.js +1488 -0
- package/dist/mcp/tools/discussion.d.ts +19 -0
- package/dist/mcp/tools/discussion.js +950 -0
- package/dist/mcp/tools/file.d.ts +15 -0
- package/dist/mcp/tools/file.js +119 -0
- package/dist/mcp/tools/insight.d.ts +17 -0
- package/dist/mcp/tools/insight.js +806 -0
- package/dist/mcp/tools/skill.d.ts +10 -0
- package/dist/mcp/tools/skill.js +279 -0
- package/dist/mcp/tools/user.d.ts +10 -0
- package/dist/mcp/tools/user.js +108 -0
- package/dist/mcp/tools/workflow-template.d.ts +19 -0
- package/dist/mcp/tools/workflow-template.js +822 -0
- package/dist/mcp/tools/workflow.d.ts +18 -0
- package/dist/mcp/tools/workflow.js +1362 -0
- package/dist/mcp/utils/api-errors.d.ts +45 -0
- package/dist/mcp/utils/api-errors.js +160 -0
- package/dist/mcp/utils/data-transformers.d.ts +102 -0
- package/dist/mcp/utils/data-transformers.js +194 -0
- package/dist/mcp/utils/file-upload.d.ts +33 -0
- package/dist/mcp/utils/file-upload.js +148 -0
- package/dist/mcp/utils/hailer-api-client.d.ts +120 -0
- package/dist/mcp/utils/hailer-api-client.js +323 -0
- package/dist/mcp/utils/index.d.ts +13 -0
- package/dist/mcp/utils/index.js +39 -0
- package/dist/mcp/utils/logger.d.ts +42 -0
- package/dist/mcp/utils/logger.js +103 -0
- package/dist/mcp/utils/types.d.ts +286 -0
- package/dist/mcp/utils/types.js +7 -0
- package/dist/mcp/workspace-cache.d.ts +42 -0
- package/dist/mcp/workspace-cache.js +97 -0
- package/dist/mcp-server.d.ts +42 -0
- package/dist/mcp-server.js +280 -0
- package/package.json +56 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Publishing Hailer Apps
|
|
3
|
+
description: Complete guide for creating, developing, and publishing Hailer apps - use when building or deploying Hailer applications
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Publishing Hailer Apps - Complete Guide
|
|
7
|
+
|
|
8
|
+
Complete reference for creating, developing, and publishing Hailer apps using the MCP tools and @hailer/app-sdk.
|
|
9
|
+
|
|
10
|
+
## Table of Contents
|
|
11
|
+
1. [Quick Reference](#quick-reference)
|
|
12
|
+
2. [Overview](#overview)
|
|
13
|
+
3. [Prerequisites](#prerequisites)
|
|
14
|
+
4. [Creating a New App](#creating-a-new-app)
|
|
15
|
+
5. [Development Workflow](#development-workflow)
|
|
16
|
+
6. [Publishing Process](#publishing-process)
|
|
17
|
+
7. [Sharing Apps](#sharing-apps)
|
|
18
|
+
8. [Troubleshooting](#troubleshooting)
|
|
19
|
+
|
|
20
|
+
## Quick Reference
|
|
21
|
+
|
|
22
|
+
**Exact commands to publish every time (after initial setup):**
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# 1. Navigate to app directory
|
|
26
|
+
cd /path/to/your-app
|
|
27
|
+
|
|
28
|
+
# 2. Build
|
|
29
|
+
npm run build
|
|
30
|
+
|
|
31
|
+
# 3. Package
|
|
32
|
+
npm pack
|
|
33
|
+
|
|
34
|
+
# 4. Publish to production
|
|
35
|
+
echo "Y" | EMAIL=your-email@example.com PASSWORD=your-password node node_modules/@hailer/app-sdk/lib/tools/publish.cjs ./your-app-name-0.0.0.tgz --production
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**First-time setup requirements:**
|
|
39
|
+
1. Create app entry with `create_app()` MCP tool
|
|
40
|
+
2. Update `public/manifest.json` with returned appId
|
|
41
|
+
3. Patch `node_modules/@hailer/app-sdk/lib/tools/publish.cjs` line 44 to add PASSWORD support
|
|
42
|
+
|
|
43
|
+
## Overview
|
|
44
|
+
|
|
45
|
+
Hailer apps are React/TypeScript applications that run inside the Hailer workspace. They can interact with workflows, activities, and other Hailer data using the `@hailer/app-sdk`.
|
|
46
|
+
|
|
47
|
+
**Key Concepts:**
|
|
48
|
+
- **Development App**: Points to localhost, used during development
|
|
49
|
+
- **Published App**: Hosted on Hailer servers, accessible to workspace users
|
|
50
|
+
- **manifest.json**: Configuration file linking app code to Hailer app entry
|
|
51
|
+
- **App Entry**: Database record in Hailer identifying the app
|
|
52
|
+
|
|
53
|
+
## Prerequisites
|
|
54
|
+
|
|
55
|
+
- Node.js 18+ installed
|
|
56
|
+
- Access to Hailer workspace
|
|
57
|
+
- Workspace administrator privileges (for publishing)
|
|
58
|
+
- Hailer account credentials
|
|
59
|
+
|
|
60
|
+
## Creating a New App
|
|
61
|
+
|
|
62
|
+
### Step 1: Scaffold the App
|
|
63
|
+
|
|
64
|
+
Use the `scaffold_hailer_app` MCP tool:
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
scaffold_hailer_app({
|
|
68
|
+
projectName: "my-app",
|
|
69
|
+
template: "react-ts", // Options: react-ts, react-swc-ts, vanilla
|
|
70
|
+
installDependencies: true
|
|
71
|
+
})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**What Gets Created:**
|
|
75
|
+
- Complete React/TypeScript project structure
|
|
76
|
+
- `src/` directory with app code
|
|
77
|
+
- `public/manifest.json` for app configuration
|
|
78
|
+
- Vite configuration for dev server and builds
|
|
79
|
+
- Package.json with dev/build/publish scripts
|
|
80
|
+
|
|
81
|
+
### Step 2: Create Development App Entry
|
|
82
|
+
|
|
83
|
+
Create a development app entry pointing to localhost:
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
create_app({
|
|
87
|
+
name: "My App (Dev)",
|
|
88
|
+
description: "Development version",
|
|
89
|
+
url: "http://localhost:3000"
|
|
90
|
+
})
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Update manifest.json:**
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"author": "Your Name",
|
|
97
|
+
"appId": "APP_ID_FROM_CREATE_APP",
|
|
98
|
+
"config": {
|
|
99
|
+
"fields": {
|
|
100
|
+
"workflowId": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"default": "your-workflow-id"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Development Workflow
|
|
110
|
+
|
|
111
|
+
### Running Development Server
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
cd your-app-directory
|
|
115
|
+
npm run dev
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The app will be available at `http://localhost:3000` (or 3001 if 3000 is in use).
|
|
119
|
+
|
|
120
|
+
### Accessing Hailer Data
|
|
121
|
+
|
|
122
|
+
Use the `useHailer` hook to access Hailer API:
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import useHailer from './hailer/use-hailer';
|
|
126
|
+
|
|
127
|
+
export default function App() {
|
|
128
|
+
const { hailer, inside } = useHailer();
|
|
129
|
+
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (!hailer || !inside) return;
|
|
132
|
+
|
|
133
|
+
// Fetch data from Hailer workflows
|
|
134
|
+
const fetchData = async () => {
|
|
135
|
+
const activities = await hailer.activity.list(
|
|
136
|
+
workflowId,
|
|
137
|
+
phaseId,
|
|
138
|
+
{ limit: 50 }
|
|
139
|
+
);
|
|
140
|
+
console.log('Activities:', activities);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
fetchData();
|
|
144
|
+
}, [hailer, inside]);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Testing in Hailer
|
|
149
|
+
|
|
150
|
+
1. Start dev server: `npm run dev`
|
|
151
|
+
2. Open Hailer workspace
|
|
152
|
+
3. Navigate to Apps menu
|
|
153
|
+
4. Open your development app
|
|
154
|
+
5. The app loads from localhost with hot-reload
|
|
155
|
+
|
|
156
|
+
## Publishing Process
|
|
157
|
+
|
|
158
|
+
### Step 1: Create Published App Entry
|
|
159
|
+
|
|
160
|
+
Create a published app entry (no URL - Hailer generates it):
|
|
161
|
+
|
|
162
|
+
```javascript
|
|
163
|
+
create_app({
|
|
164
|
+
name: "My App",
|
|
165
|
+
description: "Production app description"
|
|
166
|
+
// No url parameter - auto-generated for published apps
|
|
167
|
+
})
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Save the returned `appId` - you'll need it for manifest.json.
|
|
171
|
+
|
|
172
|
+
### Step 2: Update Manifest
|
|
173
|
+
|
|
174
|
+
Update `public/manifest.json` with the published app ID:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"author": "Your Name",
|
|
179
|
+
"appId": "PUBLISHED_APP_ID",
|
|
180
|
+
"config": {
|
|
181
|
+
"fields": {
|
|
182
|
+
"workflowId": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"default": "your-workflow-id"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Step 3: Build and Publish
|
|
192
|
+
|
|
193
|
+
#### Option A: Using MCP Tool (Recommended)
|
|
194
|
+
|
|
195
|
+
```javascript
|
|
196
|
+
publish_hailer_app({
|
|
197
|
+
email: "your.email@example.com",
|
|
198
|
+
password: "your-password",
|
|
199
|
+
projectDirectory: "/path/to/your-app"
|
|
200
|
+
})
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Note:** This may fail in non-interactive environments. If so, use Option B.
|
|
204
|
+
|
|
205
|
+
#### Option B: Manual Publish with PASSWORD Env Var (RECOMMENDED - Works Every Time)
|
|
206
|
+
|
|
207
|
+
**This is the proven, reliable method that works consistently.**
|
|
208
|
+
|
|
209
|
+
1. **Patch the publish script** (one-time fix per project):
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# Edit node_modules/@hailer/app-sdk/lib/tools/publish.cjs
|
|
213
|
+
# Line 44, change from:
|
|
214
|
+
let password = process.env.LOCAL || await (0, minimal_password_prompt_1.default)('enter password for ' + email + ': ');
|
|
215
|
+
|
|
216
|
+
# To:
|
|
217
|
+
let password = process.env.PASSWORD || process.env.LOCAL || await (0, minimal_password_prompt_1.default)('enter password for ' + email + ': ');
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
2. **Build and publish with EXACT commands:**
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Step 1: Navigate to app directory
|
|
224
|
+
cd your-app-directory
|
|
225
|
+
|
|
226
|
+
# Step 2: Build the app
|
|
227
|
+
npm run build
|
|
228
|
+
|
|
229
|
+
# Step 3: Package the app
|
|
230
|
+
npm pack
|
|
231
|
+
|
|
232
|
+
# Step 4: Publish to production with auto-confirmation
|
|
233
|
+
echo "Y" | EMAIL=your-email@example.com PASSWORD=your-password node node_modules/@hailer/app-sdk/lib/tools/publish.cjs ./your-app-name-0.0.0.tgz --production
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**IMPORTANT NOTES:**
|
|
237
|
+
- Replace `your-app-name-0.0.0.tgz` with your actual package filename
|
|
238
|
+
- The `echo "Y" |` automatically confirms the overwrite prompt
|
|
239
|
+
- The PASSWORD env var bypasses interactive password prompt
|
|
240
|
+
- Build output goes to `dist/` directory and is included in the .tgz file
|
|
241
|
+
|
|
242
|
+
**Environment Options:**
|
|
243
|
+
- `--production`: Publishes to api.hailer.com (REQUIRED for production)
|
|
244
|
+
- `--staging`: Publishes to api.hailer.biz
|
|
245
|
+
- `--development`: Publishes to testapi.hailer.biz
|
|
246
|
+
- `--local`: Publishes to localhost:1337
|
|
247
|
+
|
|
248
|
+
### Step 4: Verify Publication
|
|
249
|
+
|
|
250
|
+
The publish script will show:
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
Publishing App
|
|
254
|
+
Id: your-app-id
|
|
255
|
+
Name: My App
|
|
256
|
+
Workspace: workspace-name (workspace-id)
|
|
257
|
+
Environment: https://api.hailer.com
|
|
258
|
+
|
|
259
|
+
Overwrite the app? (Y/n): App info: { ... }
|
|
260
|
+
|
|
261
|
+
Published successfully!
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Sharing Apps
|
|
265
|
+
|
|
266
|
+
### Share with Entire Workspace
|
|
267
|
+
|
|
268
|
+
```javascript
|
|
269
|
+
add_app_member({
|
|
270
|
+
appId: "your-app-id",
|
|
271
|
+
member: "network_WORKSPACE_ID"
|
|
272
|
+
})
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Share with Specific Team
|
|
276
|
+
|
|
277
|
+
```javascript
|
|
278
|
+
add_app_member({
|
|
279
|
+
appId: "your-app-id",
|
|
280
|
+
member: "team_TEAM_ID"
|
|
281
|
+
})
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Share with Individual User
|
|
285
|
+
|
|
286
|
+
```javascript
|
|
287
|
+
add_app_member({
|
|
288
|
+
appId: "your-app-id",
|
|
289
|
+
member: "user_USER_ID"
|
|
290
|
+
})
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Remove Access
|
|
294
|
+
|
|
295
|
+
```javascript
|
|
296
|
+
remove_app_member({
|
|
297
|
+
appId: "your-app-id",
|
|
298
|
+
member: "network_WORKSPACE_ID"
|
|
299
|
+
})
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Troubleshooting
|
|
303
|
+
|
|
304
|
+
### Issue: "stdin.setRawMode is not a function"
|
|
305
|
+
|
|
306
|
+
**Cause:** Publish script trying to prompt for password in non-interactive environment.
|
|
307
|
+
|
|
308
|
+
**Solution:** Patch publish script to support PASSWORD env var (see Option B above).
|
|
309
|
+
|
|
310
|
+
### Issue: "appId mismatch" or "App not found"
|
|
311
|
+
|
|
312
|
+
**Cause:** manifest.json has wrong appId.
|
|
313
|
+
|
|
314
|
+
**Solution:**
|
|
315
|
+
1. Use `list_apps()` to find correct app ID
|
|
316
|
+
2. Update `public/manifest.json` with correct appId
|
|
317
|
+
3. Rebuild: `npm run build-production`
|
|
318
|
+
4. Republish
|
|
319
|
+
|
|
320
|
+
### Issue: "Permission denied"
|
|
321
|
+
|
|
322
|
+
**Cause:** User is not workspace administrator.
|
|
323
|
+
|
|
324
|
+
**Solution:** Only workspace admins can create and publish apps. Contact your workspace admin.
|
|
325
|
+
|
|
326
|
+
### Issue: App shows blank screen
|
|
327
|
+
|
|
328
|
+
**Cause:** Various - check browser console.
|
|
329
|
+
|
|
330
|
+
**Common fixes:**
|
|
331
|
+
1. Ensure manifest.json is in `public/` directory (gets copied to `dist/`)
|
|
332
|
+
2. Check Hailer API initialization in useHailer hook
|
|
333
|
+
3. Verify workflow IDs in manifest.json match actual workflows
|
|
334
|
+
4. Check browser console for CORS errors
|
|
335
|
+
|
|
336
|
+
### Issue: Changes not appearing after publish
|
|
337
|
+
|
|
338
|
+
**Cause:** Browser cache or outdated build.
|
|
339
|
+
|
|
340
|
+
**Solution:**
|
|
341
|
+
1. Clear browser cache
|
|
342
|
+
2. Hard refresh (Ctrl+Shift+R)
|
|
343
|
+
3. Verify build completed: `ls dist/` should show updated files
|
|
344
|
+
4. Check npm pack created new tarball with recent timestamp
|
|
345
|
+
|
|
346
|
+
### Issue: "Network error" during publish
|
|
347
|
+
|
|
348
|
+
**Cause:** Cannot connect to Hailer API servers.
|
|
349
|
+
|
|
350
|
+
**Solution:**
|
|
351
|
+
1. Check internet connectivity
|
|
352
|
+
2. Verify correct environment flag (--production, --staging, --development)
|
|
353
|
+
3. For local development: Check NODE_TLS_REJECT_UNAUTHORIZED=0 if using self-signed certs
|
|
354
|
+
|
|
355
|
+
## Complete Example: Football Lineup App
|
|
356
|
+
|
|
357
|
+
Real-world example from our implementation:
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
# 1. Scaffold app
|
|
361
|
+
scaffold_hailer_app({
|
|
362
|
+
projectName: "football-lineup-app",
|
|
363
|
+
template: "react-ts"
|
|
364
|
+
})
|
|
365
|
+
|
|
366
|
+
# 2. Develop app
|
|
367
|
+
cd football-lineup-app
|
|
368
|
+
npm run dev
|
|
369
|
+
# ... build app features ...
|
|
370
|
+
|
|
371
|
+
# 3. Create published app entry
|
|
372
|
+
create_app({
|
|
373
|
+
name: "Football Lineup Manager",
|
|
374
|
+
description: "Interactive football team lineup manager"
|
|
375
|
+
})
|
|
376
|
+
# Returns: appId: 690988024ecaf7fb6baded60
|
|
377
|
+
|
|
378
|
+
# 4. Update manifest.json
|
|
379
|
+
{
|
|
380
|
+
"author": "Football Team Management",
|
|
381
|
+
"appId": "690988024ecaf7fb6baded60",
|
|
382
|
+
"config": {
|
|
383
|
+
"fields": {
|
|
384
|
+
"workflowId": {
|
|
385
|
+
"type": "string",
|
|
386
|
+
"default": "69087299c0e0b9944c620168"
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
# 5. Patch publish script (one-time)
|
|
393
|
+
# Add PASSWORD support to publish.cjs line 44
|
|
394
|
+
|
|
395
|
+
# 6. Build and Publish (exact working commands)
|
|
396
|
+
npm run build
|
|
397
|
+
npm pack
|
|
398
|
+
echo "Y" | EMAIL=your-email@example.com PASSWORD=your-password node node_modules/@hailer/app-sdk/lib/tools/publish.cjs ./football-lineup-app-0.0.0.tgz --production
|
|
399
|
+
|
|
400
|
+
# 7. Share with workspace
|
|
401
|
+
add_app_member({
|
|
402
|
+
appId: "690988024ecaf7fb6baded60",
|
|
403
|
+
member: "network_6901c67b4e80fecb6fd7b38a"
|
|
404
|
+
})
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Best Practices
|
|
408
|
+
|
|
409
|
+
1. **Separate Dev and Production Apps**: Always maintain separate app entries for development and production
|
|
410
|
+
2. **Version Your Apps**: Update version in package.json for each release
|
|
411
|
+
3. **Test Before Publishing**: Thoroughly test in development mode before publishing
|
|
412
|
+
4. **Document Config Fields**: Add clear descriptions for config fields in manifest.json
|
|
413
|
+
5. **Use Environment Variables**: Don't hardcode workflow IDs - use manifest.json config
|
|
414
|
+
6. **Handle Loading States**: Always check `if (!hailer || !inside)` before accessing Hailer API
|
|
415
|
+
7. **Error Handling**: Wrap Hailer API calls in try-catch blocks
|
|
416
|
+
|
|
417
|
+
## Available MCP Tools
|
|
418
|
+
|
|
419
|
+
- `scaffold_hailer_app`: Create new app from template
|
|
420
|
+
- `create_app`: Create app entry in Hailer
|
|
421
|
+
- `update_app`: Modify app properties
|
|
422
|
+
- `remove_app`: Delete app entry
|
|
423
|
+
- `list_apps`: View all workspace apps
|
|
424
|
+
- `add_app_member`: Share app with users/teams
|
|
425
|
+
- `remove_app_member`: Revoke app access
|
|
426
|
+
- `publish_hailer_app`: Build and publish app (may require workaround)
|
|
427
|
+
|
|
428
|
+
## Package.json Scripts Reference
|
|
429
|
+
|
|
430
|
+
Standard scripts in scaffolded apps:
|
|
431
|
+
|
|
432
|
+
```json
|
|
433
|
+
{
|
|
434
|
+
"scripts": {
|
|
435
|
+
"dev": "vite",
|
|
436
|
+
"build": "tsc && vite build",
|
|
437
|
+
"preview": "vite preview",
|
|
438
|
+
"build-development": "vite build --mode development",
|
|
439
|
+
"build-staging": "vite build --mode staging",
|
|
440
|
+
"build-production": "vite build --mode production",
|
|
441
|
+
"publish-development": "npm run build-development && node node_modules/@hailer/app-sdk/lib/tools/publish.cjs ./`npm pack` --development",
|
|
442
|
+
"publish-staging": "npm run build-staging && node node_modules/@hailer/app-sdk/lib/tools/publish.cjs ./`npm pack` --staging",
|
|
443
|
+
"publish-production": "npm run build-production && node node_modules/@hailer/app-sdk/lib/tools/publish.cjs ./`npm pack` --production"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
## Additional Resources
|
|
449
|
+
|
|
450
|
+
- Hailer App SDK documentation
|
|
451
|
+
- React + TypeScript best practices
|
|
452
|
+
- Vite build configuration
|
|
453
|
+
- Hailer API reference (use `hailer-api` skill for comprehensive API docs)
|