@jiangxiaoxu/lm-tools-bridge-proxy 0.1.15 → 0.1.16
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/dist/index.js +13 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -244,6 +244,18 @@ function logDebug(tag, payload) {
|
|
|
244
244
|
}
|
|
245
245
|
appendLog(`[${tag}] ${JSON.stringify(payload)}`);
|
|
246
246
|
}
|
|
247
|
+
function getProxyVersion() {
|
|
248
|
+
try {
|
|
249
|
+
const pkgPath = import_node_path.default.resolve(__dirname, "..", "package.json");
|
|
250
|
+
const text = import_node_fs.default.readFileSync(pkgPath, "utf8");
|
|
251
|
+
const parsed = JSON.parse(text);
|
|
252
|
+
if (parsed && typeof parsed.version === "string") {
|
|
253
|
+
return parsed.version;
|
|
254
|
+
}
|
|
255
|
+
} catch {
|
|
256
|
+
}
|
|
257
|
+
return "unknown";
|
|
258
|
+
}
|
|
247
259
|
function createStdioMessageHandler(targetGetter, targetRefresher, stateGetter) {
|
|
248
260
|
return async (message) => {
|
|
249
261
|
const state = stateGetter();
|
|
@@ -585,6 +597,7 @@ async function main() {
|
|
|
585
597
|
let workspaceMatched2 = false;
|
|
586
598
|
let offlineSince2;
|
|
587
599
|
let reconnectTimer;
|
|
600
|
+
appendLog(`lm-tools-bridge-proxy version=${getProxyVersion()}`);
|
|
588
601
|
let currentTarget2;
|
|
589
602
|
let resolveInFlight;
|
|
590
603
|
const refreshTarget = async (deadlineMs) => {
|