xtrm-tools 2.2.0 → 2.3.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/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-cli",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -1,6 +1,5 @@
1
- import type { ExtensionAPI, ToolCallEvent, ToolResultEvent } from "@mariozechner/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
2
  import { isToolCallEventType, isBashToolResult } from "@mariozechner/pi-coding-agent";
3
- import * as path from "node:path";
4
3
  import { SubprocessRunner, EventAdapter, Logger } from "./core/lib";
5
4
 
6
5
  const logger = new Logger({ namespace: "beads" });
@@ -115,14 +114,19 @@ export default function (pi: ExtensionAPI) {
115
114
  return undefined;
116
115
  });
117
116
 
118
- // Dual safety net: notify about unclosed claims when session ends
117
+ // Dual safety net: warn about unclosed claims when session ends (non-blocking)
119
118
  const notifySessionEnd = async (ctx: any) => {
120
119
  const cwd = getCwd(ctx);
121
120
  if (!EventAdapter.isBeadsProject(cwd)) return;
122
121
  const sessionId = getSessionId(ctx);
123
122
  const claim = await getSessionClaim(sessionId, cwd);
124
- if (claim && ctx.hasUI) {
125
- ctx.ui.notify(`Beads: Session ending with active claim [${claim}]`, "warning");
123
+ if (!claim) return;
124
+
125
+ const message = `Beads: session ending with active claim [${claim}]`;
126
+ if (ctx.hasUI) {
127
+ ctx.ui.notify(message, "warning");
128
+ } else {
129
+ logger.warn(message);
126
130
  }
127
131
  };
128
132
 
@@ -1,11 +1,8 @@
1
- import type { ExtensionAPI, ToolCallEvent, ToolResultEvent } from "@mariozechner/pi-coding-agent";
2
- import { isToolCallEventType, isBashToolResult } from "@mariozechner/pi-coding-agent";
3
- import { SubprocessRunner, Logger } from "./core/lib";
1
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
+ import { SubprocessRunner } from "./core/lib";
4
3
  import * as path from "node:path";
5
4
  import * as fs from "node:fs";
6
5
 
7
- const logger = new Logger({ namespace: "service-skills" });
8
-
9
6
  export default function (pi: ExtensionAPI) {
10
7
  const getCwd = (ctx: any) => ctx.cwd || process.cwd();
11
8
 
@@ -27,23 +24,33 @@ export default function (pi: ExtensionAPI) {
27
24
  });
28
25
 
29
26
 
30
- // 3. Drift Detection
27
+ const toClaudeToolName = (toolName: string): string => {
28
+ if (toolName === "bash") return "Bash";
29
+ if (toolName === "read_file") return "Read";
30
+ if (toolName === "write" || toolName === "create_text_file") return "Write";
31
+ if (toolName === "edit" || toolName === "replace_content" || toolName === "replace_lines" || toolName === "insert_at_line" || toolName === "delete_lines") return "Edit";
32
+ if (toolName === "search_for_pattern") return "Grep";
33
+ if (toolName === "find_file" || toolName === "list_dir") return "Glob";
34
+ return toolName;
35
+ };
36
+
37
+ // 2. Drift Detection (skill activation is before_agent_start only — not per-tool)
31
38
  pi.on("tool_result", async (event, ctx) => {
32
39
  const cwd = getCwd(ctx);
33
40
  const driftDetectorPath = path.join(cwd, ".claude", "skills", "updating-service-skills", "scripts", "drift_detector.py");
34
41
  if (!fs.existsSync(driftDetectorPath)) return undefined;
35
42
 
36
43
  const hookInput = JSON.stringify({
37
- tool_name: event.toolName === "bash" ? "Bash" : event.toolName,
44
+ tool_name: toClaudeToolName(event.toolName),
38
45
  tool_input: event.input,
39
- cwd: cwd
46
+ cwd,
40
47
  });
41
48
 
42
49
  const result = await SubprocessRunner.run("python3", [driftDetectorPath], {
43
50
  cwd,
44
51
  input: hookInput,
45
52
  env: { ...process.env, CLAUDE_PROJECT_DIR: cwd },
46
- timeoutMs: 10000
53
+ timeoutMs: 10000,
47
54
  });
48
55
 
49
56
  if (result.code === 0 && result.stdout.trim()) {
@@ -51,6 +58,7 @@ export default function (pi: ExtensionAPI) {
51
58
  newContent.push({ type: "text", text: "\n\n" + result.stdout.trim() });
52
59
  return { content: newContent };
53
60
  }
61
+
54
62
  return undefined;
55
63
  });
56
64
  }
@@ -36,6 +36,7 @@
36
36
  "packages": [
37
37
  "npm:@aliou/pi-guardrails",
38
38
  "npm:pi-gitnexus",
39
- "npm:pi-serena-tools"
39
+ "npm:pi-serena-tools",
40
+ "npm:@zenobius/pi-worktrees"
40
41
  ]
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-tools",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "license": "MIT",
6
6
  "type": "module",