xtrm-tools 0.5.31 → 0.5.32

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-tools",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "description": "xtrm-tools: dual-runtime workflow enforcement (Claude Code + Pi) — hooks, extensions, skills, and MCP servers",
5
5
  "author": {
6
6
  "name": "jaggers"
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-cli",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -3,15 +3,18 @@ import { spawnSync, execSync } from "node:child_process";
3
3
  import * as fs from "node:fs";
4
4
  import * as path from "node:path";
5
5
 
6
+ type InstallMethod =
7
+ | { type: "npm"; packages: string[] }
8
+ | { type: "go"; module: string }
9
+ | { type: "rustup"; component: string }
10
+ | { type: "brew"; formula: string }
11
+ | { type: "system"; hint: string };
12
+
6
13
  interface LspTarget {
7
- /** Marker files that indicate this language is in use */
14
+ label: string;
8
15
  markers: string[];
9
- /** Binary to check in PATH */
10
16
  bin: string;
11
- /** npm packages to install globally if bin is missing */
12
- npmPackages: string[];
13
- /** Human-readable label */
14
- label: string;
17
+ install: InstallMethod;
15
18
  }
16
19
 
17
20
  const TARGETS: LspTarget[] = [
@@ -19,25 +22,49 @@ const TARGETS: LspTarget[] = [
19
22
  label: "TypeScript/JavaScript",
20
23
  markers: ["tsconfig.json", "package.json"],
21
24
  bin: "typescript-language-server",
22
- npmPackages: ["typescript-language-server", "typescript"],
25
+ install: { type: "npm", packages: ["typescript-language-server", "typescript"] },
23
26
  },
24
27
  {
25
28
  label: "Python",
26
29
  markers: ["pyproject.toml", "requirements.txt", "setup.py"],
27
30
  bin: "pyright-langserver",
28
- npmPackages: ["pyright"],
31
+ install: { type: "npm", packages: ["pyright"] },
29
32
  },
30
33
  {
31
34
  label: "Vue",
32
35
  markers: ["vue.config.js", "vite.config.ts", "vite.config.js"],
33
36
  bin: "vue-language-server",
34
- npmPackages: ["@vue/language-server"],
37
+ install: { type: "npm", packages: ["@vue/language-server"] },
35
38
  },
36
39
  {
37
40
  label: "Svelte",
38
41
  markers: ["svelte.config.js", "svelte.config.ts"],
39
42
  bin: "svelteserver",
40
- npmPackages: ["svelte-language-server"],
43
+ install: { type: "npm", packages: ["svelte-language-server"] },
44
+ },
45
+ {
46
+ label: "Go",
47
+ markers: ["go.mod"],
48
+ bin: "gopls",
49
+ install: { type: "go", module: "golang.org/x/tools/gopls@latest" },
50
+ },
51
+ {
52
+ label: "Rust",
53
+ markers: ["Cargo.toml"],
54
+ bin: "rust-analyzer",
55
+ install: { type: "rustup", component: "rust-analyzer" },
56
+ },
57
+ {
58
+ label: "Kotlin",
59
+ markers: ["build.gradle", "build.gradle.kts", "settings.gradle", "settings.gradle.kts", "pom.xml"],
60
+ bin: "kotlin-language-server",
61
+ install: { type: "brew", formula: "JetBrains/utils/kotlin-lsp" },
62
+ },
63
+ {
64
+ label: "Swift",
65
+ markers: ["Package.swift"],
66
+ bin: "sourcekit-lsp",
67
+ install: { type: "system", hint: "sourcekit-lsp is bundled with Xcode — install Xcode or Command Line Tools: xcode-select --install" },
41
68
  },
42
69
  ];
43
70
 
@@ -56,13 +83,33 @@ function detectTargets(cwd: string): LspTarget[] {
56
83
  );
57
84
  }
58
85
 
59
- function installPackages(packages: string[], ctx: any): void {
60
- const r = spawnSync("npm", ["install", "-g", ...packages], {
61
- encoding: "utf8",
62
- stdio: "pipe",
63
- });
86
+ function runInstall(target: LspTarget, ctx: any): void {
87
+ const { install } = target;
88
+ let cmd: string[];
89
+ let fallback: string;
90
+
91
+ if (install.type === "npm") {
92
+ cmd = ["npm", "install", "-g", ...install.packages];
93
+ fallback = `npm install -g ${install.packages.join(" ")}`;
94
+ } else if (install.type === "go") {
95
+ cmd = ["go", "install", install.module];
96
+ fallback = `go install ${install.module}`;
97
+ } else if (install.type === "rustup") {
98
+ cmd = ["rustup", "component", "add", install.component];
99
+ fallback = `rustup component add ${install.component}`;
100
+ } else if (install.type === "brew") {
101
+ cmd = ["brew", "install", install.formula];
102
+ fallback = `brew install ${install.formula}`;
103
+ } else {
104
+ // system — cannot auto-install, just warn
105
+ ctx.ui.notify(`lsp-bootstrap: ${target.label} LSP not found — ${install.hint}`, "warning");
106
+ return;
107
+ }
108
+
109
+ ctx.ui.notify(`lsp-bootstrap: installing ${target.label} language server…`, "info");
110
+ const r = spawnSync(cmd[0], cmd.slice(1), { encoding: "utf8", stdio: "pipe" });
64
111
  if (r.status !== 0) {
65
- ctx.ui.notify(`lsp-bootstrap: failed to install ${packages.join(" ")} — run manually: npm install -g ${packages.join(" ")}`, "warning");
112
+ ctx.ui.notify(`lsp-bootstrap: failed to install ${target.label} — run manually: ${fallback}`, "warning");
66
113
  }
67
114
  }
68
115
 
@@ -72,17 +119,16 @@ export default function register(api: ExtensionAPI) {
72
119
  const detected = detectTargets(cwd);
73
120
  if (detected.length === 0) return;
74
121
 
75
- const toInstall = detected.filter(t => !isInPath(t.bin));
76
- if (toInstall.length === 0) return;
122
+ const missing = detected.filter(t => !isInPath(t.bin));
123
+ if (missing.length === 0) return;
77
124
 
78
- for (const target of toInstall) {
79
- ctx.ui.notify(`lsp-bootstrap: installing ${target.label} language server (${target.npmPackages.join(", ")})…`, "info");
80
- installPackages(target.npmPackages, ctx);
125
+ for (const target of missing) {
126
+ runInstall(target, ctx);
81
127
  }
82
128
 
83
- const installed = toInstall.filter(t => isInPath(t.bin)).map(t => t.label);
84
- if (installed.length > 0) {
85
- ctx.ui.notify(`lsp-bootstrap: ready — ${installed.join(", ")}`, "info");
129
+ const nowReady = missing.filter(t => isInPath(t.bin)).map(t => t.label);
130
+ if (nowReady.length > 0) {
131
+ ctx.ui.notify(`lsp-bootstrap: ready — ${nowReady.join(", ")}`, "info");
86
132
  }
87
133
  });
88
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-tools",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-tools",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "description": "xtrm-tools: dual-runtime workflow enforcement (Claude Code + Pi) — hooks, extensions, skills, and MCP servers",
5
5
  "author": {
6
6
  "name": "jaggers"