@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.
Files changed (54) hide show
  1. package/README.md +2 -1
  2. package/dist/astro.cjs +2243 -0
  3. package/dist/astro.cjs.map +1 -0
  4. package/dist/astro.d.cts +17 -0
  5. package/dist/astro.d.ts +17 -0
  6. package/dist/astro.js +2212 -0
  7. package/dist/astro.js.map +1 -0
  8. package/dist/index.cjs +430 -17
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +21 -1
  11. package/dist/index.d.ts +21 -1
  12. package/dist/index.js +428 -17
  13. package/dist/index.js.map +1 -1
  14. package/dist/legacy/rspack/index.cjs +33 -21
  15. package/dist/legacy/rspack/index.cjs.map +1 -1
  16. package/dist/legacy/rspack/index.js +33 -21
  17. package/dist/legacy/rspack/index.js.map +1 -1
  18. package/dist/legacy/rspack/loader.cjs +404 -3
  19. package/dist/legacy/rspack/loader.cjs.map +1 -1
  20. package/dist/legacy/rspack/loader.js +400 -3
  21. package/dist/legacy/rspack/loader.js.map +1 -1
  22. package/dist/legacy/webpack4/index.cjs +22 -10
  23. package/dist/legacy/webpack4/index.cjs.map +1 -1
  24. package/dist/legacy/webpack4/index.js +22 -10
  25. package/dist/legacy/webpack4/index.js.map +1 -1
  26. package/dist/legacy/webpack4/loader.cjs +404 -3
  27. package/dist/legacy/webpack4/loader.cjs.map +1 -1
  28. package/dist/legacy/webpack4/loader.js +400 -3
  29. package/dist/legacy/webpack4/loader.js.map +1 -1
  30. package/dist/rollup.cjs +430 -17
  31. package/dist/rollup.cjs.map +1 -1
  32. package/dist/rollup.d.cts +1 -1
  33. package/dist/rollup.d.ts +1 -1
  34. package/dist/rollup.js +428 -17
  35. package/dist/rollup.js.map +1 -1
  36. package/dist/rspack.cjs +430 -17
  37. package/dist/rspack.cjs.map +1 -1
  38. package/dist/rspack.d.cts +1 -1
  39. package/dist/rspack.d.ts +1 -1
  40. package/dist/rspack.js +428 -17
  41. package/dist/rspack.js.map +1 -1
  42. package/dist/vite.cjs +430 -17
  43. package/dist/vite.cjs.map +1 -1
  44. package/dist/vite.d.cts +1 -1
  45. package/dist/vite.d.ts +1 -1
  46. package/dist/vite.js +428 -17
  47. package/dist/vite.js.map +1 -1
  48. package/dist/webpack.cjs +430 -17
  49. package/dist/webpack.cjs.map +1 -1
  50. package/dist/webpack.d.cts +1 -1
  51. package/dist/webpack.d.ts +1 -1
  52. package/dist/webpack.js +428 -17
  53. package/dist/webpack.js.map +1 -1
  54. 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.9_typescript@5.9.3_yaml@2.8.3/node_modules/tsup/assets/cjs_shims.js
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, ide = "vscode") {
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 (e) {
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
- if (configuredIde && activeIdeScheme && !activeIdeScheme.includes(configuredIde)) {
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(serverState3) {
820
- const userConfig = loadUserConfigSync(false, serverState3.cwd, serverState3.configRoot);
821
- const promptsConfig = await loadPromptsConfig(false, serverState3.cwd, serverState3.configRoot);
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 (!serverState3.ideInfo) {
831
+ if (!serverState2.ideInfo) {
825
832
  info = { ide: effectiveIde };
826
833
  } else {
827
- const { scheme: _scheme, ...rest } = serverState3.ideInfo;
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 handleOpenFileRequest(body, serverState3) {
867
- const absolutePath = resolveWorkspacePath(body.file, serverState3.cwd);
868
- assertPathWithinIdeOpenScope(absolutePath, serverState3.projectRoot);
869
- const userConfig = loadUserConfigSync(false, serverState3.cwd, serverState3.configRoot);
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 = serverState3.ideInfo?.ide;
872
- const activeIdeScheme = serverState3.ideInfo?.scheme;
873
- const rawEditorHint = configuredIde || activeIde || activeIdeScheme || "code";
874
- if (configuredIde && activeIdeScheme && !activeIdeScheme.includes(configuredIde)) {
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 (e) {
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 (e) {
1026
- serverLogger4.warn("Failed to write port file:", e);
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 (e) {
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;