@george43g/mcp-kit 1.0.0 → 2.0.0

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 (2) hide show
  1. package/README.md +46 -0
  2. package/package.json +5 -2
package/README.md CHANGED
@@ -145,6 +145,52 @@ buildDispatcher: 1 devOnly tool(s) registered with no devOnlyEnabled predicate:
145
145
  **Migration is one line** — pass the predicate, as shown in *Dev-only tools*
146
146
  above. If you have no `devOnly` tools, there is nothing to do.
147
147
 
148
+ ### Upgrading to 2.0.0 — declare `@george43g/robustness` yourself
149
+
150
+ **`robustness` moved from `dependencies` to `peerDependencies`.** If your app
151
+ already depends on `@george43g/robustness` directly — as every known consumer
152
+ does, and as the generated template does — **there is nothing to do**. If it does
153
+ not, add it.
154
+
155
+ ```jsonc
156
+ // your package.json
157
+ "dependencies": {
158
+ "@george43g/robustness": ">=0.13.0 <1" // or a caret; any 0.x satisfies the peer
159
+ }
160
+ ```
161
+
162
+ **What this fixes, and it is not cosmetic.** As a plain dependency with a
163
+ *floor*, mcp-kit could resolve its **own second copy** of robustness whenever the
164
+ app's range and mcp-kit's stopped overlapping. The logger keeps prefix and file
165
+ state at module scope, so two copies means **two independent loggers**:
166
+ `setLogFilePrefix` in your app cannot reach the instance mcp-kit's `perf()` spans
167
+ write through, and dispatch spans silently land in the shared `$TMPDIR/mcp/`
168
+ bucket no matter how correctly your app brands itself.
169
+
170
+ That was live in **1.0.0**, whose floor was `>=0.12.0 <1`: an app on `^0.11.0`
171
+ that bumped mcp-kit alone got exactly this split. **2.0.0 removes the failure
172
+ mode by construction** — a peer is supplied by the consumer, so there is only
173
+ ever one instance. The peer range is deliberately wide (`>=0.11.0 <1`, every
174
+ symbol mcp-kit imports exists at 0.11.0), so no consumer is forced to move.
175
+
176
+ `tui-kit` has always declared robustness this way; mcp-kit was the outlier.
177
+
178
+ Verify with the one line that settles it:
179
+
180
+ ```sh
181
+ grep -oE "@george43g/robustness@[0-9.]+" pnpm-lock.yaml | sort -u
182
+ ```
183
+
184
+ One line is correct. Two means something still resolves its own copy.
185
+
186
+ **The generalisable lesson:** a plain dependency with a *wide* range behaves like
187
+ a peer — right up until the ranges stop overlapping. Two individually safe
188
+ changes (raising a floor, cutting a major) were jointly hazardous. Found by
189
+ `up-bank-mcp`.
190
+ Found by `up-bank-mcp` as range arithmetic over the published manifests.
191
+ **Not yet observed in a resolved tree by anyone** — treat the ordering as cheap
192
+ insurance rather than a reproduction.
193
+
148
194
  **Why a throw and not a flipped default.** Before 1.0.0, omitting the predicate
149
195
  left dev-only tools *callable* — hidden from `tools/list` and answering by name.
150
196
  Two consumers hit that independently, and one measured a dev-only log reader
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@george43g/mcp-kit",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "MCP server building blocks: tool registry types, dispatcher with timeout/perf/abort/error-wrap baked in, stdio + Streamable HTTP transports, sanitize() for user content, UUID-gated prompt-injection helpers.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -51,12 +51,12 @@
51
51
  "test:coverage": "vitest run --coverage"
52
52
  },
53
53
  "dependencies": {
54
- "@george43g/robustness": ">=0.12.0 <1",
55
54
  "@modelcontextprotocol/sdk": "^1.29.0",
56
55
  "zod": "^3.23.0",
57
56
  "zod-to-json-schema": "^3.25.0"
58
57
  },
59
58
  "devDependencies": {
59
+ "@george43g/robustness": "workspace:*",
60
60
  "@george43g/tsconfig": "workspace:*",
61
61
  "@george43g/vitest-config": "workspace:*",
62
62
  "@semantic-release/changelog": "^6.0.3",
@@ -68,5 +68,8 @@
68
68
  "semantic-release-monorepo": "^8.0.2",
69
69
  "typescript": "^5.7.0",
70
70
  "vitest": "^3.2.7"
71
+ },
72
+ "peerDependencies": {
73
+ "@george43g/robustness": ">=0.11.0 <1"
71
74
  }
72
75
  }