dlw-machine-setup 0.8.2 → 0.8.4
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/bin/installer.js +29 -4
- package/package.json +1 -1
package/bin/installer.js
CHANGED
|
@@ -4358,9 +4358,30 @@ var HOOKS_TAG_PREFIX = "hooks-v";
|
|
|
4358
4358
|
var HOOKS_ROOT_FOLDER = "hooks";
|
|
4359
4359
|
var BUNDLE_NAME = "abap-mcp-hooks";
|
|
4360
4360
|
var HOOK_DEFINITIONS = [
|
|
4361
|
-
{
|
|
4362
|
-
|
|
4363
|
-
|
|
4361
|
+
{
|
|
4362
|
+
event: "PreToolUse",
|
|
4363
|
+
script: "sap-safety-gate.mjs",
|
|
4364
|
+
/* Fires on lifecycle/preview tools regardless of which MCP
|
|
4365
|
+
* server exposes them — the safety gate's job is to block
|
|
4366
|
+
* delete + transport release operations wherever they originate. */
|
|
4367
|
+
matcher: "mcp__.*__sap_(object_lifecycle|transport_lifecycle|data_preview)"
|
|
4368
|
+
},
|
|
4369
|
+
{
|
|
4370
|
+
event: "PostToolUse",
|
|
4371
|
+
script: "telemetry-post-tool.mjs",
|
|
4372
|
+
/* Telemetry only meaningful for the SAP MCP server itself.
|
|
4373
|
+
* The matcher must align with the server name registered in
|
|
4374
|
+
* .mcp.json — currently `sap_mcp_server` per the canonical
|
|
4375
|
+
* `claude mcp add --transport http sap_mcp_server ...` command
|
|
4376
|
+
* declared in data/wizard-options/mcp-servers.json. If that key
|
|
4377
|
+
* is renamed, this regex needs to follow. */
|
|
4378
|
+
matcher: "mcp__sap_mcp_server__.*"
|
|
4379
|
+
},
|
|
4380
|
+
{
|
|
4381
|
+
event: "PostToolUseFailure",
|
|
4382
|
+
script: "telemetry-post-tool-failure.mjs",
|
|
4383
|
+
matcher: "mcp__sap_mcp_server__.*"
|
|
4384
|
+
},
|
|
4364
4385
|
{ event: "SessionStart", script: "telemetry-session-start.mjs" },
|
|
4365
4386
|
{ event: "SessionEnd", script: "telemetry-session-end.mjs" }
|
|
4366
4387
|
];
|
|
@@ -4449,7 +4470,11 @@ async function fetchAbapHooks(token, repo, targetDir, agent) {
|
|
|
4449
4470
|
* resulting command is exactly `node .claude/hooks/<script>`,
|
|
4450
4471
|
* matching the form Claude Code already uses for Factory hooks. */
|
|
4451
4472
|
command: `node {hookDir}/${d.script}`,
|
|
4452
|
-
script: d.script
|
|
4473
|
+
script: d.script,
|
|
4474
|
+
/* The runner copies the matcher straight into the merged JSON
|
|
4475
|
+
* entry. Omitted when undefined so session-level hooks don't
|
|
4476
|
+
* carry a useless `matcher` field. */
|
|
4477
|
+
...d.matcher ? { matcher: d.matcher } : {}
|
|
4453
4478
|
})),
|
|
4454
4479
|
{ type: "instructions-snippet", content: INSTRUCTIONS_SNIPPET }
|
|
4455
4480
|
];
|