pybao-cli 1.4.4 → 1.4.6

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 (149) hide show
  1. package/dist/REPL-CEZDOYM4.js +47 -0
  2. package/dist/{acp-ZUTERA5S.js → acp-GBBJ4Q2L.js} +29 -29
  3. package/dist/{agentsValidate-AWTRTN5W.js → agentsValidate-CHJ53WK5.js} +7 -7
  4. package/dist/{ask-XGZ4FQKH.js → ask-LUB6FARM.js} +28 -28
  5. package/dist/{autoUpdater-4SOMNDQJ.js → autoUpdater-LOTPDUNR.js} +3 -3
  6. package/dist/{chunk-LTRRVBFJ.js → chunk-2SLRM6SW.js} +2 -2
  7. package/dist/{chunk-XUVX64YX.js → chunk-3CFMPM3Q.js} +1 -1
  8. package/dist/{chunk-RTK7D2UF.js → chunk-3ERO7LXW.js} +74 -32
  9. package/dist/chunk-3ERO7LXW.js.map +7 -0
  10. package/dist/{chunk-4PG3WN3C.js → chunk-3LXMVPOB.js} +3 -3
  11. package/dist/{chunk-7YRN3G6O.js → chunk-3SJOME2K.js} +78 -48
  12. package/dist/chunk-3SJOME2K.js.map +7 -0
  13. package/dist/{chunk-IA43WY3S.js → chunk-3TM4YSOT.js} +3 -3
  14. package/dist/{chunk-TZQSDGRB.js → chunk-4EHOCBGD.js} +4 -4
  15. package/dist/{chunk-GUC73TG3.js → chunk-4KZQIFYS.js} +4 -4
  16. package/dist/{chunk-LZ7DRYYR.js → chunk-BX5HCVXO.js} +3 -3
  17. package/dist/{chunk-APJD6SW2.js → chunk-BZQ44CLS.js} +2 -2
  18. package/dist/{chunk-MI2KXXDU.js → chunk-DCUDXX3J.js} +1 -1
  19. package/dist/{chunk-53FUR6RV.js → chunk-DT55XLT2.js} +4 -4
  20. package/dist/{chunk-YS54GTHH.js → chunk-ELX7YL6H.js} +1 -1
  21. package/dist/{chunk-OSA6YZ7D.js → chunk-KGLVRNDR.js} +1 -1
  22. package/dist/{chunk-YFJI5OAO.js → chunk-KWWBMB2C.js} +3 -3
  23. package/dist/{chunk-DUALMA47.js → chunk-LOXUDTGK.js} +1 -1
  24. package/dist/{chunk-R6JK7J47.js → chunk-MM3N4LYU.js} +2 -2
  25. package/dist/{chunk-X4NOBQSI.js → chunk-ONJLFU6E.js} +1 -1
  26. package/dist/{chunk-KFTWAAEB.js → chunk-PYSQ7H2W.js} +2 -2
  27. package/dist/{chunk-A2LLO2G7.js → chunk-QVH2T453.js} +2 -2
  28. package/dist/{chunk-NC6HM2YL.js → chunk-R2S27MPB.js} +3 -3
  29. package/dist/{chunk-CDDRJZLN.js → chunk-R6BQN6BI.js} +67 -17
  30. package/dist/chunk-R6BQN6BI.js.map +7 -0
  31. package/dist/{chunk-VT6YOSNT.js → chunk-RXZRJGAW.js} +1 -1
  32. package/dist/{chunk-BXKFEPY4.js → chunk-SPTVOC4U.js} +1 -1
  33. package/dist/{chunk-KB57LVO6.js → chunk-THDVQQCB.js} +2 -2
  34. package/dist/{chunk-AYKNJIWC.js → chunk-UEFMFW7S.js} +1 -1
  35. package/dist/{chunk-AYKNJIWC.js.map → chunk-UEFMFW7S.js.map} +1 -1
  36. package/dist/{chunk-SDD6QEJR.js → chunk-VSZ2ERXU.js} +3 -3
  37. package/dist/{chunk-NOQFISUS.js → chunk-YCVH3KLB.js} +1 -1
  38. package/dist/{chunk-NJQFT5WP.js → chunk-YDHOG7RX.js} +2 -2
  39. package/dist/{chunk-JQN76VWU.js → chunk-ZHXQ5CHI.js} +165 -17
  40. package/dist/chunk-ZHXQ5CHI.js.map +7 -0
  41. package/dist/{cli-4GSFMWG4.js → cli-4L2D2W3Z.js} +87 -87
  42. package/dist/commands-F3TBOCAC.js +51 -0
  43. package/dist/{config-XRCPFUMP.js → config-J7BBEQ54.js} +4 -4
  44. package/dist/{context-V2KZYETD.js → context-MFQYX3BD.js} +6 -6
  45. package/dist/{customCommands-GYE22N7X.js → customCommands-VE2IFWOE.js} +4 -4
  46. package/dist/{env-6PFEG3IJ.js → env-H673UPME.js} +2 -2
  47. package/dist/{file-HUOUUXQN.js → file-6J7OPL7D.js} +4 -4
  48. package/dist/index.js +3 -3
  49. package/dist/{llm-5XTVXNNO.js → llm-2J4VIMSQ.js} +29 -29
  50. package/dist/{llmLazy-LYL7PZIP.js → llmLazy-FJ6UVXBE.js} +1 -1
  51. package/dist/{loader-LGNBF346.js → loader-JG4RX4NZ.js} +4 -4
  52. package/dist/{lsp-RXODR7IT.js → lsp-QHAT3UA3.js} +8 -6
  53. package/dist/{lspAnchor-KD3YDKIU.js → lspAnchor-GEIDNUAL.js} +6 -6
  54. package/dist/{mcp-DZVZURWQ.js → mcp-W55PQSXA.js} +7 -7
  55. package/dist/{mentionProcessor-TV5WX5QI.js → mentionProcessor-AIKIWBRT.js} +5 -5
  56. package/dist/{messages-63V7PLB3.js → messages-6PJ26XMB.js} +1 -1
  57. package/dist/{model-PIPNIFG6.js → model-JDCFFSS5.js} +5 -5
  58. package/dist/{openai-7PBUBCVL.js → openai-BYAVZ7GD.js} +5 -5
  59. package/dist/{outputStyles-JUAFSQ3X.js → outputStyles-SWELWRFU.js} +4 -4
  60. package/dist/{pluginRuntime-SCSQDNRJ.js → pluginRuntime-I2W43RXL.js} +6 -6
  61. package/dist/{pluginValidation-M4VRW75Z.js → pluginValidation-6NHIZZEK.js} +6 -6
  62. package/dist/prompts-B7CPNTOM.js +53 -0
  63. package/dist/{pybAgentSessionLoad-3BP6OY3R.js → pybAgentSessionLoad-GHEX7PMU.js} +4 -4
  64. package/dist/{pybAgentSessionResume-4NGQ6Z3B.js → pybAgentSessionResume-JYAJKSVG.js} +4 -4
  65. package/dist/{pybAgentStreamJsonSession-SHF3IH4F.js → pybAgentStreamJsonSession-HIKR32BT.js} +1 -1
  66. package/dist/{pybHooks-PIFZLTVA.js → pybHooks-L6N62ZR6.js} +4 -4
  67. package/dist/query-GHIDLJPY.js +55 -0
  68. package/dist/{registry-QCEPF42I.js → registry-HPBUGGHF.js} +5 -5
  69. package/dist/{ripgrep-CHQJM74I.js → ripgrep-UBQWIOMK.js} +3 -3
  70. package/dist/{skillMarketplace-LIFDHUHS.js → skillMarketplace-NO2IDGSM.js} +3 -3
  71. package/dist/{state-LGVYKZYR.js → state-HXLVMI7X.js} +2 -2
  72. package/dist/{theme-5QKLFDGW.js → theme-TNT2BZ25.js} +5 -5
  73. package/dist/{toolPermissionSettings-VNBKLZIT.js → toolPermissionSettings-TJZHAYYO.js} +6 -6
  74. package/dist/tools-SDR7BZZU.js +52 -0
  75. package/dist/{userInput-64ZNU7F3.js → userInput-DGZ2SE4C.js} +30 -30
  76. package/package.json +1 -1
  77. package/dist/REPL-LLXP3KZE.js +0 -47
  78. package/dist/chunk-7YRN3G6O.js.map +0 -7
  79. package/dist/chunk-CDDRJZLN.js.map +0 -7
  80. package/dist/chunk-JQN76VWU.js.map +0 -7
  81. package/dist/chunk-RTK7D2UF.js.map +0 -7
  82. package/dist/commands-HA4FPBAY.js +0 -51
  83. package/dist/prompts-Z6JR5ECU.js +0 -53
  84. package/dist/query-YVTHXUBT.js +0 -55
  85. package/dist/tools-FKZPEWYT.js +0 -52
  86. /package/dist/{REPL-LLXP3KZE.js.map → REPL-CEZDOYM4.js.map} +0 -0
  87. /package/dist/{acp-ZUTERA5S.js.map → acp-GBBJ4Q2L.js.map} +0 -0
  88. /package/dist/{agentsValidate-AWTRTN5W.js.map → agentsValidate-CHJ53WK5.js.map} +0 -0
  89. /package/dist/{ask-XGZ4FQKH.js.map → ask-LUB6FARM.js.map} +0 -0
  90. /package/dist/{autoUpdater-4SOMNDQJ.js.map → autoUpdater-LOTPDUNR.js.map} +0 -0
  91. /package/dist/{chunk-LTRRVBFJ.js.map → chunk-2SLRM6SW.js.map} +0 -0
  92. /package/dist/{chunk-XUVX64YX.js.map → chunk-3CFMPM3Q.js.map} +0 -0
  93. /package/dist/{chunk-4PG3WN3C.js.map → chunk-3LXMVPOB.js.map} +0 -0
  94. /package/dist/{chunk-IA43WY3S.js.map → chunk-3TM4YSOT.js.map} +0 -0
  95. /package/dist/{chunk-TZQSDGRB.js.map → chunk-4EHOCBGD.js.map} +0 -0
  96. /package/dist/{chunk-GUC73TG3.js.map → chunk-4KZQIFYS.js.map} +0 -0
  97. /package/dist/{chunk-LZ7DRYYR.js.map → chunk-BX5HCVXO.js.map} +0 -0
  98. /package/dist/{chunk-APJD6SW2.js.map → chunk-BZQ44CLS.js.map} +0 -0
  99. /package/dist/{chunk-MI2KXXDU.js.map → chunk-DCUDXX3J.js.map} +0 -0
  100. /package/dist/{chunk-53FUR6RV.js.map → chunk-DT55XLT2.js.map} +0 -0
  101. /package/dist/{chunk-YS54GTHH.js.map → chunk-ELX7YL6H.js.map} +0 -0
  102. /package/dist/{chunk-OSA6YZ7D.js.map → chunk-KGLVRNDR.js.map} +0 -0
  103. /package/dist/{chunk-YFJI5OAO.js.map → chunk-KWWBMB2C.js.map} +0 -0
  104. /package/dist/{chunk-DUALMA47.js.map → chunk-LOXUDTGK.js.map} +0 -0
  105. /package/dist/{chunk-R6JK7J47.js.map → chunk-MM3N4LYU.js.map} +0 -0
  106. /package/dist/{chunk-X4NOBQSI.js.map → chunk-ONJLFU6E.js.map} +0 -0
  107. /package/dist/{chunk-KFTWAAEB.js.map → chunk-PYSQ7H2W.js.map} +0 -0
  108. /package/dist/{chunk-A2LLO2G7.js.map → chunk-QVH2T453.js.map} +0 -0
  109. /package/dist/{chunk-NC6HM2YL.js.map → chunk-R2S27MPB.js.map} +0 -0
  110. /package/dist/{chunk-VT6YOSNT.js.map → chunk-RXZRJGAW.js.map} +0 -0
  111. /package/dist/{chunk-BXKFEPY4.js.map → chunk-SPTVOC4U.js.map} +0 -0
  112. /package/dist/{chunk-KB57LVO6.js.map → chunk-THDVQQCB.js.map} +0 -0
  113. /package/dist/{chunk-SDD6QEJR.js.map → chunk-VSZ2ERXU.js.map} +0 -0
  114. /package/dist/{chunk-NOQFISUS.js.map → chunk-YCVH3KLB.js.map} +0 -0
  115. /package/dist/{chunk-NJQFT5WP.js.map → chunk-YDHOG7RX.js.map} +0 -0
  116. /package/dist/{cli-4GSFMWG4.js.map → cli-4L2D2W3Z.js.map} +0 -0
  117. /package/dist/{commands-HA4FPBAY.js.map → commands-F3TBOCAC.js.map} +0 -0
  118. /package/dist/{config-XRCPFUMP.js.map → config-J7BBEQ54.js.map} +0 -0
  119. /package/dist/{context-V2KZYETD.js.map → context-MFQYX3BD.js.map} +0 -0
  120. /package/dist/{customCommands-GYE22N7X.js.map → customCommands-VE2IFWOE.js.map} +0 -0
  121. /package/dist/{env-6PFEG3IJ.js.map → env-H673UPME.js.map} +0 -0
  122. /package/dist/{file-HUOUUXQN.js.map → file-6J7OPL7D.js.map} +0 -0
  123. /package/dist/{llm-5XTVXNNO.js.map → llm-2J4VIMSQ.js.map} +0 -0
  124. /package/dist/{llmLazy-LYL7PZIP.js.map → llmLazy-FJ6UVXBE.js.map} +0 -0
  125. /package/dist/{loader-LGNBF346.js.map → loader-JG4RX4NZ.js.map} +0 -0
  126. /package/dist/{lsp-RXODR7IT.js.map → lsp-QHAT3UA3.js.map} +0 -0
  127. /package/dist/{lspAnchor-KD3YDKIU.js.map → lspAnchor-GEIDNUAL.js.map} +0 -0
  128. /package/dist/{mcp-DZVZURWQ.js.map → mcp-W55PQSXA.js.map} +0 -0
  129. /package/dist/{mentionProcessor-TV5WX5QI.js.map → mentionProcessor-AIKIWBRT.js.map} +0 -0
  130. /package/dist/{messages-63V7PLB3.js.map → messages-6PJ26XMB.js.map} +0 -0
  131. /package/dist/{model-PIPNIFG6.js.map → model-JDCFFSS5.js.map} +0 -0
  132. /package/dist/{openai-7PBUBCVL.js.map → openai-BYAVZ7GD.js.map} +0 -0
  133. /package/dist/{outputStyles-JUAFSQ3X.js.map → outputStyles-SWELWRFU.js.map} +0 -0
  134. /package/dist/{pluginRuntime-SCSQDNRJ.js.map → pluginRuntime-I2W43RXL.js.map} +0 -0
  135. /package/dist/{pluginValidation-M4VRW75Z.js.map → pluginValidation-6NHIZZEK.js.map} +0 -0
  136. /package/dist/{prompts-Z6JR5ECU.js.map → prompts-B7CPNTOM.js.map} +0 -0
  137. /package/dist/{pybAgentSessionLoad-3BP6OY3R.js.map → pybAgentSessionLoad-GHEX7PMU.js.map} +0 -0
  138. /package/dist/{pybAgentSessionResume-4NGQ6Z3B.js.map → pybAgentSessionResume-JYAJKSVG.js.map} +0 -0
  139. /package/dist/{pybAgentStreamJsonSession-SHF3IH4F.js.map → pybAgentStreamJsonSession-HIKR32BT.js.map} +0 -0
  140. /package/dist/{pybHooks-PIFZLTVA.js.map → pybHooks-L6N62ZR6.js.map} +0 -0
  141. /package/dist/{query-YVTHXUBT.js.map → query-GHIDLJPY.js.map} +0 -0
  142. /package/dist/{registry-QCEPF42I.js.map → registry-HPBUGGHF.js.map} +0 -0
  143. /package/dist/{ripgrep-CHQJM74I.js.map → ripgrep-UBQWIOMK.js.map} +0 -0
  144. /package/dist/{skillMarketplace-LIFDHUHS.js.map → skillMarketplace-NO2IDGSM.js.map} +0 -0
  145. /package/dist/{state-LGVYKZYR.js.map → state-HXLVMI7X.js.map} +0 -0
  146. /package/dist/{theme-5QKLFDGW.js.map → theme-TNT2BZ25.js.map} +0 -0
  147. /package/dist/{toolPermissionSettings-VNBKLZIT.js.map → toolPermissionSettings-TJZHAYYO.js.map} +0 -0
  148. /package/dist/{tools-FKZPEWYT.js.map → tools-SDR7BZZU.js.map} +0 -0
  149. /package/dist/{userInput-64ZNU7F3.js.map → userInput-DGZ2SE4C.js.map} +0 -0
@@ -25,59 +25,59 @@ import {
25
25
  hasReadPermission,
26
26
  hasWritePermission,
27
27
  query
28
- } from "./chunk-7YRN3G6O.js";
28
+ } from "./chunk-3SJOME2K.js";
29
29
  import {
30
30
  queryLLM,
31
31
  queryQuick
32
- } from "./chunk-GUC73TG3.js";
32
+ } from "./chunk-4KZQIFYS.js";
33
33
  import {
34
34
  FallbackToolUseRejectedMessage,
35
35
  MCPTool,
36
36
  getClients,
37
37
  getMCPTools
38
- } from "./chunk-53FUR6RV.js";
38
+ } from "./chunk-DT55XLT2.js";
39
39
  import {
40
40
  generateAgentId
41
- } from "./chunk-NJQFT5WP.js";
41
+ } from "./chunk-YDHOG7RX.js";
42
42
  import {
43
43
  getActiveAgents,
44
44
  getAgentByType,
45
45
  getAvailableAgentTypes
46
- } from "./chunk-A2LLO2G7.js";
46
+ } from "./chunk-QVH2T453.js";
47
47
  import {
48
48
  INTERRUPT_MESSAGE,
49
49
  createAssistantMessage,
50
50
  createUserMessage,
51
51
  getLastAssistantMessageId
52
- } from "./chunk-MI2KXXDU.js";
52
+ } from "./chunk-DCUDXX3J.js";
53
53
  import {
54
54
  formatDuration,
55
55
  formatNumber
56
56
  } from "./chunk-OUXHGDLH.js";
57
57
  import {
58
58
  getAbsolutePath
59
- } from "./chunk-KB57LVO6.js";
59
+ } from "./chunk-THDVQQCB.js";
60
60
  import {
61
61
  LspAPI,
62
62
  LspFacade,
63
63
  formatDiagnosticsPretty
64
- } from "./chunk-RTK7D2UF.js";
64
+ } from "./chunk-3ERO7LXW.js";
65
65
  import {
66
66
  getModelManager
67
- } from "./chunk-4PG3WN3C.js";
67
+ } from "./chunk-3LXMVPOB.js";
68
68
  import {
69
69
  getContext
70
- } from "./chunk-TZQSDGRB.js";
70
+ } from "./chunk-4EHOCBGD.js";
71
71
  import {
72
72
  filesToTree,
73
73
  ripGrepWithStatus
74
- } from "./chunk-VT6YOSNT.js";
74
+ } from "./chunk-RXZRJGAW.js";
75
75
  import {
76
76
  getTheme
77
- } from "./chunk-YS54GTHH.js";
77
+ } from "./chunk-ELX7YL6H.js";
78
78
  import {
79
79
  debug
80
- } from "./chunk-OSA6YZ7D.js";
80
+ } from "./chunk-KGLVRNDR.js";
81
81
  import {
82
82
  BunShell,
83
83
  getCwd,
@@ -87,7 +87,7 @@ import {
87
87
  overwriteLog,
88
88
  readTaskOutput,
89
89
  resolveXdgDataPath
90
- } from "./chunk-DUALMA47.js";
90
+ } from "./chunk-LOXUDTGK.js";
91
91
 
92
92
  // src/tools/index.ts
93
93
  import { memoize as memoize2 } from "lodash-es";
@@ -691,6 +691,15 @@ var inputSchema2 = z2.strictObject({
691
691
  timeout: z2.number().min(0).max(6e5).optional().default(3e4).describe("Max wait time in ms"),
692
692
  analyze: z2.boolean().optional().describe("Analyze the output for errors and warnings")
693
693
  });
694
+ function isTaskOutputLspAnalysisEnabled() {
695
+ const raw = String(process.env.PYB_TASKOUTPUT_LSP_ANALYSIS ?? "").trim().toLowerCase();
696
+ if (!raw) return false;
697
+ if (raw === "1" || raw === "true" || raw === "on" || raw === "yes")
698
+ return true;
699
+ if (raw === "0" || raw === "false" || raw === "off" || raw === "no")
700
+ return false;
701
+ return false;
702
+ }
694
703
  function normalizeTaskOutputInput(input) {
695
704
  const task_id = typeof input.task_id === "string" && input.task_id || typeof input.agentId === "string" && String(input.agentId) || typeof input.bash_id === "string" && String(input.bash_id) || "";
696
705
  const block = typeof input.block === "boolean" ? input.block : true;
@@ -746,10 +755,18 @@ async function analyzeOutputWithLsp(output, exitCode) {
746
755
  const parts = [summary];
747
756
  if (errorCount > 0) parts.push(`${errorCount} Error${errorCount === 1 ? "" : "s"}`);
748
757
  if (warningCount > 0) parts.push(`${warningCount} Warning${warningCount === 1 ? "" : "s"}`);
749
- if (exitCode !== 0) {
758
+ if (!isTaskOutputLspAnalysisEnabled()) {
759
+ parts.push("LSP Analysis: disabled");
760
+ return parts.join(", ");
761
+ }
762
+ if (exitCode === 0 && errorCount === 0 && warningCount === 0) {
763
+ parts.push("LSP Analysis: skipped");
764
+ return parts.join(", ");
765
+ }
766
+ if (exitCode !== 0 || errorCount > 0 || warningCount > 0) {
750
767
  try {
751
768
  const { isAbsolute: isAbsolute3, resolve: resolve4 } = await import("path");
752
- const { getCwd: getCwd2 } = await import("./state-LGVYKZYR.js");
769
+ const { getCwd: getCwd2 } = await import("./state-HXLVMI7X.js");
753
770
  const lines = output.split("\n");
754
771
  const uniqueFiles = /* @__PURE__ */ new Set();
755
772
  const lspSuggestions = [];
@@ -768,6 +785,10 @@ async function analyzeOutputWithLsp(output, exitCode) {
768
785
  }
769
786
  }
770
787
  }
788
+ if (uniqueFiles.size === 0) {
789
+ parts.push("LSP Analysis: no files detected");
790
+ return parts.join(", ");
791
+ }
771
792
  for (const file of uniqueFiles) {
772
793
  try {
773
794
  const absPath = isAbsolute3(file) ? file : resolve4(getCwd2(), file);
@@ -786,6 +807,8 @@ async function analyzeOutputWithLsp(output, exitCode) {
786
807
  }
787
808
  if (lspSuggestions.length > 0) {
788
809
  parts.push("\nLSP Analysis:\n" + lspSuggestions.join("\n"));
810
+ } else {
811
+ parts.push("LSP Analysis: no diagnostics");
789
812
  }
790
813
  } catch (e) {
791
814
  console.error("LSP Analysis Setup Error:", e);
@@ -1108,7 +1131,7 @@ var DeleteTool = {
1108
1131
  }
1109
1132
  if (!force) {
1110
1133
  try {
1111
- const { LspFacade: LspFacade2 } = await import("./lsp-RXODR7IT.js");
1134
+ const { LspFacade: LspFacade2 } = await import("./lsp-QHAT3UA3.js");
1112
1135
  const referenceDetail = await LspFacade2.checkFileReferences(fullPath);
1113
1136
  if (referenceDetail) {
1114
1137
  failedItems.push(
@@ -1720,6 +1743,105 @@ function extractSymbolAtPosition(lines, zeroBasedLine, zeroBasedCharacter) {
1720
1743
  return null;
1721
1744
  }
1722
1745
  }
1746
+ var KEYWORD_TOKENS = /* @__PURE__ */ new Set([
1747
+ "export",
1748
+ "import",
1749
+ "from",
1750
+ "as",
1751
+ "return",
1752
+ "if",
1753
+ "else",
1754
+ "for",
1755
+ "while",
1756
+ "switch",
1757
+ "case",
1758
+ "break",
1759
+ "continue",
1760
+ "function",
1761
+ "class",
1762
+ "interface",
1763
+ "type",
1764
+ "enum",
1765
+ "const",
1766
+ "let",
1767
+ "var",
1768
+ "new",
1769
+ "extends",
1770
+ "implements",
1771
+ "try",
1772
+ "catch",
1773
+ "finally",
1774
+ "throw",
1775
+ "await",
1776
+ "async",
1777
+ "yield",
1778
+ "default",
1779
+ "in",
1780
+ "of",
1781
+ "do",
1782
+ "this",
1783
+ "super",
1784
+ "private",
1785
+ "public",
1786
+ "protected",
1787
+ "static",
1788
+ "get",
1789
+ "set",
1790
+ "readonly",
1791
+ "abstract",
1792
+ "declare",
1793
+ "namespace",
1794
+ "module",
1795
+ "package",
1796
+ "true",
1797
+ "false",
1798
+ "null",
1799
+ "undefined"
1800
+ ]);
1801
+ var OPERATOR_TOKENS = /* @__PURE__ */ new Set([
1802
+ "=",
1803
+ "==",
1804
+ "===",
1805
+ "!=",
1806
+ "!==",
1807
+ "=>",
1808
+ "+",
1809
+ "-",
1810
+ "*",
1811
+ "/",
1812
+ "%",
1813
+ "&&",
1814
+ "||",
1815
+ "!",
1816
+ "<",
1817
+ ">",
1818
+ "<=",
1819
+ ">=",
1820
+ "??",
1821
+ "?.",
1822
+ "::",
1823
+ ":",
1824
+ ";",
1825
+ ",",
1826
+ ".",
1827
+ "..."
1828
+ ]);
1829
+ function getPositionGuardMessage(token, line, character) {
1830
+ if (!token) {
1831
+ if (line !== void 0 && character !== void 0) {
1832
+ return `Invalid position: no symbol at ${line}:${character}.`;
1833
+ }
1834
+ return "Invalid position: no symbol detected.";
1835
+ }
1836
+ const lowered = token.toLowerCase();
1837
+ if (KEYWORD_TOKENS.has(lowered)) {
1838
+ return `Invalid position: keyword "${token}".`;
1839
+ }
1840
+ if (OPERATOR_TOKENS.has(token)) {
1841
+ return `Invalid position: operator "${token}".`;
1842
+ }
1843
+ return null;
1844
+ }
1723
1845
  function toProjectRelativeIfPossible(filePath) {
1724
1846
  const cwd = getCwd();
1725
1847
  try {
@@ -1872,6 +1994,32 @@ var LspTool = {
1872
1994
  },
1873
1995
  async *call(input, _context) {
1874
1996
  const absPath = getAbsolutePath(input.filePath) ?? input.filePath;
1997
+ const needsLocation = input.operation === "goToDefinition" || input.operation === "findReferences" || input.operation === "hover" || input.operation === "goToImplementation" || input.operation === "prepareCallHierarchy" || input.operation === "incomingCalls" || input.operation === "outgoingCalls" || input.operation === "getScope";
1998
+ if (needsLocation && input.line !== void 0 && input.character !== void 0) {
1999
+ try {
2000
+ const content = readFileSync2(absPath, "utf8");
2001
+ const token = extractSymbolAtPosition(
2002
+ content.split("\n"),
2003
+ input.line - 1,
2004
+ input.character - 1
2005
+ );
2006
+ const guardMessage = getPositionGuardMessage(
2007
+ token,
2008
+ input.line,
2009
+ input.character
2010
+ );
2011
+ if (guardMessage) {
2012
+ const out2 = {
2013
+ operation: input.operation,
2014
+ result: guardMessage,
2015
+ filePath: input.filePath
2016
+ };
2017
+ yield { type: "result", data: out2, resultForAssistant: out2.result };
2018
+ return;
2019
+ }
2020
+ } catch {
2021
+ }
2022
+ }
1875
2023
  const workspaceRoot = input.operation === "workspaceSymbol" ? statSync2(absPath).isDirectory() ? absPath : dirname(absPath) : void 0;
1876
2024
  const targetPath = input.operation === "workspaceSymbol" ? absPath : absPath;
1877
2025
  const formattedResult = await LspFacade.run({