mcpill 1.10.0 → 1.12.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.12.0
4
+
5
+ - Fix: `runValidate` used `console.log` for the `✓ Valid:` summary line, writing plain text to stdout and breaking stdio MCP transport (clients tried to parse it as JSON-RPC and crashed). Output is now sent to `process.stderr.write` instead.
6
+ - Bumped `mcpster` dep to `^0.3.2`, which carries the same fix in its `setup.js`
7
+
8
+ ## 1.11.0
9
+
10
+ - `trigger: UserPromptSubmit` is a valid hook trigger in `PILL.md` `## Hook:` sections and `.mcpill/server/hooks/*.md` files
11
+ - `mcpill compile` writes `UserPromptSubmit` hooks to `.claude/settings.json` without a `matcher` field (not supported by this event type)
12
+ - `matcher` or `blocking: true` on a `UserPromptSubmit` hook emits a compile-time warning and the field is dropped
13
+
3
14
  ## 1.10.0
4
15
 
5
16
  - `mcpill compile` emits `.mcpill/dist/<pill>/` — a standalone npm package containing `install.js`, `index.js`, `tools.js`, `package.json`, and (for blocking pills) `hooks/pre-tool-gate.js` + `hooks/post-analysis-flag.js`
package/dist/cli.js CHANGED
@@ -1076,8 +1076,13 @@ function mergeUserHooksIntoSettings(baseDir, hookBlocks) {
1076
1076
  ...block.matcher !== void 0 ? { matcher: block.matcher } : {},
1077
1077
  hooks: [{ type: "command", command: block.command }]
1078
1078
  };
1079
- const matcherKey = block.matcher ?? "";
1080
- const idx = existing.findIndex((e) => (e.matcher ?? "") === matcherKey);
1079
+ let idx;
1080
+ if (block.event === "UserPromptSubmit") {
1081
+ idx = existing.findIndex((e) => e.hooks[0]?.command === block.command);
1082
+ } else {
1083
+ const matcherKey = block.matcher ?? "";
1084
+ idx = existing.findIndex((e) => (e.matcher ?? "") === matcherKey);
1085
+ }
1081
1086
  if (idx !== -1) {
1082
1087
  existing[idx] = newEntry;
1083
1088
  } else {
@@ -1227,7 +1232,8 @@ async function validateOne(mcpillDir) {
1227
1232
  }
1228
1233
  process.exit(1);
1229
1234
  }
1230
- console.log(`\u2713 Valid: ${toolCount} tools, ${promptCount} prompts, ${resourceCount} resources`);
1235
+ process.stderr.write(`\u2713 Valid: ${toolCount} tools, ${promptCount} prompts, ${resourceCount} resources
1236
+ `);
1231
1237
  }
1232
1238
  async function runValidate(baseDir) {
1233
1239
  const mcpillDir = path6.join(baseDir, ".mcpill");
@@ -2215,8 +2221,24 @@ async function runCompile(opts) {
2215
2221
  }
2216
2222
  }
2217
2223
  const allUserHooks = [...pillHooks, ...fileHooks];
2218
- const blockingHooks = allUserHooks.filter((h) => h.blocking);
2219
- const regularHooks = allUserHooks.filter((h) => !h.blocking);
2224
+ const normalizedUserHooks = allUserHooks.map((h) => {
2225
+ if (h.event !== "UserPromptSubmit") return h;
2226
+ const norm = { ...h };
2227
+ if (norm.blocking) {
2228
+ console.warn(`warn: UserPromptSubmit hooks do not support blocking \u2014 field ignored`);
2229
+ delete norm.blocking;
2230
+ delete norm.required_tool;
2231
+ delete norm.gate_window_seconds;
2232
+ delete norm.instructions;
2233
+ }
2234
+ if (norm.matcher !== void 0) {
2235
+ console.warn(`warn: UserPromptSubmit hooks do not support matcher \u2014 field ignored`);
2236
+ delete norm.matcher;
2237
+ }
2238
+ return norm;
2239
+ });
2240
+ const blockingHooks = normalizedUserHooks.filter((h) => h.blocking);
2241
+ const regularHooks = normalizedUserHooks.filter((h) => !h.blocking);
2220
2242
  for (const hook of blockingHooks) {
2221
2243
  if (!hook.name) throw new Error(`blocking hook is missing a name`);
2222
2244
  if (!hook.required_tool) throw new Error(`blocking hook '${hook.name}' is missing required_tool`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcpill",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "description": "CLI for building, validating, and publishing MCP servers using the pill format.",
6
6
  "homepage": "https://mcpill.ruco.dev",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "mcpill-runtime": "^0.1.2",
30
- "mcpster": "^0.3.0",
30
+ "mcpster": "^0.3.2",
31
31
  "commander": "^12"
32
32
  },
33
33
  "devDependencies": {