- link-self.mjs: skip when node_modules/@modelcontextprotocol/ext-apps is
a symlink (e.g. to the repo root). cpSync("dist", target/dist) was
failing with ERR_FS_CP_EINVAL because src and dest resolved to the
same path.
- .husky/pre-commit: capture staged files with --diff-filter=d so the
re-stage step doesn't fail with "pathspec did not match" on commits
(typically merges) that include deletions.
npm workspaces hoists example dependencies to the root node_modules,
but installs the published registry copy of @modelcontextprotocol/ext-apps
instead of linking to the local source. This causes type-check failures
when examples use features not yet published to npm.
Add scripts/link-self.mjs which copies the freshly-built dist/ and
package.json into the hoisted node_modules copy after each SDK build,
ensuring examples always type-check against the latest local types.
See: https://github.com/npm/feedback/discussions/774