pybao-cli 1.3.49 → 1.3.51

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 (133) hide show
  1. package/dist/REPL-HGBE27IN.js +42 -0
  2. package/dist/{acp-6OUQ7H6U.js → acp-LAPVZQA3.js} +26 -26
  3. package/dist/{agentsValidate-J2PNDNBM.js → agentsValidate-JMWMX3MB.js} +7 -7
  4. package/dist/{ask-3BZLIIBS.js → ask-BD4FCNES.js} +25 -25
  5. package/dist/{autoUpdater-QBVI6CTI.js → autoUpdater-CJG22SEW.js} +3 -3
  6. package/dist/{chunk-ENRBBQDN.js → chunk-3EQQLZE4.js} +4 -4
  7. package/dist/{chunk-WZPKTYHT.js → chunk-4N2642UT.js} +1 -1
  8. package/dist/{chunk-W3BXW7II.js → chunk-6TN4XT74.js} +1 -1
  9. package/dist/{chunk-NN37RDXI.js → chunk-7N2XMOVQ.js} +328 -182
  10. package/dist/chunk-7N2XMOVQ.js.map +7 -0
  11. package/dist/{chunk-MYIG6T5F.js → chunk-ABPSBUQC.js} +2 -2
  12. package/dist/{chunk-RW4L32HN.js → chunk-B62QNVFY.js} +1 -1
  13. package/dist/{chunk-OKLVL6BJ.js → chunk-BSAIDJEJ.js} +2 -2
  14. package/dist/{chunk-INNHNGP3.js → chunk-C6HYECKQ.js} +3 -3
  15. package/dist/{chunk-ZYC4DB3G.js → chunk-E567RAA6.js} +3 -3
  16. package/dist/{chunk-ZFULAWUS.js → chunk-EGFQHPCU.js} +2 -2
  17. package/dist/{chunk-VKA3GRQ7.js → chunk-ESZZYVDK.js} +1 -1
  18. package/dist/{chunk-DQ3QQRPV.js → chunk-F5KZKSH3.js} +2 -2
  19. package/dist/{chunk-G3QWUH66.js → chunk-HITHFTHB.js} +3 -3
  20. package/dist/{chunk-RWLCKRAI.js → chunk-IS5VAOE5.js} +168 -83
  21. package/dist/chunk-IS5VAOE5.js.map +7 -0
  22. package/dist/{chunk-J6YTGLVB.js → chunk-JI5OFKTQ.js} +2 -2
  23. package/dist/{chunk-KDCZKRCN.js → chunk-KR37EQX6.js} +1 -1
  24. package/dist/{chunk-QI6HL74P.js → chunk-LT223NHT.js} +3 -3
  25. package/dist/{chunk-VXKMO6OQ.js → chunk-LYWVXCUX.js} +1 -1
  26. package/dist/{chunk-2AMK6VUE.js → chunk-P2DSZFRF.js} +1 -1
  27. package/dist/{chunk-QM7M2ER7.js → chunk-PE3FS7DD.js} +1 -1
  28. package/dist/{chunk-XUTLA6YR.js → chunk-QJRO335D.js} +3 -3
  29. package/dist/{chunk-B3P6TUJQ.js → chunk-REG5ADDD.js} +1 -1
  30. package/dist/{chunk-JMAZ43RF.js → chunk-THFK234H.js} +2 -2
  31. package/dist/{chunk-HTWMNXVH.js → chunk-ULDHZLLE.js} +3 -3
  32. package/dist/{chunk-CKSCNSGO.js → chunk-YYADUX77.js} +3 -3
  33. package/dist/{chunk-U5YVY2ZJ.js → chunk-ZNCD73BJ.js} +1 -1
  34. package/dist/{chunk-U5YVY2ZJ.js.map → chunk-ZNCD73BJ.js.map} +1 -1
  35. package/dist/{chunk-JS6WJUEJ.js → chunk-ZPTSUA2S.js} +4 -4
  36. package/dist/{cli-XVMAAFAL.js → cli-5BCAP7VK.js} +77 -77
  37. package/dist/commands-QLOCAID7.js +46 -0
  38. package/dist/{config-MPTOPKTC.js → config-OQDKF3CD.js} +4 -4
  39. package/dist/{context-AS5YCQ7Q.js → context-NF4FJFEK.js} +5 -5
  40. package/dist/{customCommands-MWT24UO2.js → customCommands-IXFRKO3B.js} +4 -4
  41. package/dist/{env-BD4TLPUJ.js → env-KXW5FQKK.js} +2 -2
  42. package/dist/index.js +3 -3
  43. package/dist/{llm-TYCMK2E6.js → llm-NMG2UUYR.js} +26 -26
  44. package/dist/{llmLazy-BYDLIART.js → llmLazy-6PUMN62X.js} +1 -1
  45. package/dist/{loader-5TWPQP3K.js → loader-IOYXULJR.js} +4 -4
  46. package/dist/{mcp-XDNI7GJV.js → mcp-ZWZ5JUI4.js} +7 -7
  47. package/dist/{mentionProcessor-V4567WI5.js → mentionProcessor-BLHGSBTI.js} +5 -5
  48. package/dist/{messages-K7ABTOPV.js → messages-GRLE5KCQ.js} +1 -1
  49. package/dist/{model-ATBQ44KG.js → model-CLIHMLR3.js} +5 -5
  50. package/dist/{openai-ED25JRUI.js → openai-OUUKOJWE.js} +5 -5
  51. package/dist/{outputStyles-P5GC3SJX.js → outputStyles-QCM5QWSS.js} +4 -4
  52. package/dist/{pluginRuntime-ZQL56D63.js → pluginRuntime-3KLZVRRO.js} +6 -6
  53. package/dist/{pluginValidation-66AAHNBG.js → pluginValidation-LS2AWCCU.js} +6 -6
  54. package/dist/prompts-SA4OK6QD.js +48 -0
  55. package/dist/{pybAgentSessionLoad-GD3Z6LAG.js → pybAgentSessionLoad-ZONVZBLE.js} +4 -4
  56. package/dist/{pybAgentSessionResume-IKOTCDZW.js → pybAgentSessionResume-CC2LCPTW.js} +4 -4
  57. package/dist/{pybAgentStreamJsonSession-IUMN533Q.js → pybAgentStreamJsonSession-ZNLPABQT.js} +1 -1
  58. package/dist/{pybHooks-ECZOIQMS.js → pybHooks-F3E2A22A.js} +4 -4
  59. package/dist/query-CYYPDG2D.js +50 -0
  60. package/dist/{ripgrep-BLLSBEDA.js → ripgrep-K24UEEMP.js} +3 -3
  61. package/dist/{skillMarketplace-XXFHN2HH.js → skillMarketplace-OU2GDZVW.js} +3 -3
  62. package/dist/{state-OWOACNRS.js → state-IZDGO44E.js} +2 -2
  63. package/dist/{theme-Y46LR7UJ.js → theme-MHQCQKW6.js} +5 -5
  64. package/dist/{toolPermissionSettings-HHGJYLGQ.js → toolPermissionSettings-HRONQYRZ.js} +6 -6
  65. package/dist/tools-XXBWIEJ5.js +47 -0
  66. package/dist/{userInput-FKO2RVA5.js → userInput-EGXVNNBE.js} +27 -27
  67. package/package.json +1 -1
  68. package/dist/REPL-OGPFEZQZ.js +0 -42
  69. package/dist/chunk-NN37RDXI.js.map +0 -7
  70. package/dist/chunk-RWLCKRAI.js.map +0 -7
  71. package/dist/commands-XQBJLM5C.js +0 -46
  72. package/dist/prompts-KDX7FM3E.js +0 -48
  73. package/dist/query-QCVQ7T76.js +0 -50
  74. package/dist/tools-6FBXOCLI.js +0 -47
  75. /package/dist/{REPL-OGPFEZQZ.js.map → REPL-HGBE27IN.js.map} +0 -0
  76. /package/dist/{acp-6OUQ7H6U.js.map → acp-LAPVZQA3.js.map} +0 -0
  77. /package/dist/{agentsValidate-J2PNDNBM.js.map → agentsValidate-JMWMX3MB.js.map} +0 -0
  78. /package/dist/{ask-3BZLIIBS.js.map → ask-BD4FCNES.js.map} +0 -0
  79. /package/dist/{autoUpdater-QBVI6CTI.js.map → autoUpdater-CJG22SEW.js.map} +0 -0
  80. /package/dist/{chunk-ENRBBQDN.js.map → chunk-3EQQLZE4.js.map} +0 -0
  81. /package/dist/{chunk-WZPKTYHT.js.map → chunk-4N2642UT.js.map} +0 -0
  82. /package/dist/{chunk-W3BXW7II.js.map → chunk-6TN4XT74.js.map} +0 -0
  83. /package/dist/{chunk-MYIG6T5F.js.map → chunk-ABPSBUQC.js.map} +0 -0
  84. /package/dist/{chunk-RW4L32HN.js.map → chunk-B62QNVFY.js.map} +0 -0
  85. /package/dist/{chunk-OKLVL6BJ.js.map → chunk-BSAIDJEJ.js.map} +0 -0
  86. /package/dist/{chunk-INNHNGP3.js.map → chunk-C6HYECKQ.js.map} +0 -0
  87. /package/dist/{chunk-ZYC4DB3G.js.map → chunk-E567RAA6.js.map} +0 -0
  88. /package/dist/{chunk-ZFULAWUS.js.map → chunk-EGFQHPCU.js.map} +0 -0
  89. /package/dist/{chunk-VKA3GRQ7.js.map → chunk-ESZZYVDK.js.map} +0 -0
  90. /package/dist/{chunk-DQ3QQRPV.js.map → chunk-F5KZKSH3.js.map} +0 -0
  91. /package/dist/{chunk-G3QWUH66.js.map → chunk-HITHFTHB.js.map} +0 -0
  92. /package/dist/{chunk-J6YTGLVB.js.map → chunk-JI5OFKTQ.js.map} +0 -0
  93. /package/dist/{chunk-KDCZKRCN.js.map → chunk-KR37EQX6.js.map} +0 -0
  94. /package/dist/{chunk-QI6HL74P.js.map → chunk-LT223NHT.js.map} +0 -0
  95. /package/dist/{chunk-VXKMO6OQ.js.map → chunk-LYWVXCUX.js.map} +0 -0
  96. /package/dist/{chunk-2AMK6VUE.js.map → chunk-P2DSZFRF.js.map} +0 -0
  97. /package/dist/{chunk-QM7M2ER7.js.map → chunk-PE3FS7DD.js.map} +0 -0
  98. /package/dist/{chunk-XUTLA6YR.js.map → chunk-QJRO335D.js.map} +0 -0
  99. /package/dist/{chunk-B3P6TUJQ.js.map → chunk-REG5ADDD.js.map} +0 -0
  100. /package/dist/{chunk-JMAZ43RF.js.map → chunk-THFK234H.js.map} +0 -0
  101. /package/dist/{chunk-HTWMNXVH.js.map → chunk-ULDHZLLE.js.map} +0 -0
  102. /package/dist/{chunk-CKSCNSGO.js.map → chunk-YYADUX77.js.map} +0 -0
  103. /package/dist/{chunk-JS6WJUEJ.js.map → chunk-ZPTSUA2S.js.map} +0 -0
  104. /package/dist/{cli-XVMAAFAL.js.map → cli-5BCAP7VK.js.map} +0 -0
  105. /package/dist/{commands-XQBJLM5C.js.map → commands-QLOCAID7.js.map} +0 -0
  106. /package/dist/{config-MPTOPKTC.js.map → config-OQDKF3CD.js.map} +0 -0
  107. /package/dist/{context-AS5YCQ7Q.js.map → context-NF4FJFEK.js.map} +0 -0
  108. /package/dist/{customCommands-MWT24UO2.js.map → customCommands-IXFRKO3B.js.map} +0 -0
  109. /package/dist/{env-BD4TLPUJ.js.map → env-KXW5FQKK.js.map} +0 -0
  110. /package/dist/{llm-TYCMK2E6.js.map → llm-NMG2UUYR.js.map} +0 -0
  111. /package/dist/{llmLazy-BYDLIART.js.map → llmLazy-6PUMN62X.js.map} +0 -0
  112. /package/dist/{loader-5TWPQP3K.js.map → loader-IOYXULJR.js.map} +0 -0
  113. /package/dist/{mcp-XDNI7GJV.js.map → mcp-ZWZ5JUI4.js.map} +0 -0
  114. /package/dist/{mentionProcessor-V4567WI5.js.map → mentionProcessor-BLHGSBTI.js.map} +0 -0
  115. /package/dist/{messages-K7ABTOPV.js.map → messages-GRLE5KCQ.js.map} +0 -0
  116. /package/dist/{model-ATBQ44KG.js.map → model-CLIHMLR3.js.map} +0 -0
  117. /package/dist/{openai-ED25JRUI.js.map → openai-OUUKOJWE.js.map} +0 -0
  118. /package/dist/{outputStyles-P5GC3SJX.js.map → outputStyles-QCM5QWSS.js.map} +0 -0
  119. /package/dist/{pluginRuntime-ZQL56D63.js.map → pluginRuntime-3KLZVRRO.js.map} +0 -0
  120. /package/dist/{pluginValidation-66AAHNBG.js.map → pluginValidation-LS2AWCCU.js.map} +0 -0
  121. /package/dist/{prompts-KDX7FM3E.js.map → prompts-SA4OK6QD.js.map} +0 -0
  122. /package/dist/{pybAgentSessionLoad-GD3Z6LAG.js.map → pybAgentSessionLoad-ZONVZBLE.js.map} +0 -0
  123. /package/dist/{pybAgentSessionResume-IKOTCDZW.js.map → pybAgentSessionResume-CC2LCPTW.js.map} +0 -0
  124. /package/dist/{pybAgentStreamJsonSession-IUMN533Q.js.map → pybAgentStreamJsonSession-ZNLPABQT.js.map} +0 -0
  125. /package/dist/{pybHooks-ECZOIQMS.js.map → pybHooks-F3E2A22A.js.map} +0 -0
  126. /package/dist/{query-QCVQ7T76.js.map → query-CYYPDG2D.js.map} +0 -0
  127. /package/dist/{ripgrep-BLLSBEDA.js.map → ripgrep-K24UEEMP.js.map} +0 -0
  128. /package/dist/{skillMarketplace-XXFHN2HH.js.map → skillMarketplace-OU2GDZVW.js.map} +0 -0
  129. /package/dist/{state-OWOACNRS.js.map → state-IZDGO44E.js.map} +0 -0
  130. /package/dist/{theme-Y46LR7UJ.js.map → theme-MHQCQKW6.js.map} +0 -0
  131. /package/dist/{toolPermissionSettings-HHGJYLGQ.js.map → toolPermissionSettings-HRONQYRZ.js.map} +0 -0
  132. /package/dist/{tools-6FBXOCLI.js.map → tools-XXBWIEJ5.js.map} +0 -0
  133. /package/dist/{userInput-FKO2RVA5.js.map → userInput-EGXVNNBE.js.map} +0 -0
@@ -8,11 +8,11 @@ import {
8
8
  } from "./chunk-BJSWTHRM.js";
9
9
  import {
10
10
  debug
11
- } from "./chunk-2AMK6VUE.js";
11
+ } from "./chunk-P2DSZFRF.js";
12
12
  import {
13
13
  getCwd,
14
14
  logError
15
- } from "./chunk-B3P6TUJQ.js";
15
+ } from "./chunk-REG5ADDD.js";
16
16
 
17
17
  // src/utils/agent/loader.ts
18
18
  import {
@@ -448,7 +448,7 @@ function getLastAssistantMessageId(messages) {
448
448
 
449
449
  // src/utils/messages/index.ts
450
450
  async function processUserInput(input, mode, setToolJSX, context, pastedImages) {
451
- const impl = await import("./userInput-FKO2RVA5.js");
451
+ const impl = await import("./userInput-EGXVNNBE.js");
452
452
  return impl.processUserInput(input, mode, setToolJSX, context, pastedImages);
453
453
  }
454
454
 
@@ -4,7 +4,7 @@ import {
4
4
  getSettingsFileCandidates,
5
5
  loadSettingsWithLegacyFallback,
6
6
  saveSettingsToPrimaryAndSyncLegacy
7
- } from "./chunk-WZPKTYHT.js";
7
+ } from "./chunk-4N2642UT.js";
8
8
  import {
9
9
  isSettingSourceEnabled
10
10
  } from "./chunk-A3BVXXA3.js";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-BJSWTHRM.js";
14
14
  import {
15
15
  getCwd
16
- } from "./chunk-B3P6TUJQ.js";
16
+ } from "./chunk-REG5ADDD.js";
17
17
 
18
18
  // src/services/ui/outputStyles.ts
19
19
  import figures from "figures";
@@ -5,17 +5,17 @@ import {
5
5
  getGlobalConfig,
6
6
  getOrCreateUserID,
7
7
  saveCurrentProjectConfig
8
- } from "./chunk-QI6HL74P.js";
8
+ } from "./chunk-LT223NHT.js";
9
9
  import {
10
10
  SESSION_ID,
11
11
  env,
12
12
  execFileNoThrow,
13
13
  getCwd,
14
14
  logError
15
- } from "./chunk-B3P6TUJQ.js";
15
+ } from "./chunk-REG5ADDD.js";
16
16
  import {
17
17
  MACRO
18
- } from "./chunk-U5YVY2ZJ.js";
18
+ } from "./chunk-ZNCD73BJ.js";
19
19
  import {
20
20
  __require
21
21
  } from "./chunk-I3J4JYES.js";
@@ -3,13 +3,13 @@ const require = __pybCreateRequire(import.meta.url);
3
3
  import {
4
4
  getGlobalConfig,
5
5
  saveGlobalConfig
6
- } from "./chunk-QI6HL74P.js";
6
+ } from "./chunk-LT223NHT.js";
7
7
  import {
8
8
  debug
9
- } from "./chunk-2AMK6VUE.js";
9
+ } from "./chunk-P2DSZFRF.js";
10
10
  import {
11
11
  logError
12
- } from "./chunk-B3P6TUJQ.js";
12
+ } from "./chunk-REG5ADDD.js";
13
13
 
14
14
  // src/utils/model/index.ts
15
15
  import { memoize } from "lodash-es";
@@ -5,12 +5,12 @@ import {
5
5
  } from "./chunk-BJSWTHRM.js";
6
6
  import {
7
7
  debug
8
- } from "./chunk-2AMK6VUE.js";
8
+ } from "./chunk-P2DSZFRF.js";
9
9
  import {
10
10
  getCwd,
11
11
  getPybBaseDir,
12
12
  logError
13
- } from "./chunk-B3P6TUJQ.js";
13
+ } from "./chunk-REG5ADDD.js";
14
14
 
15
15
  // src/services/plugins/customCommands.ts
16
16
  import { existsSync, readFileSync, readdirSync, statSync } from "fs";
@@ -4,7 +4,7 @@ import {
4
4
  BunShell,
5
5
  execFileNoThrow,
6
6
  logError
7
- } from "./chunk-B3P6TUJQ.js";
7
+ } from "./chunk-REG5ADDD.js";
8
8
 
9
9
  // src/utils/system/ripgrep.ts
10
10
  import { rgPath } from "@vscode/ripgrep";
@@ -9,10 +9,10 @@ import {
9
9
  PLAN_SLUG_VERBS,
10
10
  getCwd,
11
11
  getPybBaseDir
12
- } from "./chunk-B3P6TUJQ.js";
12
+ } from "./chunk-REG5ADDD.js";
13
13
  import {
14
14
  MACRO
15
- } from "./chunk-U5YVY2ZJ.js";
15
+ } from "./chunk-ZNCD73BJ.js";
16
16
 
17
17
  // src/utils/protocol/pybAgentSessionLog.ts
18
18
  import { execFileSync } from "child_process";
@@ -4,10 +4,10 @@ import {
4
4
  PRODUCT_NAME,
5
5
  execFileNoThrow,
6
6
  logError
7
- } from "./chunk-B3P6TUJQ.js";
7
+ } from "./chunk-REG5ADDD.js";
8
8
  import {
9
9
  MACRO
10
- } from "./chunk-U5YVY2ZJ.js";
10
+ } from "./chunk-ZNCD73BJ.js";
11
11
 
12
12
  // src/utils/session/autoUpdater.ts
13
13
  async function getSemver() {
@@ -82,7 +82,7 @@ async function checkAndNotifyUpdate() {
82
82
  const [
83
83
  { isAutoUpdaterDisabled, getGlobalConfig, saveGlobalConfig },
84
84
  { env }
85
- ] = await Promise.all([import("./config-MPTOPKTC.js"), import("./env-BD4TLPUJ.js")]);
85
+ ] = await Promise.all([import("./config-OQDKF3CD.js"), import("./env-KXW5FQKK.js")]);
86
86
  if (await isAutoUpdaterDisabled()) return;
87
87
  if (await env.getIsDocker()) return;
88
88
  if (!await env.hasInternetAccess()) return;
@@ -13,6 +13,7 @@ import {
13
13
  GrepTool,
14
14
  KillShellTool,
15
15
  NotebookEditTool,
16
+ ParserRegistry,
16
17
  SkillTool,
17
18
  SlashCommandTool,
18
19
  TodoWriteTool,
@@ -28,45 +29,45 @@ import {
28
29
  hasWritePermission,
29
30
  loadLanguage,
30
31
  query
31
- } from "./chunk-NN37RDXI.js";
32
+ } from "./chunk-7N2XMOVQ.js";
32
33
  import {
33
34
  FallbackToolUseRejectedMessage,
34
35
  MCPTool,
35
36
  getClients,
36
37
  getMCPTools
37
- } from "./chunk-ENRBBQDN.js";
38
+ } from "./chunk-3EQQLZE4.js";
38
39
  import {
39
40
  queryLLM
40
- } from "./chunk-JS6WJUEJ.js";
41
+ } from "./chunk-ZPTSUA2S.js";
41
42
  import {
42
43
  tree
43
- } from "./chunk-VKA3GRQ7.js";
44
+ } from "./chunk-ESZZYVDK.js";
44
45
  import {
45
46
  generateAgentId
46
- } from "./chunk-JMAZ43RF.js";
47
+ } from "./chunk-THFK234H.js";
47
48
  import {
48
49
  getActiveAgents,
49
50
  getAgentByType,
50
51
  getAvailableAgentTypes
51
- } from "./chunk-MYIG6T5F.js";
52
+ } from "./chunk-ABPSBUQC.js";
52
53
  import {
53
54
  INTERRUPT_MESSAGE,
54
55
  createAssistantMessage,
55
56
  createUserMessage,
56
57
  getLastAssistantMessageId
57
- } from "./chunk-RW4L32HN.js";
58
+ } from "./chunk-B62QNVFY.js";
58
59
  import {
59
60
  getModelManager
60
- } from "./chunk-ZYC4DB3G.js";
61
+ } from "./chunk-E567RAA6.js";
61
62
  import {
62
63
  getContext
63
- } from "./chunk-INNHNGP3.js";
64
+ } from "./chunk-C6HYECKQ.js";
64
65
  import {
65
66
  getTheme
66
- } from "./chunk-QM7M2ER7.js";
67
+ } from "./chunk-PE3FS7DD.js";
67
68
  import {
68
69
  debug
69
- } from "./chunk-2AMK6VUE.js";
70
+ } from "./chunk-P2DSZFRF.js";
70
71
  import {
71
72
  BunShell,
72
73
  getCwd,
@@ -75,7 +76,7 @@ import {
75
76
  logError,
76
77
  overwriteLog,
77
78
  readTaskOutput
78
- } from "./chunk-B3P6TUJQ.js";
79
+ } from "./chunk-REG5ADDD.js";
79
80
  import {
80
81
  formatDuration,
81
82
  formatNumber
@@ -981,7 +982,7 @@ var DeleteTool = {
981
982
  return false;
982
983
  },
983
984
  needsPermissions({ file_paths }) {
984
- return file_paths.some((path2) => !hasWritePermission(path2));
985
+ return file_paths.some((path) => !hasWritePermission(path));
985
986
  },
986
987
  renderToolUseMessage(input, { verbose }) {
987
988
  const paths = input.file_paths.map(
@@ -1195,8 +1196,8 @@ var LSTool = {
1195
1196
  isConcurrencySafe() {
1196
1197
  return true;
1197
1198
  },
1198
- needsPermissions({ path: path2 }) {
1199
- return !hasReadPermission(path2);
1199
+ needsPermissions({ path }) {
1200
+ return !hasReadPermission(path);
1200
1201
  },
1201
1202
  async prompt() {
1202
1203
  return DESCRIPTION3;
@@ -1204,10 +1205,10 @@ var LSTool = {
1204
1205
  renderResultForAssistant(data) {
1205
1206
  return data;
1206
1207
  },
1207
- renderToolUseMessage({ path: path2 }, { verbose }) {
1208
- const absolutePath = path2 ? isAbsolute2(path2) ? path2 : resolve2(getCwd(), path2) : void 0;
1208
+ renderToolUseMessage({ path }, { verbose }) {
1209
+ const absolutePath = path ? isAbsolute2(path) ? path : resolve2(getCwd(), path) : void 0;
1209
1210
  const relativePath = absolutePath ? relative2(getCwd(), absolutePath) : ".";
1210
- return `path: "${verbose ? path2 : relativePath}"`;
1211
+ return `path: "${verbose ? path : relativePath}"`;
1211
1212
  },
1212
1213
  renderToolUseRejectedMessage() {
1213
1214
  return /* @__PURE__ */ React5.createElement(FallbackToolUseRejectedMessage, null);
@@ -1221,8 +1222,8 @@ var LSTool = {
1221
1222
  const MAX_DISPLAY_LINES = 10;
1222
1223
  return /* @__PURE__ */ React5.createElement(Box5, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React5.createElement(Box5, null, /* @__PURE__ */ React5.createElement(Text5, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React5.createElement(Box5, { flexDirection: "column", paddingLeft: 0 }, lines.slice(0, verbose ? void 0 : MAX_DISPLAY_LINES).map((line, i) => /* @__PURE__ */ React5.createElement(Text5, { key: i }, line)), !verbose && lines.length > MAX_DISPLAY_LINES && /* @__PURE__ */ React5.createElement(Text5, { color: getTheme().secondaryText }, "... (+", lines.length - MAX_DISPLAY_LINES, " lines)"))));
1223
1224
  },
1224
- async *call({ path: path2 }, { abortController }) {
1225
- const fullFilePath = isAbsolute2(path2) ? path2 : resolve2(getCwd(), path2);
1225
+ async *call({ path }, { abortController }) {
1226
+ const fullFilePath = isAbsolute2(path) ? path : resolve2(getCwd(), path);
1226
1227
  const treeOutput = await tree(
1227
1228
  fullFilePath,
1228
1229
  MAX_FILES_LIMIT,
@@ -2555,62 +2556,6 @@ function formatGenericDocumentSymbolResult(result) {
2555
2556
  };
2556
2557
  }
2557
2558
 
2558
- // src/utils/tree-sitter/registry.ts
2559
- import path from "path";
2560
- var ParserRegistry = class {
2561
- static extensionMap = {
2562
- ".ts": "typescript",
2563
- ".tsx": "tsx",
2564
- ".js": "typescript",
2565
- // Use TS parser for JS
2566
- ".jsx": "tsx",
2567
- ".py": "python",
2568
- ".sh": "bash",
2569
- ".bash": "bash",
2570
- ".rs": "rust",
2571
- ".go": "go",
2572
- ".java": "java",
2573
- ".cpp": "cpp",
2574
- ".c": "c",
2575
- ".h": "c",
2576
- ".cc": "cpp",
2577
- ".cs": "c_sharp",
2578
- ".scala": "scala",
2579
- ".sbt": "scala",
2580
- ".sc": "scala",
2581
- ".hs": "haskell",
2582
- ".lhs": "haskell",
2583
- ".jl": "julia",
2584
- ".ml": "ocaml",
2585
- ".mli": "ocaml",
2586
- ".swift": "swift",
2587
- ".nix": "nix",
2588
- ".rb": "ruby",
2589
- ".html": "html",
2590
- ".htm": "html",
2591
- ".css": "css",
2592
- ".json": "json",
2593
- ".jsonc": "json",
2594
- ".yaml": "yaml",
2595
- ".yml": "yaml"
2596
- };
2597
- /**
2598
- * Get the supported language ID for a given filename.
2599
- * Returns null if the extension is not supported.
2600
- */
2601
- static getLanguage(filename) {
2602
- const ext = path.extname(filename).toLowerCase();
2603
- return this.extensionMap[ext] || null;
2604
- }
2605
- /**
2606
- * Register or override a file extension mapping.
2607
- */
2608
- static registerExtension(ext, lang) {
2609
- const normalizedExt = ext.startsWith(".") ? ext : `.${ext}`;
2610
- this.extensionMap[normalizedExt.toLowerCase()] = lang;
2611
- }
2612
- };
2613
-
2614
2559
  // src/utils/tree-sitter/lsp-adapter.ts
2615
2560
  import { readFile } from "fs/promises";
2616
2561
  var SYMBOL_KIND_MAP = {
@@ -2722,7 +2667,90 @@ var TreeSitterLspAdapter = class {
2722
2667
  }
2723
2668
  };
2724
2669
 
2670
+ // src/utils/tree-sitter/scope-analyzer.ts
2671
+ import { Query } from "web-tree-sitter";
2672
+ var QUERIES = {
2673
+ python: `
2674
+ (function_definition name: (identifier) @name)
2675
+ (parameters (identifier) @param)
2676
+ (assignment left: (identifier) @var)
2677
+ `,
2678
+ typescript: `
2679
+ (function_declaration name: (identifier) @name)
2680
+ (variable_declarator name: (identifier) @var)
2681
+ (required_parameter pattern: (identifier) @param)
2682
+ (optional_parameter pattern: (identifier) @param)
2683
+ `
2684
+ };
2685
+ var ScopeAnalyzer = class {
2686
+ static async getScope(filename, code, position) {
2687
+ const langKey = ParserRegistry.getLanguage(filename);
2688
+ if (!langKey) {
2689
+ throw new Error(`Unsupported language for file: ${filename}`);
2690
+ }
2691
+ const parser = await loadLanguage(langKey);
2692
+ const tree2 = parser.parse(code);
2693
+ const node = tree2.rootNode.descendantForPosition(position);
2694
+ const ancestors = [];
2695
+ let current = node;
2696
+ while (current) {
2697
+ ancestors.push(current);
2698
+ current = current.parent;
2699
+ }
2700
+ const scopeNodes = ancestors.filter(
2701
+ (n) => n.type === "function_definition" || n.type === "function_declaration" || n.type === "module" || // Python root
2702
+ n.type === "program"
2703
+ // TS root
2704
+ );
2705
+ const result = {
2706
+ locals: [],
2707
+ closure: []
2708
+ };
2709
+ if (scopeNodes.length === 0) return result;
2710
+ const queryStr = QUERIES[langKey];
2711
+ if (!queryStr) return result;
2712
+ const language = parser.language;
2713
+ if (!language) return result;
2714
+ const query2 = new Query(language, queryStr);
2715
+ for (let i = 0; i < scopeNodes.length; i++) {
2716
+ const scopeNode = scopeNodes[i];
2717
+ const captures = query2.captures(scopeNode);
2718
+ const names = /* @__PURE__ */ new Set();
2719
+ for (const capture of captures) {
2720
+ const defNode = capture.node;
2721
+ let temp = defNode.parent;
2722
+ if (temp && (temp.type === "function_definition" || temp.type === "function_declaration")) {
2723
+ if (capture.name === "name") {
2724
+ temp = temp.parent;
2725
+ }
2726
+ }
2727
+ let isDirect = true;
2728
+ while (temp && temp.id !== scopeNode.id) {
2729
+ if (temp.type === "function_definition" || temp.type === "function_declaration") {
2730
+ isDirect = false;
2731
+ break;
2732
+ }
2733
+ temp = temp.parent;
2734
+ }
2735
+ if (isDirect) {
2736
+ names.add(defNode.text);
2737
+ }
2738
+ }
2739
+ if (i === 0) {
2740
+ result.locals = Array.from(names);
2741
+ } else {
2742
+ for (const name of names) {
2743
+ result.closure.push(name);
2744
+ }
2745
+ }
2746
+ }
2747
+ result.closure = Array.from(new Set(result.closure));
2748
+ return result;
2749
+ }
2750
+ };
2751
+
2725
2752
  // src/tools/search/LspTool/LspTool.tsx
2753
+ import { readFile as readFile2 } from "fs/promises";
2726
2754
  var inputSchema6 = z6.strictObject({
2727
2755
  operation: z6.enum([
2728
2756
  "goToDefinition",
@@ -2733,7 +2761,8 @@ var inputSchema6 = z6.strictObject({
2733
2761
  "goToImplementation",
2734
2762
  "prepareCallHierarchy",
2735
2763
  "incomingCalls",
2736
- "outgoingCalls"
2764
+ "outgoingCalls",
2765
+ "getScope"
2737
2766
  ]).describe("The LSP operation to perform"),
2738
2767
  filePath: z6.string().describe("The absolute or relative path to the file"),
2739
2768
  line: z6.number().int().positive().describe("The line number (1-based, as shown in editors)"),
@@ -2749,7 +2778,8 @@ var outputSchema = z6.object({
2749
2778
  "goToImplementation",
2750
2779
  "prepareCallHierarchy",
2751
2780
  "incomingCalls",
2752
- "outgoingCalls"
2781
+ "outgoingCalls",
2782
+ "getScope"
2753
2783
  ]).describe("The LSP operation that was performed"),
2754
2784
  result: z6.string().describe("The formatted result of the LSP operation"),
2755
2785
  filePath: z6.string().describe("The file path the operation was performed on"),
@@ -2765,7 +2795,8 @@ var OPERATION_LABELS = {
2765
2795
  goToImplementation: { singular: "implementation", plural: "implementations" },
2766
2796
  prepareCallHierarchy: { singular: "call item", plural: "call items" },
2767
2797
  incomingCalls: { singular: "caller", plural: "callers" },
2768
- outgoingCalls: { singular: "callee", plural: "callees" }
2798
+ outgoingCalls: { singular: "callee", plural: "callees" },
2799
+ getScope: { singular: "scope", plural: "scopes" }
2769
2800
  };
2770
2801
  function summarizeToolResult(operation, resultCount, fileCount) {
2771
2802
  const label = OPERATION_LABELS[operation] ?? {
@@ -2906,7 +2937,7 @@ var LspTool = {
2906
2937
  }
2907
2938
  return text;
2908
2939
  };
2909
- const formatted = symbols.length > 0 ? formatSymbols(symbols) : "No symbols found.";
2940
+ const formatted = symbols.length > 0 ? "Document symbols:\n" + formatSymbols(symbols) : "No symbols found.";
2910
2941
  const out2 = {
2911
2942
  operation: input.operation,
2912
2943
  result: formatted,
@@ -2920,6 +2951,60 @@ var LspTool = {
2920
2951
  }
2921
2952
  }
2922
2953
  }
2954
+ if (input.operation === "getScope") {
2955
+ const lang = ParserRegistry.getLanguage(absPath);
2956
+ if (lang) {
2957
+ try {
2958
+ const code = await readFile2(absPath, "utf-8");
2959
+ const scope = await ScopeAnalyzer.getScope(absPath, code, { row: input.line - 1, column: input.character - 1 });
2960
+ let resultText = "";
2961
+ if (scope.locals.length > 0) {
2962
+ resultText += `Locals: ${scope.locals.join(", ")}
2963
+ `;
2964
+ } else {
2965
+ resultText += `Locals: (none)
2966
+ `;
2967
+ }
2968
+ if (scope.closure.length > 0) {
2969
+ resultText += `Closure: ${scope.closure.join(", ")}
2970
+ `;
2971
+ } else {
2972
+ resultText += `Closure: (none)
2973
+ `;
2974
+ }
2975
+ const out2 = {
2976
+ operation: input.operation,
2977
+ result: resultText,
2978
+ filePath: input.filePath,
2979
+ resultCount: scope.locals.length + scope.closure.length,
2980
+ fileCount: 1
2981
+ };
2982
+ yield { type: "result", data: out2, resultForAssistant: out2.result };
2983
+ return;
2984
+ } catch (err) {
2985
+ const message = err instanceof Error ? err.message : String(err);
2986
+ const out2 = {
2987
+ operation: input.operation,
2988
+ result: `Error performing getScope: ${message}`,
2989
+ filePath: input.filePath,
2990
+ resultCount: 0,
2991
+ fileCount: 0
2992
+ };
2993
+ yield { type: "result", data: out2, resultForAssistant: out2.result };
2994
+ return;
2995
+ }
2996
+ } else {
2997
+ const out2 = {
2998
+ operation: input.operation,
2999
+ result: `getScope not supported for this language`,
3000
+ filePath: input.filePath,
3001
+ resultCount: 0,
3002
+ fileCount: 0
3003
+ };
3004
+ yield { type: "result", data: out2, resultForAssistant: out2.result };
3005
+ return;
3006
+ }
3007
+ }
2923
3008
  const client = await LspClientManager.getInstance().getClient(absPath, getCwd());
2924
3009
  if (client) {
2925
3010
  try {
@@ -3323,10 +3408,10 @@ function applyAgentPermissionMode(base, options) {
3323
3408
  }
3324
3409
  return { ...base, mode: options.agentPermissionMode };
3325
3410
  }
3326
- function readJsonArrayFile(path2) {
3327
- if (!existsSync6(path2)) return null;
3411
+ function readJsonArrayFile(path) {
3412
+ if (!existsSync6(path)) return null;
3328
3413
  try {
3329
- const raw = readFileSync4(path2, "utf8");
3414
+ const raw = readFileSync4(path, "utf8");
3330
3415
  const parsed = JSON.parse(raw);
3331
3416
  return Array.isArray(parsed) ? parsed : null;
3332
3417
  } catch {