Skip to content

Commit 10cd172

Browse files
committed
Remove Smithery bundling workaround and use official support
1 parent ddea433 commit 10cd172

7 files changed

Lines changed: 36 additions & 60 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ jobs:
2626
- name: Install dependencies
2727
run: npm ci
2828

29-
- name: Enable pnpm (for Smithery CLI fork)
30-
run: |
31-
corepack enable
32-
corepack prepare pnpm@10.27.0 --activate
33-
34-
- name: Use forked Smithery CLI (stdio prepack)
35-
run: npm install --no-save --no-package-lock @smithery/cli@github:cameroncooke/cli#stdio-prepack-hook
36-
3729
- name: Bundle AXe artifacts
3830
run: npm run bundle:axe
3931

.github/workflows/release.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ jobs:
4242
rm -rf node_modules package-lock.json
4343
npm install --ignore-scripts
4444
45-
- name: Enable pnpm (for Smithery CLI fork)
46-
run: |
47-
corepack enable
48-
corepack prepare pnpm@10.27.0 --activate
49-
50-
- name: Use forked Smithery CLI (stdio prepack)
51-
run: npm install --no-save --no-package-lock @smithery/cli@github:cameroncooke/cli#stdio-prepack-hook
52-
5345
- name: Check formatting
5446
run: npm run format:check
5547

docs/investigations/issue-163.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Smithery installs ship only the compiled entrypoint, while the server hard-requi
5252
**Evidence:** `node_modules/@smithery/cli/dist/index.js:~2716600-2717500`, `smithery.config.js:1-47`
5353
**Conclusion:** Confirmed. Bundling must run outside esbuild plugins; Linux builders must skip binary verification.
5454

55+
### 2026-01-27 - Upstream fix landed (Smithery CLI PR #532)
56+
**Hypothesis:** Smithery CLI now supports bundling non-code assets in stdio deploys, removing the need for the local workaround.
57+
**Findings:** PR #532 adds a `build.assets` array in `smithery.yaml` for stdio bundles, copies matched assets into `.smithery/stdio/` before packing `server.mcpb`, and preserves directory structure. It uses `fast-glob` patterns, excludes `**/node_modules/**` and `**/.git/**` by default, warns when assets are configured for non-stdio transports or when patterns match zero files, and fails the build if patterns escape the project root, hit permission errors, or match reserved root filenames (`index.cjs`, `mcpb-manifest.json`, `manifest.json`, `server.mcpb`). The PR also documents runtime access via `__dirname` with assets available at the same relative paths inside the bundle.
58+
**Evidence:** Smithery issue `smithery-ai/cli#524` (opened Jan 22, 2026) and PR `smithery-ai/cli#532` (merged Jan 27, 2026) summary/usage/behavior sections.
59+
**Conclusion:** We can migrate from the `smithery.config.js` side-effect bundling workaround once we upgrade to a CLI version that includes PR #532 and configure `smithery.yaml` `build.assets` for `bundled/**`.
60+
5561
## Root Cause
5662
Two coupled assumptions break Smithery installs:
5763
1) `getAxePath()` is bundled-only and derives the path from `process.argv[1]`, which points into Smithery’s cache (missing `bundled/axe`), so it always returns null.
@@ -63,6 +69,15 @@ Two coupled assumptions break Smithery installs:
6369
3. Align Doctor output: show both bundled availability and PATH availability, and use that in the UI automation supported status.
6470
4. Update Smithery build to run `bundle:axe` and copy `bundled/` into the Smithery bundle output; skip binary verification on non-mac builders to avoid build failures.
6571

72+
## Migration Plan (official Smithery resource bundling)
73+
1. Upgrade Smithery CLI to `>=3.4.0` on all developer machines and CI that build/deploy via Smithery.
74+
2. Replace the `smithery.config.js` side-effect copy workaround with official bundling config in `smithery.yaml`:
75+
- `build.assets: [ "bundled/**" ]`
76+
3. Remove the Smithery prepack copy step once 3.4.0 is in use.
77+
4. Ensure `bundle:axe` still runs during build so `bundled/` exists before Smithery packages resources.
78+
5. Validate a Smithery install contains `bundled/axe` in its cache and that UI automation + `record_sim_video` work without PATH fallbacks.
79+
6. Remove any Linux-specific skips that were only needed to avoid bundled verification for the workaround, once the official bundling flow proves stable.
80+
6681
## Preventive Measures
6782
- Add tests for AXe resolution precedence (bundled, env override, PATH) and for Doctor output consistency.
6883
- Document Smithery-specific install requirements and verify `bundled/` presence in Smithery artifacts during CI.

package-lock.json

Lines changed: 18 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"@bacons/xcode": "^1.0.0-alpha.24",
8080
"@eslint/eslintrc": "^3.3.1",
8181
"@eslint/js": "^9.23.0",
82-
"@smithery/cli": "^3.3.0",
82+
"@smithery/cli": "^3.4.0",
8383
"@types/node": "^22.13.6",
8484
"@typescript-eslint/eslint-plugin": "^8.28.0",
8585
"@typescript-eslint/parser": "^8.28.0",

scripts/smithery-prepack.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

smithery.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
runtime: typescript
22
target: local
33
build:
4-
prepackCommand: "bash scripts/smithery-prepack.sh"
4+
assets:
5+
- "bundled/**"

0 commit comments

Comments
 (0)