@inspecto-dev/plugin 0.3.6 → 0.3.8
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/README.md +2 -1
- package/dist/astro.cjs +2243 -0
- package/dist/astro.cjs.map +1 -0
- package/dist/astro.d.cts +17 -0
- package/dist/astro.d.ts +17 -0
- package/dist/astro.js +2212 -0
- package/dist/astro.js.map +1 -0
- package/dist/index.cjs +430 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +428 -17
- package/dist/index.js.map +1 -1
- package/dist/legacy/rspack/index.cjs +33 -21
- package/dist/legacy/rspack/index.cjs.map +1 -1
- package/dist/legacy/rspack/index.js +33 -21
- package/dist/legacy/rspack/index.js.map +1 -1
- package/dist/legacy/rspack/loader.cjs +404 -3
- package/dist/legacy/rspack/loader.cjs.map +1 -1
- package/dist/legacy/rspack/loader.js +400 -3
- package/dist/legacy/rspack/loader.js.map +1 -1
- package/dist/legacy/webpack4/index.cjs +22 -10
- package/dist/legacy/webpack4/index.cjs.map +1 -1
- package/dist/legacy/webpack4/index.js +22 -10
- package/dist/legacy/webpack4/index.js.map +1 -1
- package/dist/legacy/webpack4/loader.cjs +404 -3
- package/dist/legacy/webpack4/loader.cjs.map +1 -1
- package/dist/legacy/webpack4/loader.js +400 -3
- package/dist/legacy/webpack4/loader.js.map +1 -1
- package/dist/rollup.cjs +430 -17
- package/dist/rollup.cjs.map +1 -1
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +428 -17
- package/dist/rollup.js.map +1 -1
- package/dist/rspack.cjs +430 -17
- package/dist/rspack.cjs.map +1 -1
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.js +428 -17
- package/dist/rspack.js.map +1 -1
- package/dist/vite.cjs +430 -17
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +428 -17
- package/dist/vite.js.map +1 -1
- package/dist/webpack.cjs +430 -17
- package/dist/webpack.cjs.map +1 -1
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +428 -17
- package/dist/webpack.js.map +1 -1
- package/package.json +10 -3
|
@@ -36,7 +36,7 @@ __export(rspack_exports, {
|
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(rspack_exports);
|
|
38
38
|
|
|
39
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.
|
|
39
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.10_typescript@5.9.3_yaml@2.8.3/node_modules/tsup/assets/cjs_shims.js
|
|
40
40
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
41
41
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
42
42
|
|
|
@@ -317,7 +317,7 @@ function readJsonSafely(filePath) {
|
|
|
317
317
|
}
|
|
318
318
|
return null;
|
|
319
319
|
}
|
|
320
|
-
function resolveTargetTool(config,
|
|
320
|
+
function resolveTargetTool(config, _ide = "vscode") {
|
|
321
321
|
const defaultProvider = config["provider.default"];
|
|
322
322
|
if (defaultProvider) {
|
|
323
323
|
const tool = defaultProvider.split(".")[0];
|
|
@@ -469,7 +469,7 @@ function watchConfig(onReload, cwd = process.cwd(), gitRoot) {
|
|
|
469
469
|
});
|
|
470
470
|
watcher.unref();
|
|
471
471
|
watchers.push(watcher);
|
|
472
|
-
} catch (
|
|
472
|
+
} catch (_e) {
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
}
|
|
@@ -510,6 +510,9 @@ function launchURI(uri) {
|
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
// src/server/dispatch-runtime.ts
|
|
513
|
+
function normalizeIdeToken(value) {
|
|
514
|
+
return (value ?? "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
515
|
+
}
|
|
513
516
|
function resolvePromptDispatchRuntime(state) {
|
|
514
517
|
const userConfig = loadUserConfigSync(false, state.cwd, state.projectRoot);
|
|
515
518
|
const resolvedTarget = resolveTargetTool(userConfig);
|
|
@@ -551,7 +554,11 @@ function dispatchPromptThroughIde(runtime, payload) {
|
|
|
551
554
|
};
|
|
552
555
|
}
|
|
553
556
|
function resolveFinalIde(configuredIde, activeIde, activeIdeScheme) {
|
|
554
|
-
|
|
557
|
+
const configuredIdeMatchesActiveScheme = Boolean(configuredIde) && Boolean(activeIdeScheme) && normalizeIdeToken(configuredIde) === normalizeIdeToken(activeIdeScheme);
|
|
558
|
+
if (configuredIdeMatchesActiveScheme) {
|
|
559
|
+
return activeIdeScheme;
|
|
560
|
+
}
|
|
561
|
+
if (configuredIde && activeIdeScheme && normalizeIdeToken(activeIdeScheme).includes(normalizeIdeToken(configuredIde)) === false) {
|
|
555
562
|
return configuredIde;
|
|
556
563
|
}
|
|
557
564
|
return configuredIde || activeIdeScheme || activeIde || "vscode";
|
|
@@ -816,15 +823,15 @@ function getAnnotationDispatchErrorCode(error) {
|
|
|
816
823
|
}
|
|
817
824
|
|
|
818
825
|
// src/server/client-config.ts
|
|
819
|
-
async function buildClientConfig(
|
|
820
|
-
const userConfig = loadUserConfigSync(false,
|
|
821
|
-
const promptsConfig = await loadPromptsConfig(false,
|
|
826
|
+
async function buildClientConfig(serverState2) {
|
|
827
|
+
const userConfig = loadUserConfigSync(false, serverState2.cwd, serverState2.configRoot);
|
|
828
|
+
const promptsConfig = await loadPromptsConfig(false, serverState2.cwd, serverState2.configRoot);
|
|
822
829
|
const effectiveIde = userConfig.ide ?? "vscode";
|
|
823
830
|
let info;
|
|
824
|
-
if (!
|
|
831
|
+
if (!serverState2.ideInfo) {
|
|
825
832
|
info = { ide: effectiveIde };
|
|
826
833
|
} else {
|
|
827
|
-
const { scheme: _scheme, ...rest } =
|
|
834
|
+
const { scheme: _scheme, ...rest } = serverState2.ideInfo;
|
|
828
835
|
info = rest;
|
|
829
836
|
}
|
|
830
837
|
return {
|
|
@@ -861,17 +868,22 @@ var VSCODE_FAMILY_SCHEMES = [
|
|
|
861
868
|
"vscodium",
|
|
862
869
|
"codebuddy",
|
|
863
870
|
"codebuddy-cn",
|
|
871
|
+
"codebuddycn",
|
|
864
872
|
"antigravity"
|
|
865
873
|
];
|
|
866
|
-
function
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
874
|
+
function normalizeIdeToken2(value) {
|
|
875
|
+
return (value ?? "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
876
|
+
}
|
|
877
|
+
function handleOpenFileRequest(body, serverState2) {
|
|
878
|
+
const absolutePath = resolveWorkspacePath(body.file, serverState2.cwd);
|
|
879
|
+
assertPathWithinIdeOpenScope(absolutePath, serverState2.projectRoot);
|
|
880
|
+
const userConfig = loadUserConfigSync(false, serverState2.cwd, serverState2.configRoot);
|
|
870
881
|
const configuredIde = userConfig.ide;
|
|
871
|
-
const activeIde =
|
|
872
|
-
const activeIdeScheme =
|
|
873
|
-
const
|
|
874
|
-
|
|
882
|
+
const activeIde = serverState2.ideInfo?.ide;
|
|
883
|
+
const activeIdeScheme = serverState2.ideInfo?.scheme;
|
|
884
|
+
const configuredIdeMatchesActiveScheme = Boolean(configuredIde) && Boolean(activeIdeScheme) && normalizeIdeToken2(configuredIde) === normalizeIdeToken2(activeIdeScheme);
|
|
885
|
+
const rawEditorHint = configuredIdeMatchesActiveScheme ? activeIdeScheme : configuredIde || activeIde || activeIdeScheme || "code";
|
|
886
|
+
if (configuredIde && activeIdeScheme && normalizeIdeToken2(activeIdeScheme).includes(normalizeIdeToken2(configuredIde)) === false) {
|
|
875
887
|
serverLogger2.warn(
|
|
876
888
|
`Active IDE is ${activeIdeScheme}, but config forces ${configuredIde}. Using configured IDE.`
|
|
877
889
|
);
|
|
@@ -1016,14 +1028,14 @@ async function startServer() {
|
|
|
1016
1028
|
if (import_node_fs4.default.existsSync(portFile)) {
|
|
1017
1029
|
try {
|
|
1018
1030
|
portData = JSON.parse(import_node_fs4.default.readFileSync(portFile, "utf-8"));
|
|
1019
|
-
} catch (
|
|
1031
|
+
} catch (_e) {
|
|
1020
1032
|
}
|
|
1021
1033
|
}
|
|
1022
1034
|
const rootHash = import_node_crypto2.default.createHash("md5").update(serverState.projectRoot).digest("hex");
|
|
1023
1035
|
portData[rootHash] = port;
|
|
1024
1036
|
import_node_fs4.default.writeFileSync(portFile, JSON.stringify(portData, null, 2), "utf-8");
|
|
1025
|
-
} catch (
|
|
1026
|
-
serverLogger4.warn("Failed to write port file:",
|
|
1037
|
+
} catch (_e) {
|
|
1038
|
+
serverLogger4.warn("Failed to write port file:", _e);
|
|
1027
1039
|
}
|
|
1028
1040
|
process.once("exit", () => {
|
|
1029
1041
|
try {
|
|
@@ -1096,7 +1108,7 @@ async function handleRequest(url, req, res) {
|
|
|
1096
1108
|
let body;
|
|
1097
1109
|
try {
|
|
1098
1110
|
body = JSON.parse(await readBody(req));
|
|
1099
|
-
} catch (
|
|
1111
|
+
} catch (_e) {
|
|
1100
1112
|
res.writeHead(400, { "Content-Type": "application/json" });
|
|
1101
1113
|
res.end(JSON.stringify({ error: "Invalid JSON body" }));
|
|
1102
1114
|
return;
|