@dreki-gg/pi-lsp 0.1.0 → 0.1.2
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 +24 -0
- package/extensions/lsp/index.ts +37 -15
- package/extensions/lsp/tools.ts +1 -1
- package/package.json +4 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @dreki-gg/pi-lsp
|
|
2
|
+
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0be7b68`](https://github.com/dreki-gg/pi-extensions/commit/0be7b6877e9874b46c756b58c99d599db623ef11) Thanks [@jalbarrang](https://github.com/jalbarrang)! - Migrate TypeBox usage and session replacement flows for Pi 0.69 compatibility.
|
|
8
|
+
|
|
9
|
+
- switch extension imports from `@sinclair/typebox` to `typebox`
|
|
10
|
+
- update package peer dependencies to require `typebox`
|
|
11
|
+
- move subagent `/run-agent` fork-at follow-up work into `withSession` so post-fork operations use the replacement session safely
|
|
12
|
+
- add command argument completions for `/run-agent`, `/delegate-agents`, `/preset`, `/mode`, and `/plan`
|
|
13
|
+
- align local development dependencies with Pi 0.69 for typechecking and compatibility checks
|
|
14
|
+
|
|
15
|
+
## 0.1.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`2a5bccb`](https://github.com/dreki-gg/pi-extensions/commit/2a5bccb2d2d663574d03e6e72bf6fcb2cdabc051) Thanks [@jalbarrang](https://github.com/jalbarrang)! - Fix stale LSP footer status so it stays in sync with detected/configured servers.
|
|
20
|
+
|
|
21
|
+
- refresh footer status on session start from the resolved config
|
|
22
|
+
- refresh footer status when running `/lsp`
|
|
23
|
+
- refresh footer status after `/lsp-restart`
|
|
24
|
+
- refresh footer status after `lsp` tool execution so running servers are reflected in the UI
|
package/extensions/lsp/index.ts
CHANGED
|
@@ -38,6 +38,34 @@ export default function lspExtension(pi: ExtensionAPI) {
|
|
|
38
38
|
clients.clear();
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
function refreshStatus(
|
|
42
|
+
ui: { setStatus: (key: string, value: string) => void },
|
|
43
|
+
cfg: LoadedConfig | null,
|
|
44
|
+
) {
|
|
45
|
+
if (!cfg) {
|
|
46
|
+
ui.setStatus('lsp', 'LSP: no servers detected');
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (cfg.globalDisabled) {
|
|
51
|
+
ui.setStatus('lsp', 'LSP: disabled');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (cfg.servers.length === 0) {
|
|
56
|
+
ui.setStatus('lsp', 'LSP: no servers detected');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const running = cfg.servers.filter((server) => clients.get(server.name)?.isInitialized);
|
|
61
|
+
if (running.length > 0) {
|
|
62
|
+
ui.setStatus('lsp', `LSP: ${running.map((s) => s.name).join(', ')} (running)`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
ui.setStatus('lsp', `LSP: ${cfg.servers.map((s) => s.name).join(', ')}`);
|
|
67
|
+
}
|
|
68
|
+
|
|
41
69
|
// ── Server manager (passed to tool) ───────────────────────────────────
|
|
42
70
|
|
|
43
71
|
const serverManager: ServerManager = {
|
|
@@ -92,21 +120,7 @@ export default function lspExtension(pi: ExtensionAPI) {
|
|
|
92
120
|
}
|
|
93
121
|
|
|
94
122
|
config = await loadConfig(rootPath);
|
|
95
|
-
|
|
96
|
-
if (config.globalDisabled) {
|
|
97
|
-
ctx.ui.setStatus('lsp', 'LSP: disabled');
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const parts: string[] = [];
|
|
102
|
-
for (const server of config.servers) {
|
|
103
|
-
parts.push(server.name);
|
|
104
|
-
}
|
|
105
|
-
if (parts.length > 0) {
|
|
106
|
-
ctx.ui.setStatus('lsp', `LSP: ${parts.join(', ')}`);
|
|
107
|
-
} else {
|
|
108
|
-
ctx.ui.setStatus('lsp', 'LSP: no servers detected');
|
|
109
|
-
}
|
|
123
|
+
refreshStatus(ctx.ui, config);
|
|
110
124
|
});
|
|
111
125
|
|
|
112
126
|
pi.on('session_shutdown', async () => {
|
|
@@ -114,6 +128,11 @@ export default function lspExtension(pi: ExtensionAPI) {
|
|
|
114
128
|
config = null;
|
|
115
129
|
});
|
|
116
130
|
|
|
131
|
+
pi.on('tool_execution_end', async (event, ctx) => {
|
|
132
|
+
if (event.toolName !== 'lsp') return;
|
|
133
|
+
refreshStatus(ctx.ui, config);
|
|
134
|
+
});
|
|
135
|
+
|
|
117
136
|
// ── Commands ──────────────────────────────────────────────────────────
|
|
118
137
|
|
|
119
138
|
pi.registerCommand('lsp', {
|
|
@@ -121,6 +140,8 @@ export default function lspExtension(pi: ExtensionAPI) {
|
|
|
121
140
|
handler: async (_args, ctx) => {
|
|
122
141
|
rootPath = ctx.cwd;
|
|
123
142
|
const cfg = await loadConfig(ctx.cwd);
|
|
143
|
+
config = cfg;
|
|
144
|
+
refreshStatus(ctx.ui, cfg);
|
|
124
145
|
const lines: string[] = ['LSP Status:'];
|
|
125
146
|
|
|
126
147
|
if (cfg.globalDisabled) {
|
|
@@ -153,6 +174,7 @@ export default function lspExtension(pi: ExtensionAPI) {
|
|
|
153
174
|
config = null;
|
|
154
175
|
rootPath = ctx.cwd;
|
|
155
176
|
config = await loadConfig(ctx.cwd);
|
|
177
|
+
refreshStatus(ctx.ui, config);
|
|
156
178
|
ctx.ui.notify('LSP servers stopped. Will reinitialize on next tool use.', 'info');
|
|
157
179
|
},
|
|
158
180
|
});
|
package/extensions/lsp/tools.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreki-gg/pi-lsp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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,6 +26,7 @@
|
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@mariozechner/pi-ai": "^0.69.0",
|
|
29
30
|
"@types/node": "24",
|
|
30
31
|
"bun-types": "latest",
|
|
31
32
|
"oxfmt": "^0.43.0",
|
|
@@ -34,7 +35,8 @@
|
|
|
34
35
|
"typescript-language-server": "^5.1.3"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
38
|
+
"@mariozechner/pi-ai": "*",
|
|
37
39
|
"@mariozechner/pi-coding-agent": "*",
|
|
38
|
-
"
|
|
40
|
+
"typebox": "*"
|
|
39
41
|
}
|
|
40
42
|
}
|