pybao-cli 1.4.13 → 1.4.15
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/REPL-3X2W4SUH.js +47 -0
- package/dist/{acp-AITGGIN7.js → acp-RPMY76QL.js} +29 -29
- package/dist/{agentsValidate-K3GLHEUJ.js → agentsValidate-PX32PNPA.js} +7 -7
- package/dist/{ask-XRAJ7ONM.js → ask-P3GOQDEX.js} +28 -28
- package/dist/{autoUpdater-2YW234FZ.js → autoUpdater-R4EXAJ7P.js} +3 -3
- package/dist/{chunk-VFAFA24S.js → chunk-2GNIL5UE.js} +3 -3
- package/dist/{chunk-S45DDLGG.js → chunk-2WZXH6PI.js} +3 -3
- package/dist/{chunk-XJZQD7RE.js → chunk-2WZY23LE.js} +26 -19
- package/dist/chunk-2WZY23LE.js.map +7 -0
- package/dist/{chunk-RHY3RRE6.js → chunk-33NX2JEV.js} +2 -2
- package/dist/{chunk-UDNZNXXR.js → chunk-37NXYZZP.js} +3 -3
- package/dist/{chunk-VGDDQSCO.js → chunk-3D4D72TA.js} +1 -1
- package/dist/{chunk-ZOM357PV.js → chunk-4E4ZHEYH.js} +2 -2
- package/dist/{chunk-FMH4U7NO.js → chunk-4YNWFMHH.js} +1 -1
- package/dist/{chunk-PHKBTCLT.js → chunk-5N64T4FL.js} +2 -2
- package/dist/{chunk-QKB32NDM.js → chunk-5TAP3RGJ.js} +2 -2
- package/dist/{chunk-CPE4NPQV.js → chunk-6RKXEEHI.js} +2 -2
- package/dist/{chunk-OOTTUF6Z.js → chunk-BB7V4QKI.js} +1 -1
- package/dist/{chunk-2PC7UK66.js → chunk-BUEOTCMA.js} +3 -3
- package/dist/{chunk-Y3UMGUVE.js → chunk-C6ZACFHI.js} +1 -1
- package/dist/{chunk-CFTVDXFH.js → chunk-EASHVVK6.js} +3 -3
- package/dist/{chunk-BTS2TAAW.js → chunk-ELWN7R7M.js} +4 -4
- package/dist/{chunk-5WXWY6LV.js → chunk-IB6KSWDZ.js} +3 -3
- package/dist/{chunk-CVJLF2VG.js → chunk-L3W3K3QU.js} +191 -52
- package/dist/chunk-L3W3K3QU.js.map +7 -0
- package/dist/{chunk-TWPWHWJT.js → chunk-LOOXNX5Y.js} +4 -4
- package/dist/{chunk-M7QSGOTT.js → chunk-MRMEHFMO.js} +1 -1
- package/dist/{chunk-OX4Q6Z5R.js → chunk-NA7ROPOY.js} +3 -3
- package/dist/{chunk-CXT225X7.js → chunk-ONPK4QYB.js} +2 -2
- package/dist/{chunk-HCN7LMEB.js → chunk-PD6OTVLV.js} +1 -1
- package/dist/{chunk-6OP2JTUK.js → chunk-PVPXTCJH.js} +1 -1
- package/dist/{chunk-6OP2JTUK.js.map → chunk-PVPXTCJH.js.map} +1 -1
- package/dist/{chunk-P7MPKAPW.js → chunk-THJLROJB.js} +1 -1
- package/dist/{chunk-NG5RU74R.js → chunk-TJOLXDG6.js} +4 -4
- package/dist/{chunk-34XEWGUY.js → chunk-UO5X5SXI.js} +2 -1
- package/dist/{chunk-O5PGBSLH.js → chunk-YV4PKPBH.js} +2 -2
- package/dist/{chunk-V337ZSSD.js → chunk-YY4XF7AZ.js} +92 -59
- package/dist/chunk-YY4XF7AZ.js.map +7 -0
- package/dist/{chunk-FT5UM6YL.js → chunk-ZTVPEF2F.js} +1 -1
- package/dist/{cli-MXO677IA.js → cli-GPDT2IJU.js} +91 -89
- package/dist/{cli-MXO677IA.js.map → cli-GPDT2IJU.js.map} +2 -2
- package/dist/commands-YV373ZFU.js +51 -0
- package/dist/{config-YFZ2WAYP.js → config-LWY7BZXJ.js} +4 -4
- package/dist/{context-OOIFZD5B.js → context-5AE67GYL.js} +6 -6
- package/dist/{customCommands-C5UREHC4.js → customCommands-7UNIEUFP.js} +4 -4
- package/dist/{env-LQJ2XZDO.js → env-EFQJVSUY.js} +2 -2
- package/dist/{file-ZBIAG7X4.js → file-VRVRLDK2.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-RCNWJH2C.js → llm-6BUSXSBZ.js} +29 -29
- package/dist/{llmLazy-KXJFFPMF.js → llmLazy-6WFEDUPC.js} +1 -1
- package/dist/{loader-ENRLCLHZ.js → loader-HQ56KK4K.js} +4 -4
- package/dist/{lsp-VWL3PVQJ.js → lsp-4GTQX6SE.js} +6 -6
- package/dist/{lspAnchor-WPJIG2RI.js → lspAnchor-4IEM6SQM.js} +8 -8
- package/dist/lspAnchor-4IEM6SQM.js.map +7 -0
- package/dist/{mcp-P5T4TUW2.js → mcp-RFRGVPYG.js} +7 -7
- package/dist/{mentionProcessor-4ICD3GVH.js → mentionProcessor-J4U4MFY5.js} +5 -5
- package/dist/{messages-SEOXF7DS.js → messages-5JAJG44H.js} +1 -1
- package/dist/{model-YOPR5KUS.js → model-VR6QZCYI.js} +5 -5
- package/dist/{openai-FVFZDXPS.js → openai-LUD3GHJ5.js} +5 -5
- package/dist/{outputStyles-7ZZ2JBOT.js → outputStyles-TJM65BMJ.js} +4 -4
- package/dist/{pluginRuntime-LASQNLIR.js → pluginRuntime-OW54XVUW.js} +6 -6
- package/dist/{pluginValidation-4BABNGAC.js → pluginValidation-X2LVT22X.js} +6 -6
- package/dist/prompts-KTT5FAYF.js +53 -0
- package/dist/{pybAgentSessionLoad-O7V7I7CV.js → pybAgentSessionLoad-YI2EVD6F.js} +4 -4
- package/dist/{pybAgentSessionResume-Q7EYAD6H.js → pybAgentSessionResume-VJIKNW7O.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-N374RMH5.js → pybAgentStreamJsonSession-6DZUR3ME.js} +1 -1
- package/dist/{pybHooks-MHFEMZC6.js → pybHooks-U24NOHX7.js} +4 -4
- package/dist/query-PSDZBJSO.js +55 -0
- package/dist/{registry-KVMGHJ4N.js → registry-2U2WP7ZB.js} +5 -5
- package/dist/{ripgrep-XSJJZ3W3.js → ripgrep-EO24IKYT.js} +3 -3
- package/dist/{skillMarketplace-FL7XBTHJ.js → skillMarketplace-CAGSV3Z6.js} +3 -3
- package/dist/{state-5NJOFKYB.js → state-56C2ROYY.js} +2 -2
- package/dist/{theme-Z26AKEVC.js → theme-DYILR2QC.js} +5 -5
- package/dist/{toolPermissionSettings-SPSMAX5P.js → toolPermissionSettings-ZPBRNODI.js} +6 -6
- package/dist/tools-M4GJRWEU.js +52 -0
- package/dist/{userInput-3TEMRAK7.js → userInput-3A7OKG4S.js} +30 -30
- package/package.json +1 -1
- package/dist/REPL-634DFL57.js +0 -47
- package/dist/chunk-CVJLF2VG.js.map +0 -7
- package/dist/chunk-V337ZSSD.js.map +0 -7
- package/dist/chunk-XJZQD7RE.js.map +0 -7
- package/dist/commands-Q5LUFGJ5.js +0 -51
- package/dist/lspAnchor-WPJIG2RI.js.map +0 -7
- package/dist/prompts-DJNSFFKV.js +0 -53
- package/dist/query-LAUPI7JK.js +0 -55
- package/dist/tools-Q44D6ZG7.js +0 -52
- /package/dist/{REPL-634DFL57.js.map → REPL-3X2W4SUH.js.map} +0 -0
- /package/dist/{acp-AITGGIN7.js.map → acp-RPMY76QL.js.map} +0 -0
- /package/dist/{agentsValidate-K3GLHEUJ.js.map → agentsValidate-PX32PNPA.js.map} +0 -0
- /package/dist/{ask-XRAJ7ONM.js.map → ask-P3GOQDEX.js.map} +0 -0
- /package/dist/{autoUpdater-2YW234FZ.js.map → autoUpdater-R4EXAJ7P.js.map} +0 -0
- /package/dist/{chunk-VFAFA24S.js.map → chunk-2GNIL5UE.js.map} +0 -0
- /package/dist/{chunk-S45DDLGG.js.map → chunk-2WZXH6PI.js.map} +0 -0
- /package/dist/{chunk-RHY3RRE6.js.map → chunk-33NX2JEV.js.map} +0 -0
- /package/dist/{chunk-UDNZNXXR.js.map → chunk-37NXYZZP.js.map} +0 -0
- /package/dist/{chunk-VGDDQSCO.js.map → chunk-3D4D72TA.js.map} +0 -0
- /package/dist/{chunk-ZOM357PV.js.map → chunk-4E4ZHEYH.js.map} +0 -0
- /package/dist/{chunk-FMH4U7NO.js.map → chunk-4YNWFMHH.js.map} +0 -0
- /package/dist/{chunk-PHKBTCLT.js.map → chunk-5N64T4FL.js.map} +0 -0
- /package/dist/{chunk-QKB32NDM.js.map → chunk-5TAP3RGJ.js.map} +0 -0
- /package/dist/{chunk-CPE4NPQV.js.map → chunk-6RKXEEHI.js.map} +0 -0
- /package/dist/{chunk-OOTTUF6Z.js.map → chunk-BB7V4QKI.js.map} +0 -0
- /package/dist/{chunk-2PC7UK66.js.map → chunk-BUEOTCMA.js.map} +0 -0
- /package/dist/{chunk-Y3UMGUVE.js.map → chunk-C6ZACFHI.js.map} +0 -0
- /package/dist/{chunk-CFTVDXFH.js.map → chunk-EASHVVK6.js.map} +0 -0
- /package/dist/{chunk-BTS2TAAW.js.map → chunk-ELWN7R7M.js.map} +0 -0
- /package/dist/{chunk-5WXWY6LV.js.map → chunk-IB6KSWDZ.js.map} +0 -0
- /package/dist/{chunk-TWPWHWJT.js.map → chunk-LOOXNX5Y.js.map} +0 -0
- /package/dist/{chunk-M7QSGOTT.js.map → chunk-MRMEHFMO.js.map} +0 -0
- /package/dist/{chunk-OX4Q6Z5R.js.map → chunk-NA7ROPOY.js.map} +0 -0
- /package/dist/{chunk-CXT225X7.js.map → chunk-ONPK4QYB.js.map} +0 -0
- /package/dist/{chunk-HCN7LMEB.js.map → chunk-PD6OTVLV.js.map} +0 -0
- /package/dist/{chunk-P7MPKAPW.js.map → chunk-THJLROJB.js.map} +0 -0
- /package/dist/{chunk-NG5RU74R.js.map → chunk-TJOLXDG6.js.map} +0 -0
- /package/dist/{chunk-34XEWGUY.js.map → chunk-UO5X5SXI.js.map} +0 -0
- /package/dist/{chunk-O5PGBSLH.js.map → chunk-YV4PKPBH.js.map} +0 -0
- /package/dist/{chunk-FT5UM6YL.js.map → chunk-ZTVPEF2F.js.map} +0 -0
- /package/dist/{commands-Q5LUFGJ5.js.map → commands-YV373ZFU.js.map} +0 -0
- /package/dist/{config-YFZ2WAYP.js.map → config-LWY7BZXJ.js.map} +0 -0
- /package/dist/{context-OOIFZD5B.js.map → context-5AE67GYL.js.map} +0 -0
- /package/dist/{customCommands-C5UREHC4.js.map → customCommands-7UNIEUFP.js.map} +0 -0
- /package/dist/{env-LQJ2XZDO.js.map → env-EFQJVSUY.js.map} +0 -0
- /package/dist/{file-ZBIAG7X4.js.map → file-VRVRLDK2.js.map} +0 -0
- /package/dist/{llm-RCNWJH2C.js.map → llm-6BUSXSBZ.js.map} +0 -0
- /package/dist/{llmLazy-KXJFFPMF.js.map → llmLazy-6WFEDUPC.js.map} +0 -0
- /package/dist/{loader-ENRLCLHZ.js.map → loader-HQ56KK4K.js.map} +0 -0
- /package/dist/{lsp-VWL3PVQJ.js.map → lsp-4GTQX6SE.js.map} +0 -0
- /package/dist/{mcp-P5T4TUW2.js.map → mcp-RFRGVPYG.js.map} +0 -0
- /package/dist/{mentionProcessor-4ICD3GVH.js.map → mentionProcessor-J4U4MFY5.js.map} +0 -0
- /package/dist/{messages-SEOXF7DS.js.map → messages-5JAJG44H.js.map} +0 -0
- /package/dist/{model-YOPR5KUS.js.map → model-VR6QZCYI.js.map} +0 -0
- /package/dist/{openai-FVFZDXPS.js.map → openai-LUD3GHJ5.js.map} +0 -0
- /package/dist/{outputStyles-7ZZ2JBOT.js.map → outputStyles-TJM65BMJ.js.map} +0 -0
- /package/dist/{pluginRuntime-LASQNLIR.js.map → pluginRuntime-OW54XVUW.js.map} +0 -0
- /package/dist/{pluginValidation-4BABNGAC.js.map → pluginValidation-X2LVT22X.js.map} +0 -0
- /package/dist/{prompts-DJNSFFKV.js.map → prompts-KTT5FAYF.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-O7V7I7CV.js.map → pybAgentSessionLoad-YI2EVD6F.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-Q7EYAD6H.js.map → pybAgentSessionResume-VJIKNW7O.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-N374RMH5.js.map → pybAgentStreamJsonSession-6DZUR3ME.js.map} +0 -0
- /package/dist/{pybHooks-MHFEMZC6.js.map → pybHooks-U24NOHX7.js.map} +0 -0
- /package/dist/{query-LAUPI7JK.js.map → query-PSDZBJSO.js.map} +0 -0
- /package/dist/{registry-KVMGHJ4N.js.map → registry-2U2WP7ZB.js.map} +0 -0
- /package/dist/{ripgrep-XSJJZ3W3.js.map → ripgrep-EO24IKYT.js.map} +0 -0
- /package/dist/{skillMarketplace-FL7XBTHJ.js.map → skillMarketplace-CAGSV3Z6.js.map} +0 -0
- /package/dist/{state-5NJOFKYB.js.map → state-56C2ROYY.js.map} +0 -0
- /package/dist/{theme-Z26AKEVC.js.map → theme-DYILR2QC.js.map} +0 -0
- /package/dist/{toolPermissionSettings-SPSMAX5P.js.map → toolPermissionSettings-ZPBRNODI.js.map} +0 -0
- /package/dist/{tools-Q44D6ZG7.js.map → tools-M4GJRWEU.js.map} +0 -0
- /package/dist/{userInput-3TEMRAK7.js.map → userInput-3A7OKG4S.js.map} +0 -0
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
} from "./chunk-ERMQRV55.js";
|
|
7
7
|
import {
|
|
8
8
|
getGlobalConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BUEOTCMA.js";
|
|
10
10
|
import {
|
|
11
11
|
debug,
|
|
12
12
|
getCurrentRequest,
|
|
13
13
|
logAPIError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3D4D72TA.js";
|
|
15
15
|
|
|
16
16
|
// src/services/ai/openai.ts
|
|
17
17
|
import { ProxyAgent, fetch } from "undici";
|
|
@@ -2,11 +2,11 @@ import { createRequire as __pybCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __pybCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
listAllContentFiles
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZTVPEF2F.js";
|
|
6
6
|
import {
|
|
7
7
|
getCwd,
|
|
8
8
|
logError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-THJLROJB.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/fs/file.ts
|
|
12
12
|
import {
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
PLAN_SLUG_VERBS,
|
|
10
10
|
getCwd,
|
|
11
11
|
resolveXdgDataPath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-THJLROJB.js";
|
|
13
13
|
import {
|
|
14
14
|
MACRO
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PVPXTCJH.js";
|
|
16
16
|
|
|
17
17
|
// src/utils/protocol/pybAgentSessionLog.ts
|
|
18
18
|
import { execFileSync } from "child_process";
|
|
@@ -2,7 +2,7 @@ import { createRequire as __pybCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __pybCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
getSessionProjectDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6RKXEEHI.js";
|
|
6
6
|
import {
|
|
7
7
|
isUuid
|
|
8
8
|
} from "./chunk-5P7HBXTD.js";
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-RQVLBMP7.js";
|
|
6
6
|
import {
|
|
7
7
|
debug
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3D4D72TA.js";
|
|
9
9
|
import {
|
|
10
10
|
getCwd,
|
|
11
11
|
getGlobalConfigFilePath,
|
|
12
12
|
getLegacyGlobalConfigFilePath,
|
|
13
13
|
logError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-THJLROJB.js";
|
|
15
15
|
|
|
16
16
|
// src/core/config/schema.ts
|
|
17
17
|
function isAutoUpdaterStatus(value) {
|
|
@@ -688,7 +688,7 @@ function setModelPointer(pointer, modelName) {
|
|
|
688
688
|
}
|
|
689
689
|
};
|
|
690
690
|
saveGlobalConfig(updatedConfig);
|
|
691
|
-
import("./model-
|
|
691
|
+
import("./model-VR6QZCYI.js").then(({ reloadModelManager }) => {
|
|
692
692
|
reloadModelManager();
|
|
693
693
|
});
|
|
694
694
|
}
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
getSettingsFileCandidates,
|
|
9
9
|
loadSettingsWithLegacyFallback,
|
|
10
10
|
saveSettingsToPrimaryAndSyncLegacy
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UO5X5SXI.js";
|
|
12
12
|
import {
|
|
13
13
|
getCurrentProjectConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BUEOTCMA.js";
|
|
15
15
|
import {
|
|
16
16
|
getCwd,
|
|
17
17
|
logError
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-THJLROJB.js";
|
|
19
19
|
|
|
20
20
|
// src/utils/permissions/toolPermissionSettings.ts
|
|
21
21
|
function uniqueStrings(value) {
|
|
@@ -3,13 +3,13 @@ const require = __pybCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getSettingsFileCandidates,
|
|
5
5
|
loadSettingsWithLegacyFallback
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UO5X5SXI.js";
|
|
7
7
|
import {
|
|
8
8
|
getSessionPlugins
|
|
9
9
|
} from "./chunk-BJSWTHRM.js";
|
|
10
10
|
import {
|
|
11
11
|
getTheme
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4YNWFMHH.js";
|
|
13
13
|
import {
|
|
14
14
|
addMcprcServerForTesting,
|
|
15
15
|
getCurrentProjectConfig,
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
safeParseJSON,
|
|
20
20
|
saveCurrentProjectConfig,
|
|
21
21
|
saveGlobalConfig
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BUEOTCMA.js";
|
|
23
23
|
import {
|
|
24
24
|
PRODUCT_COMMAND,
|
|
25
25
|
PRODUCT_NAME,
|
|
26
26
|
getCwd,
|
|
27
27
|
logMCPError
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-THJLROJB.js";
|
|
29
29
|
|
|
30
30
|
// src/services/mcp/client.ts
|
|
31
31
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
@@ -2,15 +2,15 @@ import { createRequire as __pybCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __pybCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
loadSettingsWithLegacyFallback
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UO5X5SXI.js";
|
|
6
6
|
import {
|
|
7
7
|
debug
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3D4D72TA.js";
|
|
9
9
|
import {
|
|
10
10
|
env,
|
|
11
11
|
getCwd,
|
|
12
12
|
resolveXdgDataPath
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-THJLROJB.js";
|
|
14
14
|
import {
|
|
15
15
|
__require
|
|
16
16
|
} from "./chunk-I3J4JYES.js";
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
LspServerRegistry,
|
|
5
5
|
findNearestRoot,
|
|
6
6
|
getInstallNotices
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IB6KSWDZ.js";
|
|
8
8
|
import {
|
|
9
9
|
levenshtein
|
|
10
10
|
} from "./chunk-UZ34JEUK.js";
|
|
11
11
|
import {
|
|
12
12
|
debug
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3D4D72TA.js";
|
|
14
14
|
import {
|
|
15
15
|
getCwd
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-THJLROJB.js";
|
|
17
17
|
|
|
18
18
|
// src/lsp/index.ts
|
|
19
19
|
import { extname as extname2 } from "path";
|
|
@@ -27,6 +27,25 @@ import { createMessageConnection, StreamMessageReader, StreamMessageWriter } fro
|
|
|
27
27
|
import { spawn } from "child_process";
|
|
28
28
|
import { pathToFileURL, fileURLToPath } from "url";
|
|
29
29
|
import { EventEmitter } from "events";
|
|
30
|
+
function resolveInitTimeoutMs() {
|
|
31
|
+
const override = Number.parseInt(process.env.PYB_LSP_INIT_TIMEOUT_MS ?? "", 10);
|
|
32
|
+
if (Number.isFinite(override) && override > 0) return override;
|
|
33
|
+
return 45e3;
|
|
34
|
+
}
|
|
35
|
+
function withTimeout(promise, timeoutMs, message) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
const timer = setTimeout(() => {
|
|
38
|
+
reject(new Error(message));
|
|
39
|
+
}, timeoutMs);
|
|
40
|
+
promise.then((result) => {
|
|
41
|
+
clearTimeout(timer);
|
|
42
|
+
resolve(result);
|
|
43
|
+
}).catch((error) => {
|
|
44
|
+
clearTimeout(timer);
|
|
45
|
+
reject(error);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
30
49
|
var DiagnosticsEventBus = class {
|
|
31
50
|
debounceMs;
|
|
32
51
|
lastEventAt = /* @__PURE__ */ new Map();
|
|
@@ -214,7 +233,12 @@ var GenericLspClient = class {
|
|
|
214
233
|
if (this.initializationOptions && Object.keys(this.initializationOptions).length > 0) {
|
|
215
234
|
params.initializationOptions = this.initializationOptions;
|
|
216
235
|
}
|
|
217
|
-
const
|
|
236
|
+
const timeoutMs = resolveInitTimeoutMs();
|
|
237
|
+
const result = await withTimeout(
|
|
238
|
+
this.connection.sendRequest("initialize", params),
|
|
239
|
+
timeoutMs,
|
|
240
|
+
`LSP initialize timeout after ${timeoutMs}ms`
|
|
241
|
+
);
|
|
218
242
|
await this.connection.sendNotification("initialized", {});
|
|
219
243
|
await this.connection.sendNotification("workspace/didChangeConfiguration", {
|
|
220
244
|
settings: { yaml: { schemaStore: { enable: false }, schemas: {} } }
|
|
@@ -225,12 +249,20 @@ var GenericLspClient = class {
|
|
|
225
249
|
}
|
|
226
250
|
async shutdown() {
|
|
227
251
|
try {
|
|
228
|
-
|
|
229
|
-
|
|
252
|
+
if (this.connection) {
|
|
253
|
+
await this.connection.sendRequest("shutdown");
|
|
254
|
+
await this.connection.sendNotification("exit");
|
|
255
|
+
}
|
|
230
256
|
} catch (error) {
|
|
231
257
|
}
|
|
232
|
-
|
|
233
|
-
|
|
258
|
+
try {
|
|
259
|
+
this.connection?.dispose();
|
|
260
|
+
} catch {
|
|
261
|
+
}
|
|
262
|
+
try {
|
|
263
|
+
this.process?.kill();
|
|
264
|
+
} catch {
|
|
265
|
+
}
|
|
234
266
|
}
|
|
235
267
|
async goToDefinition(filePath, line, character) {
|
|
236
268
|
const params = {
|
|
@@ -288,12 +320,12 @@ var GenericLspClient = class {
|
|
|
288
320
|
const params = { item };
|
|
289
321
|
return this.connection.sendRequest("callHierarchy/outgoingCalls", params);
|
|
290
322
|
}
|
|
291
|
-
async didOpen(filePath, content, languageId) {
|
|
323
|
+
async didOpen(filePath, content, languageId, version = 1) {
|
|
292
324
|
const params = {
|
|
293
325
|
textDocument: {
|
|
294
326
|
uri: this.normalizeUri(filePath),
|
|
295
327
|
languageId,
|
|
296
|
-
version
|
|
328
|
+
version,
|
|
297
329
|
text: content
|
|
298
330
|
}
|
|
299
331
|
};
|
|
@@ -324,11 +356,8 @@ var GenericLspClient = class {
|
|
|
324
356
|
done = true;
|
|
325
357
|
});
|
|
326
358
|
await this.diagnosticsBus.waitForIdle(normalizedUri, timeoutMs);
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
} else {
|
|
330
|
-
unsubscribe();
|
|
331
|
-
}
|
|
359
|
+
unsubscribe();
|
|
360
|
+
return done;
|
|
332
361
|
}
|
|
333
362
|
on(event, handler) {
|
|
334
363
|
this.diagnosticEvents.on(event, handler);
|
|
@@ -392,6 +421,7 @@ var LspClientManager = class _LspClientManager {
|
|
|
392
421
|
requestMetrics = /* @__PURE__ */ new Map();
|
|
393
422
|
compareSamples = /* @__PURE__ */ new Map();
|
|
394
423
|
qualitySamples = /* @__PURE__ */ new Map();
|
|
424
|
+
fileVersions = /* @__PURE__ */ new Map();
|
|
395
425
|
constructor() {
|
|
396
426
|
}
|
|
397
427
|
static getInstance() {
|
|
@@ -534,7 +564,7 @@ var LspClientManager = class _LspClientManager {
|
|
|
534
564
|
const safeCwd = /[^\x00-\x7F]/.test(resolvedRoot) ? process.cwd() : resolvedRoot;
|
|
535
565
|
let initOpts = serverInfo.initializationOptions;
|
|
536
566
|
if (serverInfo.id === "pyright" || serverInfo.id === "ty") {
|
|
537
|
-
const { detectPythonVenv } = await import("./registry-
|
|
567
|
+
const { detectPythonVenv } = await import("./registry-2U2WP7ZB.js");
|
|
538
568
|
const pythonPath = detectPythonVenv(resolvedRoot);
|
|
539
569
|
if (pythonPath) {
|
|
540
570
|
initOpts = { ...initOpts ?? {}, pythonPath };
|
|
@@ -572,10 +602,12 @@ var LspClientManager = class _LspClientManager {
|
|
|
572
602
|
this.requestMetrics.clear();
|
|
573
603
|
this.compareSamples.clear();
|
|
574
604
|
this.qualitySamples.clear();
|
|
605
|
+
this.fileVersions.clear();
|
|
575
606
|
}
|
|
576
607
|
async workspaceSymbol(query, rootPath = getCwd(), options) {
|
|
608
|
+
await this.maybeEnsureWorkspaceClients(rootPath);
|
|
577
609
|
if (this.clients.size === 0) {
|
|
578
|
-
await this.
|
|
610
|
+
await this.ensureWorkspaceClients(rootPath);
|
|
579
611
|
}
|
|
580
612
|
const results = [];
|
|
581
613
|
for (const client of this.clients.values()) {
|
|
@@ -700,17 +732,18 @@ var LspClientManager = class _LspClientManager {
|
|
|
700
732
|
return filtered;
|
|
701
733
|
}
|
|
702
734
|
async documentSymbol(filePath, rootPath = getCwd()) {
|
|
703
|
-
const client = await this.getClient(filePath, rootPath);
|
|
704
|
-
if (!client) {
|
|
705
|
-
return null;
|
|
706
|
-
}
|
|
707
735
|
try {
|
|
708
|
-
const
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
736
|
+
const touched = await this.touchFile(filePath, rootPath, {
|
|
737
|
+
wait: true,
|
|
738
|
+
timeoutMs: 2e3
|
|
739
|
+
});
|
|
740
|
+
if (!touched) {
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
const client = await this.getClient(filePath, rootPath);
|
|
744
|
+
if (!client) {
|
|
745
|
+
return null;
|
|
746
|
+
}
|
|
714
747
|
const symbols = await client.documentSymbol(filePath);
|
|
715
748
|
return Array.isArray(symbols) ? symbols : [];
|
|
716
749
|
} catch (e) {
|
|
@@ -927,9 +960,54 @@ var LspClientManager = class _LspClientManager {
|
|
|
927
960
|
async waitForReadiness(filePath, rootPath = getCwd(), timeoutMs = 2e3) {
|
|
928
961
|
const client = await this.getClientForFile(filePath);
|
|
929
962
|
if (client) {
|
|
930
|
-
await client.waitForReadiness(filePath, timeoutMs);
|
|
931
|
-
|
|
963
|
+
const ready = await client.waitForReadiness(filePath, timeoutMs);
|
|
964
|
+
if (ready) {
|
|
965
|
+
this.readiness.set(filePath, this.now());
|
|
966
|
+
}
|
|
967
|
+
return ready;
|
|
932
968
|
}
|
|
969
|
+
return false;
|
|
970
|
+
}
|
|
971
|
+
resolveServerInfoForClient(ext, client) {
|
|
972
|
+
const serverId = client.serverId;
|
|
973
|
+
const servers = LspServerRegistry.getInstance().getServersForExtension(ext);
|
|
974
|
+
if (serverId) {
|
|
975
|
+
const match = servers.find((server) => server.id === serverId);
|
|
976
|
+
if (match) return match;
|
|
977
|
+
}
|
|
978
|
+
return LspServerRegistry.getInstance().getServerForExtension(ext) ?? servers[0];
|
|
979
|
+
}
|
|
980
|
+
getVersionKey(filePath, client) {
|
|
981
|
+
const serverKey = client.serverKey ?? client.serverId ?? "unknown";
|
|
982
|
+
return `${serverKey}::${filePath}`;
|
|
983
|
+
}
|
|
984
|
+
async touchFile(filePath, rootPath = getCwd(), options) {
|
|
985
|
+
const client = await this.getClient(filePath, rootPath);
|
|
986
|
+
if (!client) {
|
|
987
|
+
return false;
|
|
988
|
+
}
|
|
989
|
+
const content = await readFile(filePath, "utf-8");
|
|
990
|
+
const ext = extname(filePath);
|
|
991
|
+
const serverInfo = this.resolveServerInfoForClient(ext, client);
|
|
992
|
+
const languageId = this.getLanguageId(ext, serverInfo ?? void 0);
|
|
993
|
+
const versionKey = this.getVersionKey(filePath, client);
|
|
994
|
+
const currentVersion = this.fileVersions.get(versionKey);
|
|
995
|
+
const waitPromise = options?.wait ? client.waitForReadiness(filePath, options.timeoutMs ?? 2e3) : null;
|
|
996
|
+
if (currentVersion === void 0) {
|
|
997
|
+
await client.didOpen(filePath, content, languageId, 0);
|
|
998
|
+
this.fileVersions.set(versionKey, 0);
|
|
999
|
+
} else {
|
|
1000
|
+
const nextVersion = currentVersion + 1;
|
|
1001
|
+
await client.didChange(filePath, content, nextVersion);
|
|
1002
|
+
this.fileVersions.set(versionKey, nextVersion);
|
|
1003
|
+
}
|
|
1004
|
+
if (waitPromise) {
|
|
1005
|
+
const ready = await waitPromise;
|
|
1006
|
+
if (ready) {
|
|
1007
|
+
this.readiness.set(filePath, this.now());
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return true;
|
|
933
1011
|
}
|
|
934
1012
|
matchesServerFilters(filePath, serverInfo) {
|
|
935
1013
|
const normalizePath = (value) => value.replace(/\\/g, "/");
|
|
@@ -2335,9 +2413,6 @@ var ScopeAnalyzer = class {
|
|
|
2335
2413
|
};
|
|
2336
2414
|
|
|
2337
2415
|
// src/lsp/index.ts
|
|
2338
|
-
function getLanguageId(ext) {
|
|
2339
|
-
return LspServerRegistry.getInstance().getLanguageIdForExtension(ext);
|
|
2340
|
-
}
|
|
2341
2416
|
function normalizeUri(filePath) {
|
|
2342
2417
|
let uri = pathToFileURL2(filePath).href;
|
|
2343
2418
|
if (process.platform === "win32") {
|
|
@@ -2548,9 +2623,16 @@ var diagnosticsCache = /* @__PURE__ */ new Map();
|
|
|
2548
2623
|
function resolveDiagnosticsTtlMs() {
|
|
2549
2624
|
return resolveNumberEnv(process.env.PYB_LSP_DIAGNOSTICS_TTL_MS, 3e3);
|
|
2550
2625
|
}
|
|
2626
|
+
function resolveDiagnosticsTimeoutMs() {
|
|
2627
|
+
return resolveNumberEnv(process.env.PYB_LSP_DIAGNOSTICS_TIMEOUT_MS, 5e3);
|
|
2628
|
+
}
|
|
2551
2629
|
function buildDiagnosticsCacheKey(filePath, rootPath) {
|
|
2552
2630
|
return `${rootPath}::${filePath}`;
|
|
2553
2631
|
}
|
|
2632
|
+
function clearDiagnosticsCache(filePath, rootPath) {
|
|
2633
|
+
const key = buildDiagnosticsCacheKey(filePath, rootPath);
|
|
2634
|
+
diagnosticsCache.delete(key);
|
|
2635
|
+
}
|
|
2554
2636
|
function recordFastPathFailure(filePath, reason, now) {
|
|
2555
2637
|
let perFile = fastPathFailures.get(filePath);
|
|
2556
2638
|
if (!perFile) {
|
|
@@ -2722,7 +2804,7 @@ function shouldSkipFastPath(filePath, now) {
|
|
|
2722
2804
|
}
|
|
2723
2805
|
return null;
|
|
2724
2806
|
}
|
|
2725
|
-
function
|
|
2807
|
+
function withTimeout2(promise, timeoutMs) {
|
|
2726
2808
|
return new Promise((resolve, reject) => {
|
|
2727
2809
|
const timer = setTimeout(() => {
|
|
2728
2810
|
reject(new Error("Tree-sitter timeout"));
|
|
@@ -3151,10 +3233,19 @@ var LspAPI = {
|
|
|
3151
3233
|
recordAttempt("diagnostics");
|
|
3152
3234
|
const startedAt = Date.now();
|
|
3153
3235
|
if (input.waitForDiagnostics) {
|
|
3154
|
-
|
|
3236
|
+
const timeoutMs = input.timeoutMs ?? resolveDiagnosticsTimeoutMs();
|
|
3237
|
+
const ready = await client.waitForReadiness(
|
|
3155
3238
|
input.filePath,
|
|
3156
|
-
|
|
3239
|
+
timeoutMs
|
|
3157
3240
|
);
|
|
3241
|
+
if (!ready) {
|
|
3242
|
+
recordFailure("diagnostics", "timeout");
|
|
3243
|
+
return {
|
|
3244
|
+
formatted: `Diagnostics timeout after ${timeoutMs}ms`,
|
|
3245
|
+
resultCount: 0,
|
|
3246
|
+
fileCount: 0
|
|
3247
|
+
};
|
|
3248
|
+
}
|
|
3158
3249
|
}
|
|
3159
3250
|
const diagnostics = client.getDiagnostics(input.filePath);
|
|
3160
3251
|
recordSuccess("diagnostics", startedAt);
|
|
@@ -3331,15 +3422,12 @@ var LspAPI = {
|
|
|
3331
3422
|
return Promise.all(inputs.map((input) => this.run(input)));
|
|
3332
3423
|
},
|
|
3333
3424
|
async touchFile(filePath, options = {}) {
|
|
3334
|
-
const
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
await client.waitForReadiness(filePath, options.timeoutMs ?? 2e3);
|
|
3341
|
-
}
|
|
3342
|
-
return true;
|
|
3425
|
+
const rootPath = options.rootPath ?? getCwd();
|
|
3426
|
+
clearDiagnosticsCache(filePath, rootPath);
|
|
3427
|
+
return LspClientManager.getInstance().touchFile(filePath, rootPath, {
|
|
3428
|
+
wait: options.wait,
|
|
3429
|
+
timeoutMs: options.timeoutMs
|
|
3430
|
+
});
|
|
3343
3431
|
},
|
|
3344
3432
|
async diagnostics(filePath, rootPath) {
|
|
3345
3433
|
const resolvedRoot = rootPath ?? getCwd();
|
|
@@ -3468,7 +3556,7 @@ var LspFacade = {
|
|
|
3468
3556
|
}
|
|
3469
3557
|
try {
|
|
3470
3558
|
const start = Date.now();
|
|
3471
|
-
const symbols = await
|
|
3559
|
+
const symbols = await withTimeout2(
|
|
3472
3560
|
TreeSitterLspAdapter.getDocumentSymbols(input.filePath),
|
|
3473
3561
|
getFastPathTimeoutMs(input.filePath, contentLength)
|
|
3474
3562
|
);
|
|
@@ -3542,7 +3630,7 @@ var LspFacade = {
|
|
|
3542
3630
|
}
|
|
3543
3631
|
try {
|
|
3544
3632
|
const start = Date.now();
|
|
3545
|
-
const symbols = await
|
|
3633
|
+
const symbols = await withTimeout2(
|
|
3546
3634
|
TreeSitterLspAdapter.getDocumentSymbols(input.filePath),
|
|
3547
3635
|
getFastPathTimeoutMs(input.filePath, contentLength)
|
|
3548
3636
|
);
|
|
@@ -3577,6 +3665,13 @@ var LspFacade = {
|
|
|
3577
3665
|
}
|
|
3578
3666
|
}
|
|
3579
3667
|
}
|
|
3668
|
+
if (fallbackReason) {
|
|
3669
|
+
return LspAPI.run({
|
|
3670
|
+
operation: "documentSymbol",
|
|
3671
|
+
filePath: input.filePath,
|
|
3672
|
+
rootPath
|
|
3673
|
+
});
|
|
3674
|
+
}
|
|
3580
3675
|
} else {
|
|
3581
3676
|
const lang = ParserRegistry.getLanguage(input.filePath);
|
|
3582
3677
|
const now = Date.now();
|
|
@@ -3604,7 +3699,7 @@ var LspFacade = {
|
|
|
3604
3699
|
}
|
|
3605
3700
|
try {
|
|
3606
3701
|
const start = Date.now();
|
|
3607
|
-
const symbols = await
|
|
3702
|
+
const symbols = await withTimeout2(
|
|
3608
3703
|
TreeSitterLspAdapter.getDocumentSymbols(input.filePath),
|
|
3609
3704
|
getFastPathTimeoutMs(input.filePath, contentLength)
|
|
3610
3705
|
);
|
|
@@ -3684,11 +3779,49 @@ var LspFacade = {
|
|
|
3684
3779
|
}
|
|
3685
3780
|
}
|
|
3686
3781
|
if (input.operation !== "workspaceSymbol") {
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3782
|
+
if (input.operation === "diagnostics") {
|
|
3783
|
+
const timeoutMs = input.timeoutMs ?? resolveDiagnosticsTimeoutMs();
|
|
3784
|
+
const shouldWait = input.waitForDiagnostics ?? true;
|
|
3785
|
+
const touched = await LspAPI.touchFile(input.filePath, {
|
|
3786
|
+
wait: false,
|
|
3787
|
+
timeoutMs,
|
|
3788
|
+
rootPath
|
|
3789
|
+
});
|
|
3790
|
+
if (!touched) {
|
|
3791
|
+
return {
|
|
3792
|
+
formatted: `No LSP server available for file type: ${extname2(input.filePath)}`,
|
|
3793
|
+
resultCount: 0,
|
|
3794
|
+
fileCount: 0
|
|
3795
|
+
};
|
|
3796
|
+
}
|
|
3797
|
+
if (shouldWait) {
|
|
3798
|
+
const ready = await LspClientManager.getInstance().waitForReadiness(
|
|
3799
|
+
input.filePath,
|
|
3800
|
+
rootPath,
|
|
3801
|
+
timeoutMs
|
|
3802
|
+
);
|
|
3803
|
+
if (!ready) {
|
|
3804
|
+
return {
|
|
3805
|
+
formatted: `Diagnostics timeout after ${timeoutMs}ms`,
|
|
3806
|
+
resultCount: 0,
|
|
3807
|
+
fileCount: 0
|
|
3808
|
+
};
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
} else {
|
|
3812
|
+
const touched = await LspAPI.touchFile(input.filePath, {
|
|
3813
|
+
wait: false,
|
|
3814
|
+
timeoutMs: input.timeoutMs,
|
|
3815
|
+
rootPath
|
|
3816
|
+
});
|
|
3817
|
+
if (!touched) {
|
|
3818
|
+
return {
|
|
3819
|
+
formatted: `No LSP server available for file type: ${extname2(input.filePath)}`,
|
|
3820
|
+
resultCount: 0,
|
|
3821
|
+
fileCount: 0
|
|
3822
|
+
};
|
|
3823
|
+
}
|
|
3824
|
+
}
|
|
3692
3825
|
}
|
|
3693
3826
|
if (input.operation === "workspaceSymbol") {
|
|
3694
3827
|
const query = input.query ?? input.filePath;
|
|
@@ -3714,6 +3847,12 @@ var LspFacade = {
|
|
|
3714
3847
|
async touchFile(filePath, options = {}) {
|
|
3715
3848
|
return LspAPI.touchFile(filePath, options);
|
|
3716
3849
|
},
|
|
3850
|
+
async diagnostics(filePath, options) {
|
|
3851
|
+
return LspAPI.diagnostics(filePath, options?.rootPath);
|
|
3852
|
+
},
|
|
3853
|
+
async documentSymbolRaw(filePath, rootPath) {
|
|
3854
|
+
return LspAPI.documentSymbolRaw(filePath, rootPath);
|
|
3855
|
+
},
|
|
3717
3856
|
async diagnosticsPretty(filePath, options) {
|
|
3718
3857
|
return LspAPI.diagnosticsPretty(filePath, options);
|
|
3719
3858
|
},
|