@hailer/mcp 1.3.21 → 1.3.32

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 (95) 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-docs-search/SKILL.md +75 -0
  8. package/.claude/skills/hailer-workflow-archetypes/SKILL.md +301 -0
  9. package/.claude/skills/insight-join-patterns/SKILL.md +313 -0
  10. package/.claude/skills/publish-hailer-app/SKILL.md +211 -0
  11. package/.claude/skills/sdk-activity-patterns/SKILL.md +257 -105
  12. package/.claude/skills/sdk-function-fields/SKILL.md +253 -492
  13. package/.claude/skills/sdk-insight-calculations/SKILL.md +364 -0
  14. package/.claude/skills/sdk-insight-queries/SKILL.md +192 -397
  15. package/.claude/skills/sdk-ws-config-skill/SKILL.md +265 -720
  16. package/.claude/skills/tool-response-verification/SKILL.md +143 -0
  17. package/CLAUDE.md +45 -19
  18. package/dist/bot/bot.d.ts.map +1 -1
  19. package/dist/bot/bot.js +21 -1
  20. package/dist/bot/bot.js.map +1 -1
  21. package/dist/bot/services/helper-prompt.d.ts +1 -1
  22. package/dist/bot/services/helper-prompt.d.ts.map +1 -1
  23. package/dist/bot/services/helper-prompt.js +4 -6
  24. package/dist/bot/services/helper-prompt.js.map +1 -1
  25. package/dist/bot/services/message-formatter.d.ts.map +1 -1
  26. package/dist/bot/services/message-formatter.js +2 -1
  27. package/dist/bot/services/message-formatter.js.map +1 -1
  28. package/dist/bot/services/system-prompt.d.ts.map +1 -1
  29. package/dist/bot/services/system-prompt.js +21 -34
  30. package/dist/bot/services/system-prompt.js.map +1 -1
  31. package/dist/cli.d.ts.map +1 -1
  32. package/dist/cli.js +6 -0
  33. package/dist/cli.js.map +1 -1
  34. package/dist/config.d.ts +1 -0
  35. package/dist/config.d.ts.map +1 -1
  36. package/dist/config.js +5 -0
  37. package/dist/config.js.map +1 -1
  38. package/dist/lib/object-id.d.ts +9 -0
  39. package/dist/lib/object-id.d.ts.map +1 -0
  40. package/dist/lib/object-id.js +15 -0
  41. package/dist/lib/object-id.js.map +1 -0
  42. package/dist/mcp/hailer-rpc.d.ts +3 -0
  43. package/dist/mcp/hailer-rpc.d.ts.map +1 -1
  44. package/dist/mcp/hailer-rpc.js +7 -0
  45. package/dist/mcp/hailer-rpc.js.map +1 -1
  46. package/dist/mcp/tool-profiles.d.ts +1 -0
  47. package/dist/mcp/tool-profiles.d.ts.map +1 -1
  48. package/dist/mcp/tool-profiles.js +21 -4
  49. package/dist/mcp/tool-profiles.js.map +1 -1
  50. package/dist/mcp/tools/aliases.d.ts.map +1 -1
  51. package/dist/mcp/tools/aliases.js +14 -6
  52. package/dist/mcp/tools/aliases.js.map +1 -1
  53. package/dist/mcp/tools/app-core.d.ts.map +1 -1
  54. package/dist/mcp/tools/app-core.js +6 -3
  55. package/dist/mcp/tools/app-core.js.map +1 -1
  56. package/dist/mcp/tools/app-marketplace.d.ts.map +1 -1
  57. package/dist/mcp/tools/app-marketplace.js +7 -2
  58. package/dist/mcp/tools/app-marketplace.js.map +1 -1
  59. package/dist/mcp/tools/docs.d.ts +20 -0
  60. package/dist/mcp/tools/docs.d.ts.map +1 -0
  61. package/dist/mcp/tools/docs.js +87 -0
  62. package/dist/mcp/tools/docs.js.map +1 -0
  63. package/dist/mcp/tools/function-fields.d.ts +17 -0
  64. package/dist/mcp/tools/function-fields.d.ts.map +1 -0
  65. package/dist/mcp/tools/function-fields.js +717 -0
  66. package/dist/mcp/tools/function-fields.js.map +1 -0
  67. package/dist/mcp/tools/index.d.ts.map +1 -1
  68. package/dist/mcp/tools/index.js +4 -0
  69. package/dist/mcp/tools/index.js.map +1 -1
  70. package/dist/mcp/tools/workflow.d.ts +0 -1
  71. package/dist/mcp/tools/workflow.d.ts.map +1 -1
  72. package/dist/mcp/tools/workflow.js +1 -190
  73. package/dist/mcp/tools/workflow.js.map +1 -1
  74. package/dist/public-chat/graduate.d.ts +5 -4
  75. package/dist/public-chat/graduate.d.ts.map +1 -1
  76. package/dist/public-chat/graduate.js +226 -76
  77. package/dist/public-chat/graduate.js.map +1 -1
  78. package/dist/public-chat/handler.d.ts.map +1 -1
  79. package/dist/public-chat/handler.js +10 -2
  80. package/dist/public-chat/handler.js.map +1 -1
  81. package/dist/public-chat/index.d.ts.map +1 -1
  82. package/dist/public-chat/index.js +12 -1
  83. package/dist/public-chat/index.js.map +1 -1
  84. package/dist/public-chat/session-store.d.ts +22 -1
  85. package/dist/public-chat/session-store.d.ts.map +1 -1
  86. package/dist/public-chat/session-store.js +56 -2
  87. package/dist/public-chat/session-store.js.map +1 -1
  88. package/dist/public-chat/studio-prewarm.js +1 -1
  89. package/dist/public-chat/studio-prewarm.js.map +1 -1
  90. package/dist/public-chat/system-prompt.d.ts +1 -1
  91. package/dist/public-chat/system-prompt.d.ts.map +1 -1
  92. package/dist/public-chat/system-prompt.js +161 -83
  93. package/dist/public-chat/system-prompt.js.map +1 -1
  94. package/package.json +1 -1
  95. package/.claude/skills/hailer-project-protocol/SKILL.md +0 -398
@@ -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, production publish, marketplace, validation, and cache gotchas
4
- version: 2.0.0
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 so you never hit them:** clears the placeholder `appId` (`65143728…`) and fake "Magic Apps Ltd." author from `public/manifest.json` (so first-publish detection is clean and no demo identity leaks), 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 Studio's `NODE_ENV=production` — which otherwise omits devDeps and breaks the build), and wires the `publish-*` scripts with `--env-file ../../.env` (per-project publish auth). Idempotent and safe to re-run. **`prep-app` writes `.npmrc` *after* `create-app`'s own install, so run `npm install --include=dev` once more after prep-app to pull the devDeps that first install skipped.** (Run prep-app from the SDK project root, where `npx hailer-mcp` resolves; pass the app dir or `apps/<name>`.)
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 an agent. Put the name first, bare.
38
- - **`--template` must be a real template name:** `react-ts` (recommended), `react`, `react-swc-ts`, `vanilla-ts`, `vanilla`, `preact-ts`, `preact`, `svelte-ts`, `svelte`. NOT `minimal` (invalid 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. e.g. `injured-players-cost`.
40
- - Never run `npx @hailer/create-app` bare and never pipe input to it (`echo …|`, `printf`, `expect`) — the one-line form above already needs no input.
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` (the `--include=dev` survives `NODE_ENV=production`; the `.npmrc` prep-app writes makes later bare `npm install` safe too).
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 as your very first edit and tsc is clean. (Upstream create-app bug; not your code.)
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 and sends you chasing a problem the publish never sees. Verify the way you ship.
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-*`) resolves auth as: **`--user-api-key` flag → `USER_API_KEY` env → `HAILER_USER_API_KEY` env** (an API key and `--email` are mutually exclusive — passing one ignores the other). Those env vars are loaded by dotenv from **`--env-file <path>` first (if passed), then `~/.env`** in HOME; dotenv never overrides an already-set var, so the earlier source wins. Last resort: `--email` interactive password prompt (useless for agents).
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:** the `npx hailer-mcp` server 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`** (not `~/.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. (Opt out: `HAILER_MCP_NO_PUBLISH_AUTH=true`.)
86
- - **⚠ Per-project, not machine-global.** Earlier versions wrote the key to `~/.env` one slot shared by every project, so the last `npx hailer-mcp` to boot won it and other projects published to the WRONG workspace. Now each project's key lives in its own `.env` and `--env-file ../../.env` makes it win. Apps must live under `apps/<name>/` for that relative path to resolve; a top-level app needs re-homing under `apps/` or an explicit `-- --user-api-key <key>`.
87
- - **ALWAYS pass `-- --force`.** Without it the publish stops at an interactive `Overwrite the app? (Y/n)` prompt which an agent cannot answer, so the command hangs until it times out. Every publish command below includes it; never drop it.
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), loud version error = `--market` without `version`/`versionDescription` in the manifest.
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
- Check before publishing:
97
-
98
- 1. Read `public/manifest.json`
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
- **BEFORE any publish, run `npx hailer-mcp prep-app <name>`** (from the SDK project root; idempotent — safe to re-run, no-ops if already done). Apps scaffolded before the `--env-file` flag existed don't carry it in their `publish-*` scripts, so they'd authenticate from the machine-global `~/.env` and could publish to the WRONG workspace. Re-prepping retrofits `--env-file ../../.env` so this publish targets THIS project's workspace. This is the "prep on the fly" guard touch an app to publish it, prep it first.
111
+ **FIRST, decide first-publish vs update by READING `public/manifest.json` — never guess, never fail-first.**
117
112
 
118
- **THEN decide first-publish vs update by READING `public/manifest.json` — never guess, never fail-first.** The scaffold ships a placeholder `appId` of `65143728d2bd678b13daf289` (the "Magic Apps" demo). That value, or empty/missing, means this app has never been published:
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` (all three required with `--create`) |
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 (in-cluster; set --host to the public API explicitly)
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 — exact error → exact action, no improvising:**
131
+ **PUBLISH FAILURE PLAYBOOK:**
139
132
  | Failure | Meaning | Action |
140
133
  |---|---|---|
141
- | exit 10, usage printed | no auth | start `npx hailer-mcp` once (mints the key), or `-- --user-api-key <key>` |
142
- | exit 2, "app was not found using <identity>" | manifest appId doesn't belong to this user/workspace (first publish, or a wrong appId) | re-run with **all three flags together — `--create` REQUIRES `--app-name "<Name>"` AND `--workspace <wsId>`** (`--create` alone, or with just `--force`, fails): `npm run publish-production -- --create --app-name "<Name>" --workspace <wsId> --force`. **NEVER "register the app first" via workspace/apps.ts** — that creates a registry entry with a URL you'd have to invent (placeholder URLs break the app: Hailer fetches `<url>/manifest.json` → "manifest missing"). `--create` makes the entry AND sets the real CDN URL |
143
- | exit 8 | login failed | the key/credentials are bad — re-mint or ask the user |
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. **Before publishing, fix `public/manifest.json`**: the scaffold leaves a placeholder `author` (e.g. "Magic Apps Ltd.") and `description`. Set the real values now — the agent controls these.
150
- 2. **After the `--create` publish, republish once** (plain `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 (the manifest now holds the real `appId`). This is a known app-sdk ordering bug — the double-publish is the workaround, not optional.
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. Finish those after publishing: share with `manage_app({ action: 'add_member', appId, member: 'network_<wsId>' })`, and set an icon with `manage_app({ action: 'update', appId, image: <fileId> })` if wanted (icon files MUST be uploaded `isPublic: true`, PNG/JPEG only).
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 (clear/replace `appId` in manifest first if reusing a dev manifest) |
159
- | `--app-name` | Name shown in Hailer (required with `--create`) |
160
- | `--workspace` | Workspace ID (`config.json` at project root; required with `--create`) |
161
- | `--market` | Also publish this version to the marketplace (requires `version` + `versionDescription`; server returns `targetId`, auto-saved to manifest) |
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
- | `--user-api-key` / `--email` | Explicit auth (mutually exclusive). Else `USER_API_KEY`/`HAILER_USER_API_KEY` env — loaded from `--env-file` then `~/.env` |
165
- | `--env-file <path>` | Load an env file before `~/.env` (wins on conflicts). `prep-app` sets `--env-file ../../.env` so each project publishes with its own key, not whatever last claimed `~/.env` |
166
- | `--production` / `--development` / `--staging` / `--local` | Environment preset (the `npm run publish-*` wrappers set these) |
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. Requires `version` + `versionDescription` in the manifest; the server returns a `targetId`, auto-saved to `public/manifest.json`.
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`. Metadata updates later use `productId`; new versions re-publish with `--market`.
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`, find via `browse_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. The publish tool handles it; manual `upload_files` must pass the flag.
195
- - **No SVG icons** — the backend image pipeline (sharp) doesn't serve them; use PNG/JPEG. No SVG gradients in generated icons either (`flatten()` produces transparency — use solid RGB + composite).
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
- - Read the scaffolded project's README it carries the exact commands for its version.
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>