mcpill 1.10.0 → 1.11.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 +6 -0
- package/dist/cli.js +25 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.11.0
|
|
4
|
+
|
|
5
|
+
- `trigger: UserPromptSubmit` is a valid hook trigger in `PILL.md` `## Hook:` sections and `.mcpill/server/hooks/*.md` files
|
|
6
|
+
- `mcpill compile` writes `UserPromptSubmit` hooks to `.claude/settings.json` without a `matcher` field (not supported by this event type)
|
|
7
|
+
- `matcher` or `blocking: true` on a `UserPromptSubmit` hook emits a compile-time warning and the field is dropped
|
|
8
|
+
|
|
3
9
|
## 1.10.0
|
|
4
10
|
|
|
5
11
|
- `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
|
-
|
|
1080
|
-
|
|
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 {
|
|
@@ -2215,8 +2220,24 @@ async function runCompile(opts) {
|
|
|
2215
2220
|
}
|
|
2216
2221
|
}
|
|
2217
2222
|
const allUserHooks = [...pillHooks, ...fileHooks];
|
|
2218
|
-
const
|
|
2219
|
-
|
|
2223
|
+
const normalizedUserHooks = allUserHooks.map((h) => {
|
|
2224
|
+
if (h.event !== "UserPromptSubmit") return h;
|
|
2225
|
+
const norm = { ...h };
|
|
2226
|
+
if (norm.blocking) {
|
|
2227
|
+
console.warn(`warn: UserPromptSubmit hooks do not support blocking \u2014 field ignored`);
|
|
2228
|
+
delete norm.blocking;
|
|
2229
|
+
delete norm.required_tool;
|
|
2230
|
+
delete norm.gate_window_seconds;
|
|
2231
|
+
delete norm.instructions;
|
|
2232
|
+
}
|
|
2233
|
+
if (norm.matcher !== void 0) {
|
|
2234
|
+
console.warn(`warn: UserPromptSubmit hooks do not support matcher \u2014 field ignored`);
|
|
2235
|
+
delete norm.matcher;
|
|
2236
|
+
}
|
|
2237
|
+
return norm;
|
|
2238
|
+
});
|
|
2239
|
+
const blockingHooks = normalizedUserHooks.filter((h) => h.blocking);
|
|
2240
|
+
const regularHooks = normalizedUserHooks.filter((h) => !h.blocking);
|
|
2220
2241
|
for (const hook of blockingHooks) {
|
|
2221
2242
|
if (!hook.name) throw new Error(`blocking hook is missing a name`);
|
|
2222
2243
|
if (!hook.required_tool) throw new Error(`blocking hook '${hook.name}' is missing required_tool`);
|