@dreki-gg/pi-lsp 0.1.2 → 0.2.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,17 @@
1
1
  # @dreki-gg/pi-lsp
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`d1c6d0b`](https://github.com/dreki-gg/pi-extensions/commit/d1c6d0b7da843700a7381790d9323f78dd26b152) Thanks [@jalbarrang](https://github.com/jalbarrang)! - Add Windows support for the LSP extension: spawn with `shell: true` on win32 for `.cmd` wrappers, use `where` instead of `which` for command lookup, normalize file URIs with `file:///` and forward slashes for drive-letter paths per RFC 8089, and fix `uriToPath` to correctly round-trip Windows URIs.
8
+
9
+ ## 0.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`d133c3d`](https://github.com/dreki-gg/pi-extensions/commit/d133c3da917e7e5def568d27d6cde8ae8a6c00d2) Thanks [@jalbarrang](https://github.com/jalbarrang)! - Mark pi peer dependencies as optional so npm does not auto-install pi internals when installing extension packages.
14
+
3
15
  ## 0.1.2
4
16
 
5
17
  ### Patch Changes
@@ -29,12 +29,19 @@ import type {
29
29
  // ── Helpers ─────────────────────────────────────────────────────────────────
30
30
 
31
31
  export function pathToUri(filePath: string): string {
32
- const abs = filePath.startsWith('/') ? filePath : resolve(filePath);
33
- return `file://${abs}`;
32
+ const abs = resolve(filePath);
33
+ const normalized = abs.replace(/\\/g, '/');
34
+ // Windows paths need file:///C:/... (three slashes)
35
+ if (/^[A-Za-z]:/.test(normalized)) return `file:///${normalized}`;
36
+ return `file://${normalized}`;
34
37
  }
35
38
 
36
39
  export function uriToPath(uri: string): string {
37
- return uri.startsWith('file://') ? uri.slice(7) : uri;
40
+ if (!uri.startsWith('file://')) return uri;
41
+ const path = uri.slice(7);
42
+ // Remove leading slash before Windows drive letter: /C:/... → C:/...
43
+ if (/^\/[A-Za-z]:/.test(path)) return path.slice(1);
44
+ return path;
38
45
  }
39
46
 
40
47
  function languageIdForFile(filePath: string): string {
@@ -76,7 +76,8 @@ async function loadJsonFile<T>(path: string): Promise<T | null> {
76
76
 
77
77
  function commandAvailableVia(command: string, cwd: string): 'global' | 'npx' | null {
78
78
  try {
79
- execSync(`which ${command}`, { stdio: 'pipe', timeout: 5_000 });
79
+ const whichCmd = process.platform === 'win32' ? 'where' : 'which';
80
+ execSync(`${whichCmd} ${command}`, { stdio: 'pipe', timeout: 5_000 });
80
81
  return 'global';
81
82
  } catch {
82
83
  // not global
@@ -9,7 +9,7 @@
9
9
  * Any LSP server can be added via config.
10
10
  */
11
11
 
12
- import type { ExtensionAPI } from '@mariozechner/pi-coding-agent';
12
+ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
13
13
 
14
14
  import { LspClient } from './client';
15
15
  import { loadConfig, scaffoldGlobalConfig, serversForExtension, type LoadedConfig } from './config';
@@ -43,6 +43,7 @@ export class LspConnection {
43
43
  stdio: ['pipe', 'pipe', 'pipe'],
44
44
  cwd: this.options?.cwd,
45
45
  env: { ...process.env, ...this.options?.env },
46
+ shell: process.platform === 'win32',
46
47
  });
47
48
 
48
49
  this.process.stdout!.on('data', (chunk: Buffer) => {
@@ -4,9 +4,9 @@
4
4
  * 11 operations routed to the right server by file extension.
5
5
  */
6
6
 
7
- import type { ExtensionAPI } from '@mariozechner/pi-coding-agent';
7
+ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
8
8
  import { Type } from 'typebox';
9
- import { StringEnum } from '@mariozechner/pi-ai';
9
+ import { StringEnum } from '@earendil-works/pi-ai';
10
10
 
11
11
  import type { LspClient } from './client';
12
12
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreki-gg/pi-lsp",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Language-agnostic LSP code intelligence for pi — diagnostics, hover, definitions, references, symbols, and call hierarchy",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -26,7 +26,7 @@
26
26
  ]
27
27
  },
28
28
  "devDependencies": {
29
- "@mariozechner/pi-ai": "^0.69.0",
29
+ "@earendil-works/pi-ai": "^0.74.0",
30
30
  "@types/node": "24",
31
31
  "bun-types": "latest",
32
32
  "oxfmt": "^0.43.0",
@@ -35,8 +35,19 @@
35
35
  "typescript-language-server": "^5.1.3"
36
36
  },
37
37
  "peerDependencies": {
38
- "@mariozechner/pi-ai": "*",
39
- "@mariozechner/pi-coding-agent": "*",
38
+ "@earendil-works/pi-ai": "*",
39
+ "@earendil-works/pi-coding-agent": "*",
40
40
  "typebox": "*"
41
+ },
42
+ "peerDependenciesMeta": {
43
+ "@earendil-works/pi-ai": {
44
+ "optional": true
45
+ },
46
+ "@earendil-works/pi-coding-agent": {
47
+ "optional": true
48
+ },
49
+ "typebox": {
50
+ "optional": true
51
+ }
41
52
  }
42
53
  }
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
 
3
3
  import { registerLspTool } from '../extensions/lsp/tools';
4
- import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
4
+ import type { ToolDefinition } from '@earendil-works/pi-coding-agent';
5
5
 
6
6
  function captureTool() {
7
7
  let tool: ToolDefinition<any, any> | null = null;