pybao-cli 1.4.96 → 1.4.98

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 (155) hide show
  1. package/dist/REPL-HSLBK5NZ.js +49 -0
  2. package/dist/{acp-DSHGC42G.js → acp-OYNDAMUG.js} +30 -30
  3. package/dist/{agentsValidate-XCGG77GS.js → agentsValidate-CSJFTPMF.js} +7 -7
  4. package/dist/{ask-BTEWFWX7.js → ask-RUL7DBVW.js} +29 -29
  5. package/dist/{autoUpdater-2JPYTHJU.js → autoUpdater-2US37QCD.js} +3 -3
  6. package/dist/{chunk-5ZRN3ED2.js → chunk-277MFG2S.js} +2 -2
  7. package/dist/{chunk-BABSJ55B.js → chunk-45KNYAUE.js} +3 -3
  8. package/dist/{chunk-BZJ63VLB.js → chunk-57TUHQTK.js} +1 -1
  9. package/dist/{chunk-XJEOCTTA.js → chunk-5FPVUG76.js} +1 -1
  10. package/dist/{chunk-IAFDLMER.js → chunk-5SASDPJI.js} +326 -16
  11. package/dist/chunk-5SASDPJI.js.map +7 -0
  12. package/dist/{chunk-37Z4UJE7.js → chunk-6CFLL7MP.js} +3 -3
  13. package/dist/{chunk-VYTXJQMG.js → chunk-6CZGZTTR.js} +4 -4
  14. package/dist/{chunk-NUVWA6CG.js → chunk-6W4QXF5T.js} +2 -2
  15. package/dist/{chunk-WFTCIKRP.js → chunk-736LB6QF.js} +3 -3
  16. package/dist/{chunk-V3I6BY55.js → chunk-7HPC6NEL.js} +4 -4
  17. package/dist/{chunk-ZWWEN5JT.js → chunk-7YOXNCGC.js} +2 -2
  18. package/dist/{chunk-C63QE2JE.js → chunk-AQDHWNHO.js} +1 -1
  19. package/dist/{chunk-GDYCFPX7.js → chunk-EKCV6FAR.js} +3 -3
  20. package/dist/{chunk-SWUVTC7Q.js → chunk-ELZOI2EN.js} +1 -1
  21. package/dist/{chunk-KXGXMSPS.js → chunk-FTXV6D26.js} +1 -1
  22. package/dist/{chunk-CKY2L3QE.js → chunk-FUO4GQ7W.js} +1 -1
  23. package/dist/{chunk-CKY2L3QE.js.map → chunk-FUO4GQ7W.js.map} +1 -1
  24. package/dist/{chunk-T4LDHDO5.js → chunk-G2NDX3AE.js} +1 -1
  25. package/dist/{chunk-MMICBXP5.js → chunk-HIRKT55M.js} +3 -3
  26. package/dist/{chunk-AZOP5QKF.js → chunk-JN7LIP22.js} +2 -2
  27. package/dist/{chunk-2KWRWCZO.js → chunk-KJLAOYAB.js} +399 -146
  28. package/dist/chunk-KJLAOYAB.js.map +7 -0
  29. package/dist/{chunk-73JVPKCJ.js → chunk-MSUD3TJP.js} +71 -35
  30. package/dist/chunk-MSUD3TJP.js.map +7 -0
  31. package/dist/{chunk-IZPWMY6H.js → chunk-N6RZW54E.js} +1 -1
  32. package/dist/{chunk-NPLYGSR3.js → chunk-NFCKELD5.js} +2 -2
  33. package/dist/{chunk-LYAYIYBK.js → chunk-NJY725BV.js} +3 -3
  34. package/dist/chunk-O6DTZU7F.js.map +7 -0
  35. package/dist/{chunk-GIXD4Z4O.js → chunk-QCPTRT42.js} +1 -1
  36. package/dist/{chunk-SXCGPQ3R.js → chunk-VFEFTBAX.js} +2 -2
  37. package/dist/{chunk-IZLBXT6P.js → chunk-WS3OA4DJ.js} +1 -1
  38. package/dist/{chunk-IXOS2743.js → chunk-X3S6OAMU.js} +2 -2
  39. package/dist/{chunk-W2YU6ZJG.js → chunk-XFAWFKEO.js} +4 -4
  40. package/dist/{chunk-RXJNQXGH.js → chunk-Y56ETINA.js} +4 -4
  41. package/dist/{chunk-65ADQNJL.js → chunk-ZT2EDUJ5.js} +1 -1
  42. package/dist/{cli-2YFCKDKV.js → cli-EW2FS2BF.js} +92 -90
  43. package/dist/{cli-2YFCKDKV.js.map → cli-EW2FS2BF.js.map} +2 -2
  44. package/dist/commands-ED3B27YA.js +53 -0
  45. package/dist/{config-BS3TSRO2.js → config-VMG22F4D.js} +4 -4
  46. package/dist/{context-GUWJH2XE.js → context-RCECS2MV.js} +6 -6
  47. package/dist/{conversationTracker-3OMO23AJ.js → conversationTracker-EDZLP7O4.js} +3 -3
  48. package/dist/{customCommands-O4D67KVC.js → customCommands-B6RXZMP5.js} +4 -4
  49. package/dist/{env-4M3GZSUS.js → env-YTAL5KRK.js} +2 -2
  50. package/dist/{file-FIYEKO7W.js → file-OOCDMD3U.js} +4 -4
  51. package/dist/index.js +3 -3
  52. package/dist/{llm-MXURYD2K.js → llm-R5NWZO5G.js} +31 -31
  53. package/dist/{llmLazy-X6M4BHF3.js → llmLazy-VWKTHJ4M.js} +1 -1
  54. package/dist/{loader-DDBTFUPC.js → loader-WWGN7JMY.js} +4 -4
  55. package/dist/{lsp-2SCBURX2.js → lsp-YT4SHOXN.js} +6 -6
  56. package/dist/{lspAnchor-YV4BDQJX.js → lspAnchor-B3LGI6VC.js} +6 -6
  57. package/dist/{mcp-CKGQUT3S.js → mcp-AIT7BP27.js} +7 -7
  58. package/dist/{mentionProcessor-NDVGHEEZ.js → mentionProcessor-TTRH7MSS.js} +5 -5
  59. package/dist/{messages-UHUC65DS.js → messages-V5YRA4WO.js} +1 -1
  60. package/dist/{model-RS4VTMY6.js → model-7QLTSWZV.js} +7 -5
  61. package/dist/{openai-QRE5RM6W.js → openai-O5UTQHNX.js} +5 -5
  62. package/dist/{outputStyles-UZYGNQU7.js → outputStyles-CUYPATTD.js} +4 -4
  63. package/dist/{pluginRuntime-4Z2SPLJI.js → pluginRuntime-Z3VUXLLL.js} +6 -6
  64. package/dist/{pluginValidation-GHCMPEC7.js → pluginValidation-OIFMXGZW.js} +6 -6
  65. package/dist/prompts-VSYX4Z3H.js +55 -0
  66. package/dist/{pybAgentSessionLoad-KTU6VBIE.js → pybAgentSessionLoad-YE3R7GCM.js} +4 -4
  67. package/dist/{pybAgentSessionResume-MKLZH2QZ.js → pybAgentSessionResume-H3X4E5WZ.js} +4 -4
  68. package/dist/{pybAgentStreamJsonSession-66HVTHC4.js → pybAgentStreamJsonSession-LBTQ5QVA.js} +1 -1
  69. package/dist/{pybHooks-RL2D75BA.js → pybHooks-ICFUKF5J.js} +4 -4
  70. package/dist/query-3MCWSQFG.js +57 -0
  71. package/dist/{registry-HT2QIYZF.js → registry-U5KXMAQT.js} +5 -5
  72. package/dist/{ripgrep-Q26JLKZK.js → ripgrep-WWOPEBCI.js} +3 -3
  73. package/dist/{skillMarketplace-WX46FV3B.js → skillMarketplace-P7BGMBU7.js} +3 -3
  74. package/dist/{state-7D3EAZYW.js → state-BNEI4WAC.js} +2 -2
  75. package/dist/{theme-XZ67BKEX.js → theme-4JWO3G3X.js} +5 -5
  76. package/dist/{toolPermissionSettings-WDXG4PH5.js → toolPermissionSettings-LQLARZGN.js} +6 -6
  77. package/dist/tools-6AAIJTHG.js +54 -0
  78. package/dist/{userInput-LHXC33VV.js → userInput-GMSZGZQS.js} +31 -31
  79. package/package.json +1 -1
  80. package/dist/REPL-4XDQ5LO2.js +0 -49
  81. package/dist/chunk-2KWRWCZO.js.map +0 -7
  82. package/dist/chunk-73JVPKCJ.js.map +0 -7
  83. package/dist/chunk-IAFDLMER.js.map +0 -7
  84. package/dist/chunk-XI4LTVYT.js.map +0 -7
  85. package/dist/commands-QLETKRIB.js +0 -53
  86. package/dist/prompts-3Z364Z2H.js +0 -55
  87. package/dist/query-Y2PFPV5V.js +0 -57
  88. package/dist/tools-KP3XZFBW.js +0 -54
  89. /package/dist/{REPL-4XDQ5LO2.js.map → REPL-HSLBK5NZ.js.map} +0 -0
  90. /package/dist/{acp-DSHGC42G.js.map → acp-OYNDAMUG.js.map} +0 -0
  91. /package/dist/{agentsValidate-XCGG77GS.js.map → agentsValidate-CSJFTPMF.js.map} +0 -0
  92. /package/dist/{ask-BTEWFWX7.js.map → ask-RUL7DBVW.js.map} +0 -0
  93. /package/dist/{autoUpdater-2JPYTHJU.js.map → autoUpdater-2US37QCD.js.map} +0 -0
  94. /package/dist/{chunk-5ZRN3ED2.js.map → chunk-277MFG2S.js.map} +0 -0
  95. /package/dist/{chunk-BABSJ55B.js.map → chunk-45KNYAUE.js.map} +0 -0
  96. /package/dist/{chunk-BZJ63VLB.js.map → chunk-57TUHQTK.js.map} +0 -0
  97. /package/dist/{chunk-XJEOCTTA.js.map → chunk-5FPVUG76.js.map} +0 -0
  98. /package/dist/{chunk-37Z4UJE7.js.map → chunk-6CFLL7MP.js.map} +0 -0
  99. /package/dist/{chunk-VYTXJQMG.js.map → chunk-6CZGZTTR.js.map} +0 -0
  100. /package/dist/{chunk-NUVWA6CG.js.map → chunk-6W4QXF5T.js.map} +0 -0
  101. /package/dist/{chunk-WFTCIKRP.js.map → chunk-736LB6QF.js.map} +0 -0
  102. /package/dist/{chunk-V3I6BY55.js.map → chunk-7HPC6NEL.js.map} +0 -0
  103. /package/dist/{chunk-ZWWEN5JT.js.map → chunk-7YOXNCGC.js.map} +0 -0
  104. /package/dist/{chunk-C63QE2JE.js.map → chunk-AQDHWNHO.js.map} +0 -0
  105. /package/dist/{chunk-GDYCFPX7.js.map → chunk-EKCV6FAR.js.map} +0 -0
  106. /package/dist/{chunk-SWUVTC7Q.js.map → chunk-ELZOI2EN.js.map} +0 -0
  107. /package/dist/{chunk-KXGXMSPS.js.map → chunk-FTXV6D26.js.map} +0 -0
  108. /package/dist/{chunk-T4LDHDO5.js.map → chunk-G2NDX3AE.js.map} +0 -0
  109. /package/dist/{chunk-MMICBXP5.js.map → chunk-HIRKT55M.js.map} +0 -0
  110. /package/dist/{chunk-AZOP5QKF.js.map → chunk-JN7LIP22.js.map} +0 -0
  111. /package/dist/{chunk-IZPWMY6H.js.map → chunk-N6RZW54E.js.map} +0 -0
  112. /package/dist/{chunk-NPLYGSR3.js.map → chunk-NFCKELD5.js.map} +0 -0
  113. /package/dist/{chunk-LYAYIYBK.js.map → chunk-NJY725BV.js.map} +0 -0
  114. /package/dist/{chunk-XI4LTVYT.js → chunk-O6DTZU7F.js} +0 -0
  115. /package/dist/{chunk-GIXD4Z4O.js.map → chunk-QCPTRT42.js.map} +0 -0
  116. /package/dist/{chunk-SXCGPQ3R.js.map → chunk-VFEFTBAX.js.map} +0 -0
  117. /package/dist/{chunk-IZLBXT6P.js.map → chunk-WS3OA4DJ.js.map} +0 -0
  118. /package/dist/{chunk-IXOS2743.js.map → chunk-X3S6OAMU.js.map} +0 -0
  119. /package/dist/{chunk-W2YU6ZJG.js.map → chunk-XFAWFKEO.js.map} +0 -0
  120. /package/dist/{chunk-RXJNQXGH.js.map → chunk-Y56ETINA.js.map} +0 -0
  121. /package/dist/{chunk-65ADQNJL.js.map → chunk-ZT2EDUJ5.js.map} +0 -0
  122. /package/dist/{commands-QLETKRIB.js.map → commands-ED3B27YA.js.map} +0 -0
  123. /package/dist/{config-BS3TSRO2.js.map → config-VMG22F4D.js.map} +0 -0
  124. /package/dist/{context-GUWJH2XE.js.map → context-RCECS2MV.js.map} +0 -0
  125. /package/dist/{conversationTracker-3OMO23AJ.js.map → conversationTracker-EDZLP7O4.js.map} +0 -0
  126. /package/dist/{customCommands-O4D67KVC.js.map → customCommands-B6RXZMP5.js.map} +0 -0
  127. /package/dist/{env-4M3GZSUS.js.map → env-YTAL5KRK.js.map} +0 -0
  128. /package/dist/{file-FIYEKO7W.js.map → file-OOCDMD3U.js.map} +0 -0
  129. /package/dist/{llm-MXURYD2K.js.map → llm-R5NWZO5G.js.map} +0 -0
  130. /package/dist/{llmLazy-X6M4BHF3.js.map → llmLazy-VWKTHJ4M.js.map} +0 -0
  131. /package/dist/{loader-DDBTFUPC.js.map → loader-WWGN7JMY.js.map} +0 -0
  132. /package/dist/{lsp-2SCBURX2.js.map → lsp-YT4SHOXN.js.map} +0 -0
  133. /package/dist/{lspAnchor-YV4BDQJX.js.map → lspAnchor-B3LGI6VC.js.map} +0 -0
  134. /package/dist/{mcp-CKGQUT3S.js.map → mcp-AIT7BP27.js.map} +0 -0
  135. /package/dist/{mentionProcessor-NDVGHEEZ.js.map → mentionProcessor-TTRH7MSS.js.map} +0 -0
  136. /package/dist/{messages-UHUC65DS.js.map → messages-V5YRA4WO.js.map} +0 -0
  137. /package/dist/{model-RS4VTMY6.js.map → model-7QLTSWZV.js.map} +0 -0
  138. /package/dist/{openai-QRE5RM6W.js.map → openai-O5UTQHNX.js.map} +0 -0
  139. /package/dist/{outputStyles-UZYGNQU7.js.map → outputStyles-CUYPATTD.js.map} +0 -0
  140. /package/dist/{pluginRuntime-4Z2SPLJI.js.map → pluginRuntime-Z3VUXLLL.js.map} +0 -0
  141. /package/dist/{pluginValidation-GHCMPEC7.js.map → pluginValidation-OIFMXGZW.js.map} +0 -0
  142. /package/dist/{prompts-3Z364Z2H.js.map → prompts-VSYX4Z3H.js.map} +0 -0
  143. /package/dist/{pybAgentSessionLoad-KTU6VBIE.js.map → pybAgentSessionLoad-YE3R7GCM.js.map} +0 -0
  144. /package/dist/{pybAgentSessionResume-MKLZH2QZ.js.map → pybAgentSessionResume-H3X4E5WZ.js.map} +0 -0
  145. /package/dist/{pybAgentStreamJsonSession-66HVTHC4.js.map → pybAgentStreamJsonSession-LBTQ5QVA.js.map} +0 -0
  146. /package/dist/{pybHooks-RL2D75BA.js.map → pybHooks-ICFUKF5J.js.map} +0 -0
  147. /package/dist/{query-Y2PFPV5V.js.map → query-3MCWSQFG.js.map} +0 -0
  148. /package/dist/{registry-HT2QIYZF.js.map → registry-U5KXMAQT.js.map} +0 -0
  149. /package/dist/{ripgrep-Q26JLKZK.js.map → ripgrep-WWOPEBCI.js.map} +0 -0
  150. /package/dist/{skillMarketplace-WX46FV3B.js.map → skillMarketplace-P7BGMBU7.js.map} +0 -0
  151. /package/dist/{state-7D3EAZYW.js.map → state-BNEI4WAC.js.map} +0 -0
  152. /package/dist/{theme-XZ67BKEX.js.map → theme-4JWO3G3X.js.map} +0 -0
  153. /package/dist/{toolPermissionSettings-WDXG4PH5.js.map → toolPermissionSettings-LQLARZGN.js.map} +0 -0
  154. /package/dist/{tools-KP3XZFBW.js.map → tools-6AAIJTHG.js.map} +0 -0
  155. /package/dist/{userInput-LHXC33VV.js.map → userInput-GMSZGZQS.js.map} +0 -0
@@ -2,11 +2,11 @@ import { createRequire as __pybCreateRequire } from "node:module";
2
2
  const require = __pybCreateRequire(import.meta.url);
3
3
  import {
4
4
  listPybAgentSessions
5
- } from "./chunk-GIXD4Z4O.js";
5
+ } from "./chunk-QCPTRT42.js";
6
6
  import {
7
7
  formatValidationResult,
8
8
  validatePluginOrMarketplacePath
9
- } from "./chunk-GDYCFPX7.js";
9
+ } from "./chunk-EKCV6FAR.js";
10
10
  import {
11
11
  ConversationTracker,
12
12
  appendFinishState,
@@ -14,18 +14,18 @@ import {
14
14
  getConversationTrackerForContext,
15
15
  isFinishComplete,
16
16
  mapFinishReason
17
- } from "./chunk-IZLBXT6P.js";
17
+ } from "./chunk-WS3OA4DJ.js";
18
18
  import {
19
19
  beginReplSessionScope
20
20
  } from "./chunk-F4AXICO7.js";
21
21
  import {
22
22
  loadPybAgentSessionMessages
23
- } from "./chunk-IZPWMY6H.js";
23
+ } from "./chunk-N6RZW54E.js";
24
24
  import {
25
25
  appendSessionCustomTitleRecord,
26
26
  appendSessionJsonlFromMessage,
27
27
  appendSessionTagRecord
28
- } from "./chunk-NPLYGSR3.js";
28
+ } from "./chunk-NFCKELD5.js";
29
29
  import {
30
30
  drainHookSystemPromptAdditions,
31
31
  getHookTranscriptPath,
@@ -37,7 +37,7 @@ import {
37
37
  runStopHooks,
38
38
  runUserPromptSubmitHooks,
39
39
  updateHookTranscriptForMessages
40
- } from "./chunk-BABSJ55B.js";
40
+ } from "./chunk-45KNYAUE.js";
41
41
  import {
42
42
  DEFAULT_OUTPUT_STYLE,
43
43
  getAvailableOutputStyles,
@@ -46,11 +46,11 @@ import {
46
46
  getOutputStyleSystemPromptAdditions,
47
47
  resolveOutputStyleName,
48
48
  setCurrentOutputStyle
49
- } from "./chunk-5ZRN3ED2.js";
49
+ } from "./chunk-277MFG2S.js";
50
50
  import {
51
51
  fetchCustomModels,
52
52
  getModelFeatures
53
- } from "./chunk-IXOS2743.js";
53
+ } from "./chunk-X3S6OAMU.js";
54
54
  import {
55
55
  getSessionState
56
56
  } from "./chunk-XKYHFZEC.js";
@@ -58,7 +58,7 @@ import {
58
58
  queryLLM,
59
59
  queryQuick,
60
60
  verifyApiKey
61
- } from "./chunk-W2YU6ZJG.js";
61
+ } from "./chunk-XFAWFKEO.js";
62
62
  import {
63
63
  DEFAULT_TIMEOUT_MS,
64
64
  FallbackToolUseRejectedMessage,
@@ -72,7 +72,7 @@ import {
72
72
  listMCPServers,
73
73
  loadMergedSettings,
74
74
  normalizeSandboxRuntimeConfigFromSettings
75
- } from "./chunk-V3I6BY55.js";
75
+ } from "./chunk-7HPC6NEL.js";
76
76
  import {
77
77
  addMarketplace,
78
78
  disableSkillPlugin,
@@ -85,11 +85,11 @@ import {
85
85
  refreshMarketplaceAsync,
86
86
  removeMarketplace,
87
87
  uninstallSkillPlugin
88
- } from "./chunk-C63QE2JE.js";
88
+ } from "./chunk-AQDHWNHO.js";
89
89
  import {
90
90
  loadToolPermissionContextFromDisk,
91
91
  persistToolPermissionUpdateToDisk
92
- } from "./chunk-37Z4UJE7.js";
92
+ } from "./chunk-6CFLL7MP.js";
93
93
  import {
94
94
  applyToolPermissionContextUpdate,
95
95
  applyToolPermissionContextUpdates,
@@ -100,13 +100,13 @@ import {
100
100
  generateSystemReminders,
101
101
  resetReminderSession,
102
102
  systemReminderService
103
- } from "./chunk-ZWWEN5JT.js";
103
+ } from "./chunk-7YOXNCGC.js";
104
104
  import {
105
105
  clearAgentCache,
106
106
  getActiveAgents,
107
107
  getAgentByType,
108
108
  getAllAgents
109
- } from "./chunk-NUVWA6CG.js";
109
+ } from "./chunk-6W4QXF5T.js";
110
110
  import {
111
111
  API_ERROR_MESSAGE_PREFIX,
112
112
  CANCEL_MESSAGE,
@@ -137,7 +137,7 @@ import {
137
137
  processUserInput,
138
138
  reorderMessages,
139
139
  stripSystemMessages
140
- } from "./chunk-XJEOCTTA.js";
140
+ } from "./chunk-5FPVUG76.js";
141
141
  import {
142
142
  getRequestStatus,
143
143
  setRequestStatus,
@@ -167,7 +167,7 @@ import {
167
167
  normalizeFilePath,
168
168
  readTextContent,
169
169
  writeTextContent
170
- } from "./chunk-SXCGPQ3R.js";
170
+ } from "./chunk-VFEFTBAX.js";
171
171
  import {
172
172
  parseBlockEdits
173
173
  } from "./chunk-QWIBSCDN.js";
@@ -177,26 +177,27 @@ import {
177
177
  ParserRegistry,
178
178
  initParser,
179
179
  loadLanguage
180
- } from "./chunk-RXJNQXGH.js";
180
+ } from "./chunk-Y56ETINA.js";
181
181
  import {
182
182
  getSettingsFileCandidates,
183
183
  loadSettingsWithLegacyFallback,
184
184
  readSettingsFile
185
- } from "./chunk-KXGXMSPS.js";
185
+ } from "./chunk-FTXV6D26.js";
186
186
  import {
187
187
  getCustomCommandDirectories,
188
188
  hasCustomCommands,
189
189
  loadCustomCommands,
190
190
  reloadCustomCommands
191
- } from "./chunk-AZOP5QKF.js";
191
+ } from "./chunk-JN7LIP22.js";
192
192
  import {
193
193
  getSessionPlugins
194
194
  } from "./chunk-BJSWTHRM.js";
195
195
  import {
196
196
  ModelManager,
197
+ buildModelProfileKey,
197
198
  getModelManager,
198
199
  isDefaultSlowAndCapableModel
199
- } from "./chunk-73JVPKCJ.js";
200
+ } from "./chunk-MSUD3TJP.js";
200
201
  import {
201
202
  getCodeStyle,
202
203
  getContext,
@@ -204,16 +205,16 @@ import {
204
205
  getIsGit,
205
206
  getProjectDocs,
206
207
  getProjectStructureStatisticsBlock
207
- } from "./chunk-VYTXJQMG.js";
208
+ } from "./chunk-6CZGZTTR.js";
208
209
  import {
209
210
  getRipgrepPath,
210
211
  getRipgrepPolicyMode,
211
212
  resolveRipgrepPolicy,
212
213
  ripGrep
213
- } from "./chunk-65ADQNJL.js";
214
+ } from "./chunk-ZT2EDUJ5.js";
214
215
  import {
215
216
  getTheme
216
- } from "./chunk-SWUVTC7Q.js";
217
+ } from "./chunk-ELZOI2EN.js";
217
218
  import {
218
219
  DEFAULT_GLOBAL_CONFIG,
219
220
  enableConfigs,
@@ -226,7 +227,7 @@ import {
226
227
  saveGlobalConfig,
227
228
  setAllPointersToModel,
228
229
  setModelPointer
229
- } from "./chunk-WFTCIKRP.js";
230
+ } from "./chunk-736LB6QF.js";
230
231
  import {
231
232
  AbortError
232
233
  } from "./chunk-RQVLBMP7.js";
@@ -235,7 +236,7 @@ import {
235
236
  getCurrentRequest,
236
237
  logUserFriendly,
237
238
  markPhase
238
- } from "./chunk-T4LDHDO5.js";
239
+ } from "./chunk-G2NDX3AE.js";
239
240
  import {
240
241
  ASCII_LOGO,
241
242
  BunShell,
@@ -253,6 +254,7 @@ import {
253
254
  exitPlanModeForConversationKey,
254
255
  formatDate,
255
256
  getCwd,
257
+ getMemoryDir,
256
258
  getMessagesPath,
257
259
  getNextAvailableLogForkNumber,
258
260
  getOriginalCwd,
@@ -275,10 +277,10 @@ import {
275
277
  setCwd,
276
278
  shouldApplyToolOutputTruncation,
277
279
  truncateToolOutput
278
- } from "./chunk-BZJ63VLB.js";
280
+ } from "./chunk-57TUHQTK.js";
279
281
  import {
280
282
  MACRO
281
- } from "./chunk-CKY2L3QE.js";
283
+ } from "./chunk-FUO4GQ7W.js";
282
284
  import {
283
285
  __export
284
286
  } from "./chunk-I3J4JYES.js";
@@ -286,7 +288,7 @@ import {
286
288
  // src/tools/system/BashTool/BashTool.tsx
287
289
  import { statSync as statSync14 } from "fs";
288
290
  import { EOL as EOL3 } from "os";
289
- import { isAbsolute as isAbsolute8, relative as relative12, resolve as resolve11 } from "path";
291
+ import { isAbsolute as isAbsolute9, relative as relative13, resolve as resolve13 } from "path";
290
292
  import * as React106 from "react";
291
293
  import { z as z15 } from "zod";
292
294
 
@@ -459,7 +461,7 @@ var getCommandSubcommandPrefix = memoize(
459
461
  var getCommandPrefix = memoize(
460
462
  async (command4, abortSignal) => {
461
463
  const { systemPrompt, userPrompt } = buildBashCommandPrefixDetectionPrompt(command4);
462
- const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-MXURYD2K.js");
464
+ const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-R5NWZO5G.js");
463
465
  const response = await queryQuick2({
464
466
  systemPrompt,
465
467
  userPrompt,
@@ -744,8 +746,8 @@ async function shouldAllowNetworkRequest(query2) {
744
746
  }
745
747
  async function serializePermissionPrompt(task) {
746
748
  let release = null;
747
- const next = new Promise((resolve12) => {
748
- release = resolve12;
749
+ const next = new Promise((resolve14) => {
750
+ release = resolve14;
749
751
  });
750
752
  const prev = active.permissionPromptChain;
751
753
  active.permissionPromptChain = prev.then(() => next);
@@ -778,18 +780,18 @@ async function cleanupSandboxNetworkInfrastructure() {
778
780
  active.sessionDeniedHosts.clear();
779
781
  active.inflightPermissionRequests.clear();
780
782
  await Promise.allSettled([
781
- httpServer ? new Promise((resolve12) => {
783
+ httpServer ? new Promise((resolve14) => {
782
784
  try {
783
- httpServer.close(() => resolve12());
785
+ httpServer.close(() => resolve14());
784
786
  } catch {
785
- resolve12();
787
+ resolve14();
786
788
  }
787
789
  }) : Promise.resolve(),
788
- socksServer ? new Promise((resolve12) => {
790
+ socksServer ? new Promise((resolve14) => {
789
791
  try {
790
- socksServer.close(() => resolve12());
792
+ socksServer.close(() => resolve14());
791
793
  } catch {
792
- resolve12();
794
+ resolve14();
793
795
  }
794
796
  }) : Promise.resolve()
795
797
  ]);
@@ -979,7 +981,7 @@ async function startHttpProxy() {
979
981
  clientSocket.on("data", onData);
980
982
  });
981
983
  active.httpProxyServer = server;
982
- return new Promise((resolve12, reject) => {
984
+ return new Promise((resolve14, reject) => {
983
985
  server.once("error", reject);
984
986
  server.once("listening", () => {
985
987
  const addr = server.address();
@@ -988,7 +990,7 @@ async function startHttpProxy() {
988
990
  return;
989
991
  }
990
992
  server.unref();
991
- resolve12(addr.port);
993
+ resolve14(addr.port);
992
994
  });
993
995
  server.listen(0, "127.0.0.1");
994
996
  });
@@ -1098,7 +1100,7 @@ async function startSocks5Proxy() {
1098
1100
  socket.on("data", onData);
1099
1101
  });
1100
1102
  active.socksProxyServer = server;
1101
- return new Promise((resolve12, reject) => {
1103
+ return new Promise((resolve14, reject) => {
1102
1104
  server.once("error", reject);
1103
1105
  server.once("listening", () => {
1104
1106
  const addr = server.address();
@@ -1107,7 +1109,7 @@ async function startSocks5Proxy() {
1107
1109
  return;
1108
1110
  }
1109
1111
  server.unref();
1110
- resolve12(addr.port);
1112
+ resolve14(addr.port);
1111
1113
  });
1112
1114
  server.listen(0, "127.0.0.1");
1113
1115
  });
@@ -1377,13 +1379,13 @@ function isPathInWorkingDirectories(inputPath, context) {
1377
1379
  toPosixPath(resolvedCandidate)
1378
1380
  );
1379
1381
  const rootPosix = normalizeMacPrivatePrefix(toPosixPath(resolvedRoot));
1380
- const relative13 = posixRelative(
1382
+ const relative14 = posixRelative(
1381
1383
  toLower(rootPosix),
1382
1384
  toLower(candidatePosix)
1383
1385
  );
1384
- if (relative13 === "") return true;
1385
- if (hasParentTraversalSegment(relative13)) return false;
1386
- if (POSIX.isAbsolute(relative13)) return false;
1386
+ if (relative14 === "") return true;
1387
+ if (hasParentTraversalSegment(relative14)) return false;
1388
+ if (POSIX.isAbsolute(relative14)) return false;
1387
1389
  return true;
1388
1390
  });
1389
1391
  });
@@ -1486,9 +1488,9 @@ function matchPermissionRuleForPath(args) {
1486
1488
  }
1487
1489
  for (const [root, patternsMap] of grouped.entries()) {
1488
1490
  const baseRoot = root ?? getCwd();
1489
- const relative13 = posixRelative(baseRoot, targetPosix);
1490
- if (relative13.startsWith(`..${POSIX_SEP}`)) continue;
1491
- if (!relative13) continue;
1491
+ const relative14 = posixRelative(baseRoot, targetPosix);
1492
+ if (relative14.startsWith(`..${POSIX_SEP}`)) continue;
1493
+ if (!relative14) continue;
1492
1494
  const matchAll = patternsMap.get("/**")?.ruleString ?? patternsMap.get("**")?.ruleString ?? null;
1493
1495
  if (matchAll) return matchAll;
1494
1496
  const patterns = Array.from(patternsMap.keys()).map((pattern) => {
@@ -1502,7 +1504,7 @@ function matchPermissionRuleForPath(args) {
1502
1504
  return candidate;
1503
1505
  });
1504
1506
  const matcher = buildIgnoreMatcher(patterns);
1505
- const result = matcher.test(relative13);
1507
+ const result = matcher.test(relative14);
1506
1508
  if (!result.ignored || !result.rule) continue;
1507
1509
  let matched = result.rule.pattern;
1508
1510
  const matchedWithGlob = `${matched}/**`;
@@ -4261,7 +4263,7 @@ function formatParseError(error) {
4261
4263
  return error instanceof Error ? error.message : String(error);
4262
4264
  }
4263
4265
  async function defaultGateQuery(args) {
4264
- const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-MXURYD2K.js");
4266
+ const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-R5NWZO5G.js");
4265
4267
  const queryLLMFn = args.queryLLMOverride ?? queryLLM2;
4266
4268
  const messages = [
4267
4269
  {
@@ -6658,7 +6660,7 @@ var FileEditTool = {
6658
6660
  const originalFileContent = currentFileContent;
6659
6661
  let totalPatch = [];
6660
6662
  const { SmartEdit } = await import("./smart-edit-AWHJDSU6.js");
6661
- const { findLspAnchor } = await import("./lspAnchor-YV4BDQJX.js");
6663
+ const { findLspAnchor } = await import("./lspAnchor-B3LGI6VC.js");
6662
6664
  for (const op of editOperations) {
6663
6665
  const normalizedSearch = normalizeLineEndings(op.search);
6664
6666
  const normalizedReplace = normalizeLineEndings(op.replace);
@@ -10246,9 +10248,9 @@ function setTerminalTitle(title) {
10246
10248
  }
10247
10249
  }
10248
10250
  function clearTerminal() {
10249
- return new Promise((resolve12) => {
10251
+ return new Promise((resolve14) => {
10250
10252
  process.stdout.write("\x1B[2J\x1B[3J\x1B[H", () => {
10251
- resolve12();
10253
+ resolve14();
10252
10254
  });
10253
10255
  });
10254
10256
  }
@@ -11768,8 +11770,8 @@ var OAuthService = class {
11768
11770
  await authURLHandler(manualUrl);
11769
11771
  await openBrowser(autoUrl);
11770
11772
  };
11771
- const { authorizationCode, useManualRedirect } = await new Promise((resolve12, reject) => {
11772
- this.pendingCodePromise = { resolve: resolve12, reject };
11773
+ const { authorizationCode, useManualRedirect } = await new Promise((resolve14, reject) => {
11774
+ this.pendingCodePromise = { resolve: resolve14, reject };
11773
11775
  this.startLocalServer(state, onReady);
11774
11776
  });
11775
11777
  const {
@@ -11940,7 +11942,7 @@ async function createAndStoreApiKey(accessToken) {
11940
11942
  }
11941
11943
  saveGlobalConfig(config2);
11942
11944
  try {
11943
- const { resetAnthropicClient } = await import("./llm-MXURYD2K.js");
11945
+ const { resetAnthropicClient } = await import("./llm-R5NWZO5G.js");
11944
11946
  resetAnthropicClient();
11945
11947
  } catch {
11946
11948
  }
@@ -12968,7 +12970,8 @@ var models_default = {
12968
12970
  burncloud: [],
12969
12971
  "minimax-coding": [],
12970
12972
  "glm-coding": [],
12971
- "qwen-coding": []
12973
+ "qwen-coding": [],
12974
+ "baidu-coding": []
12972
12975
  };
12973
12976
  var providers = {
12974
12977
  kimi: {
@@ -13035,6 +13038,10 @@ var providers = {
13035
13038
  name: "Qwen Coding Plan",
13036
13039
  baseURL: "https://coding.dashscope.aliyuncs.com/v1"
13037
13040
  },
13041
+ "baidu-coding": {
13042
+ name: "Baidu Coding Plan",
13043
+ baseURL: "https://qianfan.baidubce.com/v2/coding"
13044
+ },
13038
13045
  "baidu-qianfan": {
13039
13046
  name: "Baidu Qianfan",
13040
13047
  baseURL: "https://qianfan.baidubce.com/v2"
@@ -13802,6 +13809,47 @@ async function fetchQwenCodingModels({
13802
13809
  ];
13803
13810
  return qwenCodingModels;
13804
13811
  }
13812
+ async function fetchBaiduCodingModels({
13813
+ apiKey,
13814
+ providerBaseUrl,
13815
+ setModelLoadError
13816
+ }) {
13817
+ const baiduCodingModels = [
13818
+ {
13819
+ model: "kimi-k2.5",
13820
+ provider: "baidu-coding",
13821
+ max_tokens: 32768,
13822
+ supports_vision: true,
13823
+ supports_function_calling: true,
13824
+ supports_reasoning_effort: false
13825
+ },
13826
+ {
13827
+ model: "glm-5",
13828
+ provider: "baidu-coding",
13829
+ max_tokens: 32768,
13830
+ supports_vision: false,
13831
+ supports_function_calling: true,
13832
+ supports_reasoning_effort: false
13833
+ },
13834
+ {
13835
+ model: "MiniMax-M2.5",
13836
+ provider: "baidu-coding",
13837
+ max_tokens: 32768,
13838
+ supports_vision: false,
13839
+ supports_function_calling: true,
13840
+ supports_reasoning_effort: false
13841
+ },
13842
+ {
13843
+ model: "deepseek-v3.2",
13844
+ provider: "baidu-coding",
13845
+ max_tokens: 32768,
13846
+ supports_vision: false,
13847
+ supports_function_calling: true,
13848
+ supports_reasoning_effort: false
13849
+ }
13850
+ ];
13851
+ return baiduCodingModels;
13852
+ }
13805
13853
  async function fetchBaiduQianfanModels({
13806
13854
  apiKey,
13807
13855
  providerBaseUrl,
@@ -14380,7 +14428,7 @@ function ModelSelector({
14380
14428
  setModelLoadError(
14381
14429
  `Attempt ${attempt}/${MAX_RETRIES}: Retrying model discovery...`
14382
14430
  );
14383
- await new Promise((resolve12) => setTimeout(resolve12, 1e3));
14431
+ await new Promise((resolve14) => setTimeout(resolve14, 1e3));
14384
14432
  }
14385
14433
  try {
14386
14434
  const models = await fetchModels();
@@ -14514,6 +14562,16 @@ Please check your API key and try again, or press Tab to manually enter model na
14514
14562
  navigateTo("model");
14515
14563
  return qwenCodingModels;
14516
14564
  }
14565
+ if (selectedProvider === "baidu-coding") {
14566
+ const baiduCodingModels = await fetchBaiduCodingModels({
14567
+ apiKey,
14568
+ providerBaseUrl,
14569
+ setModelLoadError
14570
+ });
14571
+ setAvailableModels(baiduCodingModels);
14572
+ navigateTo("model");
14573
+ return baiduCodingModels;
14574
+ }
14517
14575
  if (selectedProvider === "baidu-qianfan") {
14518
14576
  const baiduModels = await fetchBaiduQianfanModels({
14519
14577
  apiKey,
@@ -15081,11 +15139,12 @@ Please check your API key and try again, or press Tab to manually enter model na
15081
15139
  if (!modelId) {
15082
15140
  return;
15083
15141
  }
15084
- setModelPointer("main", modelId);
15142
+ const profileKey = buildModelProfileKey(selectedProvider, modelId);
15143
+ setModelPointer("main", profileKey);
15085
15144
  if (isOnboarding) {
15086
- setAllPointersToModel(modelId);
15145
+ setAllPointersToModel(profileKey);
15087
15146
  } else if (targetPointer && targetPointer !== "main") {
15088
- setModelPointer(targetPointer, modelId);
15147
+ setModelPointer(targetPointer, profileKey);
15089
15148
  }
15090
15149
  onDone();
15091
15150
  }
@@ -16307,7 +16366,7 @@ async function refreshPluginRuntimeFromInstalls() {
16307
16366
  const existingRoots = getSessionPlugins().map((p) => p.rootDir);
16308
16367
  const dirs = Array.from(/* @__PURE__ */ new Set([...existingRoots, ...installedRoots]));
16309
16368
  if (dirs.length === 0) return [];
16310
- const { configureSessionPlugins } = await import("./pluginRuntime-4Z2SPLJI.js");
16369
+ const { configureSessionPlugins } = await import("./pluginRuntime-Z3VUXLLL.js");
16311
16370
  const { errors } = await configureSessionPlugins({ pluginDirs: dirs });
16312
16371
  return errors;
16313
16372
  }
@@ -16643,10 +16702,10 @@ function ModelListManager({ onClose }) {
16643
16702
  const availableModels = modelManager.getAvailableModels();
16644
16703
  const menuItems = React40.useMemo(() => {
16645
16704
  const modelItems = availableModels.map((model) => ({
16646
- id: model.modelName,
16705
+ id: buildModelProfileKey(model.provider, model.modelName),
16647
16706
  name: model.name,
16648
16707
  provider: model.provider,
16649
- usedBy: getModelUsage(model.modelName),
16708
+ usedBy: getModelUsage(model.provider, model.modelName),
16650
16709
  type: "model"
16651
16710
  }));
16652
16711
  return [
@@ -16660,18 +16719,19 @@ function ModelListManager({ onClose }) {
16660
16719
  ...modelItems
16661
16720
  ];
16662
16721
  }, [availableModels, config2.modelPointers, refreshKey]);
16663
- function getModelUsage(modelName) {
16722
+ function getModelUsage(provider, modelName) {
16664
16723
  const usage = [];
16665
16724
  const pointers = ["main", "task", "compact", "quick"];
16725
+ const profileKey = buildModelProfileKey(provider, modelName);
16666
16726
  pointers.forEach((pointer) => {
16667
- if (config2.modelPointers?.[pointer] === modelName) {
16727
+ if (config2.modelPointers?.[pointer] === profileKey || config2.modelPointers?.[pointer] === modelName) {
16668
16728
  usage.push(pointer);
16669
16729
  }
16670
16730
  });
16671
16731
  return usage;
16672
16732
  }
16673
- const handleDeleteModel = (modelName) => {
16674
- modelManager.removeModel(modelName);
16733
+ const handleDeleteModel = (modelRef) => {
16734
+ modelManager.removeModel(modelRef);
16675
16735
  setRefreshKey((prev) => prev + 1);
16676
16736
  setIsDeleteMode(false);
16677
16737
  };
@@ -16703,7 +16763,9 @@ function ModelListManager({ onClose }) {
16703
16763
  setIsDeleteMode(false);
16704
16764
  return;
16705
16765
  }
16706
- if (config2.modelPointers?.main === item.id) {
16766
+ const mainPointer = config2.modelPointers?.main;
16767
+ const deletingMain = mainPointer === item.id || mainPointer && item.id.includes(":") && mainPointer === item.id.split(":").slice(1).join(":");
16768
+ if (deletingMain) {
16707
16769
  setIsDeleteMode(false);
16708
16770
  return;
16709
16771
  }
@@ -16783,7 +16845,10 @@ function ModelConfig({ onClose }) {
16783
16845
  }, [selectedIndex]);
16784
16846
  const availableModels = React41.useMemo(() => {
16785
16847
  const profiles = modelManager.getAvailableModels();
16786
- return profiles.map((p) => ({ id: p.modelName, name: p.name }));
16848
+ return profiles.map((p) => ({
16849
+ id: buildModelProfileKey(p.provider, p.modelName),
16850
+ name: p.name
16851
+ }));
16787
16852
  }, [modelManager, refreshKey]);
16788
16853
  const menuItems = React41.useMemo(() => {
16789
16854
  const modelSettings = [
@@ -16880,7 +16945,7 @@ function ModelConfig({ onClose }) {
16880
16945
  return;
16881
16946
  }
16882
16947
  const currentIndex = setting.options.findIndex(
16883
- (opt) => opt.id === setting.value
16948
+ (opt) => opt.id === setting.value || opt.id.endsWith(`:${setting.value}`)
16884
16949
  );
16885
16950
  const nextIndex = (currentIndex + 1) % setting.options.length;
16886
16951
  const nextOption = setting.options[nextIndex];
@@ -16976,7 +17041,7 @@ async function call(onDone, context) {
16976
17041
  ModelConfig,
16977
17042
  {
16978
17043
  onClose: () => {
16979
- import("./model-RS4VTMY6.js").then(({ reloadModelManager: reloadModelManager2 }) => {
17044
+ import("./model-7QLTSWZV.js").then(({ reloadModelManager: reloadModelManager2 }) => {
16980
17045
  reloadModelManager2();
16981
17046
  triggerModelConfigChange();
16982
17047
  onDone();
@@ -24892,7 +24957,7 @@ async function launchExternalEditor(initialText) {
24892
24957
  }
24893
24958
  }
24894
24959
  try {
24895
- await new Promise((resolve12, reject) => {
24960
+ await new Promise((resolve14, reject) => {
24896
24961
  const child = spawn(
24897
24962
  editorCommand.command,
24898
24963
  [...editorCommand.args, filePath],
@@ -24904,7 +24969,7 @@ async function launchExternalEditor(initialText) {
24904
24969
  child.on("error", reject);
24905
24970
  child.on("exit", (code, signal) => {
24906
24971
  if (code === 0 || code === null) {
24907
- resolve12();
24972
+ resolve14();
24908
24973
  } else {
24909
24974
  reject(
24910
24975
  new Error(
@@ -25180,7 +25245,7 @@ function useStatusLine() {
25180
25245
  // src/ui/components/PromptInput.tsx
25181
25246
  async function interpretHashCommand(input) {
25182
25247
  try {
25183
- const { queryQuick: queryQuick2 } = await import("./llm-MXURYD2K.js");
25248
+ const { queryQuick: queryQuick2 } = await import("./llm-R5NWZO5G.js");
25184
25249
  const systemPrompt = [
25185
25250
  "You're helping the user structure notes that will be added to their PYB.md file.",
25186
25251
  "Format the user's input into a well-structured note that will be useful for later reference.",
@@ -25385,7 +25450,7 @@ function PromptInput({
25385
25450
  abortController.abort();
25386
25451
  }
25387
25452
  setIsLoading(false);
25388
- await new Promise((resolve12) => setTimeout(resolve12, 0));
25453
+ await new Promise((resolve14) => setTimeout(resolve14, 0));
25389
25454
  setIsLoading(true);
25390
25455
  let finalInput2 = cleanInput;
25391
25456
  for (const { placeholder: placeholder2, text } of pastedTexts) {
@@ -25493,7 +25558,7 @@ function PromptInput({
25493
25558
  if (messages2.length) {
25494
25559
  if (mode === "bash") {
25495
25560
  onQuery(messages2, newAbortController).then(async () => {
25496
- const { getCwd: getCwd2 } = await import("./state-7D3EAZYW.js");
25561
+ const { getCwd: getCwd2 } = await import("./state-BNEI4WAC.js");
25497
25562
  setCurrentPwd(getCwd2());
25498
25563
  });
25499
25564
  } else {
@@ -25853,11 +25918,11 @@ import { useCallback as useCallback14 } from "react";
25853
25918
  function useCanUseTool(setToolUseConfirm) {
25854
25919
  return useCallback14(
25855
25920
  async (tool, input, toolUseContext, assistantMessage) => {
25856
- return new Promise((resolve12) => {
25921
+ return new Promise((resolve14) => {
25857
25922
  function logCancelledEvent() {
25858
25923
  }
25859
25924
  function resolveWithCancelledAndAbortAllToolCalls(message) {
25860
- resolve12({
25925
+ resolve14({
25861
25926
  result: false,
25862
25927
  message: message ? `${REJECT_MESSAGE_WITH_FEEDBACK_PREFIX}${message}` : REJECT_MESSAGE
25863
25928
  });
@@ -25875,12 +25940,12 @@ function useCanUseTool(setToolUseConfirm) {
25875
25940
  assistantMessage
25876
25941
  ).then(async (result) => {
25877
25942
  if (result.result === true) {
25878
- resolve12({ result: true });
25943
+ resolve14({ result: true });
25879
25944
  return;
25880
25945
  }
25881
25946
  const deniedResult = result;
25882
25947
  if (deniedResult.shouldPromptUser === false) {
25883
- resolve12({ result: false, message: deniedResult.message });
25948
+ resolve14({ result: false, message: deniedResult.message });
25884
25949
  return;
25885
25950
  }
25886
25951
  const [description3, commandPrefix] = await Promise.all([
@@ -25912,7 +25977,7 @@ function useCanUseTool(setToolUseConfirm) {
25912
25977
  if (type3 === "permanent") {
25913
25978
  } else {
25914
25979
  }
25915
- resolve12({ result: true });
25980
+ resolve14({ result: true });
25916
25981
  },
25917
25982
  onReject(rejectionMessage) {
25918
25983
  resolveWithCancelledAndAbortAllToolCalls(rejectionMessage);
@@ -26041,6 +26106,174 @@ function getBinaryFeedbackResultForChoice(m1, m2, choice) {
26041
26106
  async function logBinaryFeedbackEvent(_m1, _m2, _choice) {
26042
26107
  }
26043
26108
 
26109
+ // src/services/memory/flags.ts
26110
+ function toBool(value) {
26111
+ if (value == null) return void 0;
26112
+ const normalized = String(value).trim().toLowerCase();
26113
+ if (["1", "true", "yes", "on"].includes(normalized)) return true;
26114
+ if (["0", "false", "no", "off"].includes(normalized)) return false;
26115
+ return void 0;
26116
+ }
26117
+ function resolveAutoMemoryFlags(env2 = process.env) {
26118
+ const forceDisable = toBool(env2.PYB_DISABLE_AUTO_MEMORY) === true;
26119
+ if (forceDisable) {
26120
+ return { enabled: false };
26121
+ }
26122
+ const explicit = toBool(env2.PYB_AUTO_MEMORY_ENABLED);
26123
+ if (explicit != null) {
26124
+ return { enabled: explicit };
26125
+ }
26126
+ return { enabled: true };
26127
+ }
26128
+
26129
+ // src/services/memory/inject.ts
26130
+ import { existsSync as existsSync15, readFileSync as readFileSync12 } from "fs";
26131
+ import { join as join13 } from "path";
26132
+
26133
+ // src/services/memory/paths.ts
26134
+ import { isAbsolute as isAbsolute8, relative as relative12, resolve as resolve9 } from "path";
26135
+ function sanitizeSegment(value) {
26136
+ return String(value || "").trim().replace(/[\\/]/g, "-");
26137
+ }
26138
+ function getProjectMemoryDir(baseMemoryDir, projectId) {
26139
+ const safeProjectId = sanitizeSegment(projectId);
26140
+ return resolve9(baseMemoryDir, "projects", safeProjectId, "memory");
26141
+ }
26142
+ function getAgentMemoryDir(projectMemoryDir, options) {
26143
+ const normalizedAgentId = sanitizeSegment(options?.agentId || "main") || "main";
26144
+ const normalizedAgentType = sanitizeSegment(options?.agentType || "");
26145
+ if (normalizedAgentId === "main" || normalizedAgentId === "default") {
26146
+ return resolve9(projectMemoryDir);
26147
+ }
26148
+ if (normalizedAgentType) {
26149
+ return resolve9(projectMemoryDir, "agents", normalizedAgentType);
26150
+ }
26151
+ return resolve9(projectMemoryDir, "agents", normalizedAgentId);
26152
+ }
26153
+ function resolveMemoryPath(baseDir, filePath) {
26154
+ if (!filePath || filePath.includes("\0") || isAbsolute8(filePath)) {
26155
+ return { ok: false };
26156
+ }
26157
+ const fullPath = resolve9(baseDir, filePath);
26158
+ const rel = relative12(baseDir, fullPath);
26159
+ if (!rel || rel.startsWith("..") || isAbsolute8(rel)) {
26160
+ return { ok: false };
26161
+ }
26162
+ return { ok: true, fullPath };
26163
+ }
26164
+
26165
+ // src/services/memory/projectId.ts
26166
+ import { execFile, execFileSync } from "child_process";
26167
+ import { createHash as createHash2 } from "crypto";
26168
+ import { memoize as memoize3 } from "lodash-es";
26169
+ import { resolve as resolve10 } from "path";
26170
+ function normalizePathForProjectId(inputPath) {
26171
+ let normalized = resolve10(inputPath).replace(/\\/g, "/").replace(/\/+/g, "/");
26172
+ if (normalized.length > 1) {
26173
+ normalized = normalized.replace(/\/+$/, "");
26174
+ }
26175
+ if (process.platform === "win32") {
26176
+ normalized = normalized.toLowerCase();
26177
+ }
26178
+ return normalized;
26179
+ }
26180
+ async function getGitTopLevel(cwd) {
26181
+ return new Promise((resolvePromise) => {
26182
+ execFile(
26183
+ "git",
26184
+ ["rev-parse", "--show-toplevel"],
26185
+ { cwd, windowsHide: true, timeout: 3e3 },
26186
+ (error, stdout) => {
26187
+ if (error) {
26188
+ resolvePromise(null);
26189
+ return;
26190
+ }
26191
+ const value = String(stdout || "").trim();
26192
+ resolvePromise(value || null);
26193
+ }
26194
+ );
26195
+ });
26196
+ }
26197
+ function getGitTopLevelSync(cwd) {
26198
+ try {
26199
+ const stdout = execFileSync("git", ["rev-parse", "--show-toplevel"], {
26200
+ cwd,
26201
+ windowsHide: true,
26202
+ timeout: 3e3,
26203
+ encoding: "utf8",
26204
+ stdio: ["ignore", "pipe", "ignore"]
26205
+ });
26206
+ const value = String(stdout || "").trim();
26207
+ return value || null;
26208
+ } catch {
26209
+ return null;
26210
+ }
26211
+ }
26212
+ async function resolveProjectRootWithRunner(cwd, gitTopLevelRunner) {
26213
+ const resolvedCwd = resolve10(cwd);
26214
+ const gitRoot = await gitTopLevelRunner(resolvedCwd);
26215
+ return gitRoot ? resolve10(gitRoot) : resolvedCwd;
26216
+ }
26217
+ var resolveProjectRootCached = memoize3(async (cwd) => {
26218
+ return resolveProjectRootWithRunner(cwd, getGitTopLevel);
26219
+ });
26220
+ async function resolveProjectRoot(cwd) {
26221
+ return resolveProjectRootCached(resolve10(cwd));
26222
+ }
26223
+ function resolveProjectRootSync(cwd) {
26224
+ const resolvedCwd = resolve10(cwd);
26225
+ const gitRoot = getGitTopLevelSync(resolvedCwd);
26226
+ return gitRoot ? resolve10(gitRoot) : resolvedCwd;
26227
+ }
26228
+ function computeProjectId(projectRoot) {
26229
+ const normalizedPath = normalizePathForProjectId(projectRoot);
26230
+ return createHash2("sha256").update(normalizedPath).digest("hex").slice(0, 16);
26231
+ }
26232
+ async function resolveProjectId(cwd) {
26233
+ const projectRoot = await resolveProjectRoot(cwd);
26234
+ return computeProjectId(projectRoot);
26235
+ }
26236
+ function resolveProjectIdSync(cwd) {
26237
+ const projectRoot = resolveProjectRootSync(cwd);
26238
+ return computeProjectId(projectRoot);
26239
+ }
26240
+
26241
+ // src/services/memory/inject.ts
26242
+ function getMemoryFilePath(input) {
26243
+ const cwd = input.cwd || getCwd();
26244
+ const projectId = resolveProjectIdSync(cwd);
26245
+ const projectMemoryDir = getProjectMemoryDir(getMemoryDir(), projectId);
26246
+ const agentId = input.agentId || "main";
26247
+ const agentMemoryDir = getAgentMemoryDir(projectMemoryDir, {
26248
+ agentId,
26249
+ agentType: input.agentType
26250
+ });
26251
+ return join13(agentMemoryDir, "MEMORY.md");
26252
+ }
26253
+ function truncateByLines(content, maxLines) {
26254
+ return content.split("\n").slice(0, maxLines).join("\n");
26255
+ }
26256
+ function buildAgentMemoryPromptSection(input) {
26257
+ const filePath = getMemoryFilePath(input);
26258
+ if (!existsSync15(filePath)) {
26259
+ return [];
26260
+ }
26261
+ try {
26262
+ const raw = readFileSync12(filePath, "utf8");
26263
+ const content = truncateByLines(raw, input.maxLines ?? 200);
26264
+ return [
26265
+ "\n---\n# Agent Memory\n",
26266
+ `Source: ${filePath}`,
26267
+ "'''",
26268
+ content,
26269
+ "'''",
26270
+ "\n---\n"
26271
+ ];
26272
+ } catch {
26273
+ return [];
26274
+ }
26275
+ }
26276
+
26044
26277
  // src/services/context/pybContext.ts
26045
26278
  var PybContextManager = class _PybContextManager {
26046
26279
  static instance;
@@ -26243,6 +26476,20 @@ As you answer the user's questions, you can use the following context:
26243
26476
  )
26244
26477
  );
26245
26478
  }
26479
+ const hasExistingMemorySection = enhancedPrompt.some(
26480
+ (item) => String(item || "").includes("# Agent Memory")
26481
+ );
26482
+ const autoMemoryEnabled = resolveAutoMemoryFlags().enabled;
26483
+ if (!hasExistingMemorySection && autoMemoryEnabled) {
26484
+ const memoryPromptSection = buildAgentMemoryPromptSection({
26485
+ agentId,
26486
+ agentType: options?.agentType,
26487
+ maxLines: 200
26488
+ });
26489
+ if (memoryPromptSection.length > 0) {
26490
+ enhancedPrompt.push(...memoryPromptSection);
26491
+ }
26492
+ }
26246
26493
  const trackingConfig = getConversationTrackingConfig();
26247
26494
  if (trackingConfig.enabled && trackingConfig.injectSummary && (!agentId || agentId === "main") && options?.conversationTracker) {
26248
26495
  const summary = options.conversationTracker.generateConversationSummary({
@@ -26260,7 +26507,7 @@ As you answer the user's questions, you can use the following context:
26260
26507
  }
26261
26508
 
26262
26509
  // src/services/system/taskWatcher.ts
26263
- import { existsSync as existsSync15, mkdirSync as mkdirSync6, statSync as statSync13, watch } from "fs";
26510
+ import { existsSync as existsSync16, mkdirSync as mkdirSync6, statSync as statSync13, watch } from "fs";
26264
26511
 
26265
26512
  // src/utils/session/taskGraph.ts
26266
26513
  function buildTaskGraph(tasks) {
@@ -26360,7 +26607,7 @@ function ensureDirs(paths) {
26360
26607
  }
26361
26608
  function getLatestMtime(dir) {
26362
26609
  try {
26363
- if (!existsSync15(dir)) return 0;
26610
+ if (!existsSync16(dir)) return 0;
26364
26611
  const entries = statSync13(dir);
26365
26612
  if (!entries.isDirectory()) return 0;
26366
26613
  return entries.mtimeMs;
@@ -26840,8 +27087,8 @@ function getModelCapabilities(modelName) {
26840
27087
  }
26841
27088
 
26842
27089
  // src/services/ai/policyDispatch/policyConfigLoader.ts
26843
- import { existsSync as existsSync16, readFileSync as readFileSync12 } from "fs";
26844
- import { join as join13, resolve as resolve9 } from "path";
27090
+ import { existsSync as existsSync17, readFileSync as readFileSync13 } from "fs";
27091
+ import { join as join14, resolve as resolve11 } from "path";
26845
27092
 
26846
27093
  // src/services/ai/policyDispatch/policyConfigSchema.ts
26847
27094
  import { z as z11 } from "zod";
@@ -26883,13 +27130,13 @@ function getModelFamily(model) {
26883
27130
  return segments.length >= 2 ? `${segments[0]}-${segments[1]}` : normalized;
26884
27131
  }
26885
27132
  function getDefaultPolicyConfigPath() {
26886
- return resolve9(join13(process.cwd(), "config/auto-compact-policy.config.json"));
27133
+ return resolve11(join14(process.cwd(), "config/auto-compact-policy.config.json"));
26887
27134
  }
26888
27135
  function loadAutoCompactPolicyConfig(options) {
26889
- const filePath = resolve9(options?.filePath ?? getDefaultPolicyConfigPath());
26890
- if (!existsSync16(filePath)) return null;
27136
+ const filePath = resolve11(options?.filePath ?? getDefaultPolicyConfigPath());
27137
+ if (!existsSync17(filePath)) return null;
26891
27138
  try {
26892
- const raw = readFileSync12(filePath, "utf8");
27139
+ const raw = readFileSync13(filePath, "utf8");
26893
27140
  const parsed = JSON.parse(raw);
26894
27141
  return policyConfigSchema.parse(parsed);
26895
27142
  } catch {
@@ -27122,7 +27369,7 @@ function flushTypedParts(state) {
27122
27369
  }
27123
27370
 
27124
27371
  // src/services/ai/streamTyped/partStore.ts
27125
- import { appendFileSync, existsSync as existsSync17, mkdirSync as mkdirSync7, readFileSync as readFileSync13 } from "fs";
27372
+ import { appendFileSync, existsSync as existsSync18, mkdirSync as mkdirSync7, readFileSync as readFileSync14 } from "fs";
27126
27373
  import { dirname as dirname9 } from "path";
27127
27374
  function getStreamTypedOutputFilePath() {
27128
27375
  return resolveXdgCachePath("telemetry/stream-typed-parts.jsonl");
@@ -27131,8 +27378,8 @@ function validateTypedPartRecord(record) {
27131
27378
  return streamTypedPartSchema.safeParse(record).success;
27132
27379
  }
27133
27380
  function readAllValidParts(outputFilePath) {
27134
- if (!existsSync17(outputFilePath)) return [];
27135
- const raw = readFileSync13(outputFilePath, "utf8");
27381
+ if (!existsSync18(outputFilePath)) return [];
27382
+ const raw = readFileSync14(outputFilePath, "utf8");
27136
27383
  const lines = raw.split("\n").map((line) => line.trim()).filter(Boolean);
27137
27384
  const parts = [];
27138
27385
  for (const line of lines) {
@@ -27151,7 +27398,7 @@ function appendTypedParts(options) {
27151
27398
  return { appended: 0 };
27152
27399
  }
27153
27400
  const outputFilePath = options.outputFilePath ?? getStreamTypedOutputFilePath();
27154
- if (!existsSync17(dirname9(outputFilePath))) {
27401
+ if (!existsSync18(dirname9(outputFilePath))) {
27155
27402
  mkdirSync7(dirname9(outputFilePath), { recursive: true });
27156
27403
  }
27157
27404
  const existingIds = new Set(readAllValidParts(outputFilePath).map((item) => item.id));
@@ -27338,7 +27585,7 @@ var CONVERSATION_SUMMARY_LIMITS = {
27338
27585
  var MAX_COMPACTED_QUERY_IDS = 10;
27339
27586
  var AUTO_COMPACT_CHAIN_RETRY_DELAY_MS = 250;
27340
27587
  function wait(ms) {
27341
- return new Promise((resolve12) => setTimeout(resolve12, ms));
27588
+ return new Promise((resolve14) => setTimeout(resolve14, ms));
27342
27589
  }
27343
27590
  function getMessageText(message) {
27344
27591
  if (!message || typeof message !== "object") return null;
@@ -27810,7 +28057,7 @@ ${contentWithLines}
27810
28057
  }
27811
28058
 
27812
28059
  // src/services/telemetry/autoCompactTelemetryPersistence.ts
27813
- import { appendFileSync as appendFileSync2, existsSync as existsSync18, mkdirSync as mkdirSync8 } from "fs";
28060
+ import { appendFileSync as appendFileSync2, existsSync as existsSync19, mkdirSync as mkdirSync8 } from "fs";
27814
28061
  import { dirname as dirname10 } from "path";
27815
28062
  function getAutoCompactTelemetryOutputFilePath() {
27816
28063
  return resolveXdgCachePath("telemetry/auto-compact-metrics.jsonl");
@@ -27826,7 +28073,7 @@ function flushAutoCompactTelemetrySnapshot(options = {}) {
27826
28073
  eventCount: snapshot.eventCount,
27827
28074
  metrics: snapshot.metrics
27828
28075
  };
27829
- if (!existsSync18(dirname10(outputFilePath))) {
28076
+ if (!existsSync19(dirname10(outputFilePath))) {
27830
28077
  mkdirSync8(dirname10(outputFilePath), { recursive: true });
27831
28078
  }
27832
28079
  appendFileSync2(outputFilePath, JSON.stringify(record) + "\n");
@@ -28062,8 +28309,8 @@ var ToolUseQueue = class {
28062
28309
  }
28063
28310
  if (this.hasExecutingTools() && !this.hasCompletedResults() && !this.hasPendingProgress()) {
28064
28311
  const promises = this.tools.filter((t) => t.status === "executing" && t.promise).map((t) => t.promise);
28065
- const progressPromise = new Promise((resolve12) => {
28066
- this.progressAvailableResolve = resolve12;
28312
+ const progressPromise = new Promise((resolve14) => {
28313
+ this.progressAvailableResolve = resolve14;
28067
28314
  });
28068
28315
  if (promises.length > 0) {
28069
28316
  await Promise.race([...promises, progressPromise]);
@@ -28231,7 +28478,7 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
28231
28478
  context,
28232
28479
  toolUseContext.agentId,
28233
28480
  false,
28234
- { conversationTracker: tracker }
28481
+ { conversationTracker: tracker, agentType: toolUseContext.agentType }
28235
28482
  );
28236
28483
  const planModeAdditions = getPlanModeSystemPromptAdditions(
28237
28484
  messages,
@@ -29053,7 +29300,7 @@ function BinaryFeedbackView({
29053
29300
  function BinaryFeedback({
29054
29301
  m1,
29055
29302
  m2,
29056
- resolve: resolve12,
29303
+ resolve: resolve14,
29057
29304
  debug: debug2,
29058
29305
  erroredToolUseIDs,
29059
29306
  inProgressToolUseIDs,
@@ -29065,9 +29312,9 @@ function BinaryFeedback({
29065
29312
  const onChoose = useCallback15(
29066
29313
  (choice) => {
29067
29314
  logBinaryFeedbackEvent(m1, m2, choice);
29068
- resolve12(getBinaryFeedbackResultForChoice(m1, m2, choice));
29315
+ resolve14(getBinaryFeedbackResultForChoice(m1, m2, choice));
29069
29316
  },
29070
- [m1, m2, resolve12]
29317
+ [m1, m2, resolve14]
29071
29318
  );
29072
29319
  useNotifyAfterTimeout(
29073
29320
  `${PRODUCT_NAME} needs your input on a response comparison`
@@ -29881,7 +30128,7 @@ import React101, { useCallback as useCallback17, useEffect as useEffect26, useMe
29881
30128
  import { Box as Box74, Text as Text78, useInput as useInput28 } from "ink";
29882
30129
  import figures9 from "figures";
29883
30130
  import chalk15 from "chalk";
29884
- import { join as join15 } from "path";
30131
+ import { join as join16 } from "path";
29885
30132
  import { spawn as spawn2 } from "child_process";
29886
30133
 
29887
30134
  // src/commands/agents/tooling.ts
@@ -29936,19 +30183,19 @@ async function getAvailableTools() {
29936
30183
 
29937
30184
  // src/commands/agents/storage.ts
29938
30185
  import {
29939
- existsSync as existsSync19,
30186
+ existsSync as existsSync20,
29940
30187
  mkdirSync as mkdirSync9,
29941
30188
  renameSync as renameSync3,
29942
30189
  unlinkSync as unlinkSync2,
29943
30190
  writeFileSync as writeFileSync6
29944
30191
  } from "fs";
29945
- import { join as join14 } from "path";
30192
+ import { join as join15 } from "path";
29946
30193
  import { homedir as homedir8 } from "os";
29947
30194
 
29948
30195
  // src/commands/agents/generation.ts
29949
30196
  import { randomUUID as randomUUID6 } from "crypto";
29950
30197
  async function generateAgentWithClaude(prompt) {
29951
- const { queryModel } = await import("./llm-MXURYD2K.js");
30198
+ const { queryModel } = await import("./llm-R5NWZO5G.js");
29952
30199
  const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
29953
30200
 
29954
30201
  Return your response as a JSON object with exactly these fields:
@@ -30132,25 +30379,25 @@ var LEGACY_FOLDER = ".claude";
30132
30379
  var AGENTS_DIR = "agents";
30133
30380
  function getAgentDirectory(location) {
30134
30381
  if (location === "user") {
30135
- return join14(homedir8(), PRIMARY_FOLDER, AGENTS_DIR);
30382
+ return join15(homedir8(), PRIMARY_FOLDER, AGENTS_DIR);
30136
30383
  }
30137
- return join14(getCwd(), PRIMARY_FOLDER, AGENTS_DIR);
30384
+ return join15(getCwd(), PRIMARY_FOLDER, AGENTS_DIR);
30138
30385
  }
30139
30386
  function getLegacyAgentDirectory(location) {
30140
30387
  if (location === "user") {
30141
- return join14(homedir8(), LEGACY_FOLDER, AGENTS_DIR);
30388
+ return join15(homedir8(), LEGACY_FOLDER, AGENTS_DIR);
30142
30389
  }
30143
- return join14(getCwd(), LEGACY_FOLDER, AGENTS_DIR);
30390
+ return join15(getCwd(), LEGACY_FOLDER, AGENTS_DIR);
30144
30391
  }
30145
30392
  function getPrimaryAgentFilePath(location, agentType) {
30146
- return join14(getAgentDirectory(location), `${agentType}.md`);
30393
+ return join15(getAgentDirectory(location), `${agentType}.md`);
30147
30394
  }
30148
30395
  function getLegacyAgentFilePath(location, agentType) {
30149
- return join14(getLegacyAgentDirectory(location), `${agentType}.md`);
30396
+ return join15(getLegacyAgentDirectory(location), `${agentType}.md`);
30150
30397
  }
30151
30398
  function ensureDirectoryExists(location) {
30152
30399
  const dir = getAgentDirectory(location);
30153
- if (!existsSync19(dir)) {
30400
+ if (!existsSync20(dir)) {
30154
30401
  mkdirSync9(dir, { recursive: true });
30155
30402
  }
30156
30403
  return dir;
@@ -30159,7 +30406,7 @@ async function saveAgent(location, agentType, description3, tools, systemPrompt,
30159
30406
  ensureDirectoryExists(location);
30160
30407
  const filePath = getPrimaryAgentFilePath(location, agentType);
30161
30408
  const legacyPath = getLegacyAgentFilePath(location, agentType);
30162
- if (throwIfExists && (existsSync19(filePath) || existsSync19(legacyPath))) {
30409
+ if (throwIfExists && (existsSync20(filePath) || existsSync20(legacyPath))) {
30163
30410
  throw new Error(`Agent file already exists: ${filePath}`);
30164
30411
  }
30165
30412
  const tempFile = `${filePath}.tmp.${Date.now()}.${Math.random().toString(36).substr(2, 9)}`;
@@ -30174,7 +30421,7 @@ async function saveAgent(location, agentType, description3, tools, systemPrompt,
30174
30421
  );
30175
30422
  try {
30176
30423
  writeFileSync6(tempFile, content, { encoding: "utf-8", flag: "wx" });
30177
- if (throwIfExists && (existsSync19(filePath) || existsSync19(legacyPath))) {
30424
+ if (throwIfExists && (existsSync20(filePath) || existsSync20(legacyPath))) {
30178
30425
  try {
30179
30426
  unlinkSync2(tempFile);
30180
30427
  } catch {
@@ -30184,7 +30431,7 @@ async function saveAgent(location, agentType, description3, tools, systemPrompt,
30184
30431
  renameSync3(tempFile, filePath);
30185
30432
  } catch (error) {
30186
30433
  try {
30187
- if (existsSync19(tempFile)) {
30434
+ if (existsSync20(tempFile)) {
30188
30435
  unlinkSync2(tempFile);
30189
30436
  }
30190
30437
  } catch (cleanupError) {
@@ -30212,7 +30459,7 @@ async function updateAgent(agent, description3, tools, systemPrompt, color, mode
30212
30459
  const location = agent.location;
30213
30460
  const primaryPath = getPrimaryAgentFilePath(location, agent.agentType);
30214
30461
  const legacyPath = getLegacyAgentFilePath(location, agent.agentType);
30215
- const filePath = existsSync19(primaryPath) ? primaryPath : existsSync19(legacyPath) ? legacyPath : primaryPath;
30462
+ const filePath = existsSync20(primaryPath) ? primaryPath : existsSync20(legacyPath) ? legacyPath : primaryPath;
30216
30463
  ensureDirectoryExists(location);
30217
30464
  writeFileSync6(filePath, content, { encoding: "utf-8", flag: "w" });
30218
30465
  }
@@ -30223,10 +30470,10 @@ async function deleteAgent(agent) {
30223
30470
  const location = agent.location;
30224
30471
  const primaryPath = getPrimaryAgentFilePath(location, agent.agentType);
30225
30472
  const legacyPath = getLegacyAgentFilePath(location, agent.agentType);
30226
- if (existsSync19(primaryPath)) {
30473
+ if (existsSync20(primaryPath)) {
30227
30474
  unlinkSync2(primaryPath);
30228
30475
  }
30229
- if (existsSync19(legacyPath)) {
30476
+ if (existsSync20(legacyPath)) {
30230
30477
  unlinkSync2(legacyPath);
30231
30478
  }
30232
30479
  }
@@ -30245,7 +30492,7 @@ var COLOR_OPTIONS = [
30245
30492
  "cyan"
30246
30493
  ];
30247
30494
  function openInEditor(filePath) {
30248
- return new Promise((resolve12, reject) => {
30495
+ return new Promise((resolve14, reject) => {
30249
30496
  const platform = process.platform;
30250
30497
  let command4;
30251
30498
  let args;
@@ -30268,7 +30515,7 @@ function openInEditor(filePath) {
30268
30515
  child.on("error", (err) => reject(err));
30269
30516
  child.on(
30270
30517
  "exit",
30271
- (code) => code === 0 ? resolve12() : reject(new Error(`Editor exited with ${code}`))
30518
+ (code) => code === 0 ? resolve14() : reject(new Error(`Editor exited with ${code}`))
30272
30519
  );
30273
30520
  });
30274
30521
  }
@@ -31244,8 +31491,8 @@ function ViewAgent(props) {
31244
31491
  if (props.agent.source === "plugin") return `Plugin: ${props.agent.baseDir ?? "Unknown"}`;
31245
31492
  const baseDir = props.agent.baseDir;
31246
31493
  const file = `${props.agent.filename ?? props.agent.agentType}.md`;
31247
- if (props.agent.source === "projectSettings") return join15(".claude", "agents", file);
31248
- if (baseDir) return join15(baseDir, file);
31494
+ if (props.agent.source === "projectSettings") return join16(".claude", "agents", file);
31495
+ if (baseDir) return join16(baseDir, file);
31249
31496
  return props.agent.source;
31250
31497
  })();
31251
31498
  const toolsSummary = () => {
@@ -31566,9 +31813,9 @@ var agents_default = {
31566
31813
  };
31567
31814
 
31568
31815
  // src/commands/index.ts
31569
- import { memoize as memoize3 } from "lodash-es";
31816
+ import { memoize as memoize4 } from "lodash-es";
31570
31817
  var INTERNAL_ONLY_COMMANDS = [ctx_viz_default, resume_default, listen_default, messages_debug_default];
31571
- var COMMANDS = memoize3(() => [
31818
+ var COMMANDS = memoize4(() => [
31572
31819
  agents_default,
31573
31820
  clear_default,
31574
31821
  compact_default,
@@ -31597,7 +31844,7 @@ var COMMANDS = memoize3(() => [
31597
31844
  ...isAnthropicAuthEnabled() ? [logout_default, login_default()] : [],
31598
31845
  ...INTERNAL_ONLY_COMMANDS
31599
31846
  ]);
31600
- var getCommands = memoize3(async () => {
31847
+ var getCommands = memoize4(async () => {
31601
31848
  const [mcpCommands, customCommands] = await Promise.all([
31602
31849
  getMCPCommands(),
31603
31850
  loadCustomCommands()
@@ -32761,7 +33008,7 @@ var BashParser = class {
32761
33008
  };
32762
33009
 
32763
33010
  // src/utils/bash-parser/validator.ts
32764
- import { resolve as resolve10 } from "path";
33011
+ import { resolve as resolve12 } from "path";
32765
33012
  async function validateSafety(script, cwd = process.cwd()) {
32766
33013
  const tree = await BashParser.parse(script);
32767
33014
  const root = tree.rootNode;
@@ -32812,7 +33059,7 @@ function checkCommand(node, script, cwd) {
32812
33059
  const targetsCritical = args.some((arg) => {
32813
33060
  if (arg.startsWith("-") || arg.startsWith("$")) return false;
32814
33061
  try {
32815
- const absPath = resolve10(cwd, arg).replace(/\\/g, "/");
33062
+ const absPath = resolve12(cwd, arg).replace(/\\/g, "/");
32816
33063
  return criticalPaths.some((critical) => {
32817
33064
  const normalizedCritical = critical.endsWith("/") ? critical : critical + "/";
32818
33065
  if (absPath === critical || absPath === critical.replace(/\/$/, "")) return true;
@@ -32830,7 +33077,7 @@ function checkCommand(node, script, cwd) {
32830
33077
  const targetsRoot = args.some((arg) => {
32831
33078
  if (arg.startsWith("-") || arg.startsWith("$")) return false;
32832
33079
  try {
32833
- const absPath = resolve10(cwd, arg).replace(/\\/g, "/");
33080
+ const absPath = resolve12(cwd, arg).replace(/\\/g, "/");
32834
33081
  return absPath === "/" || /^[a-z]:\/?$/i.test(absPath);
32835
33082
  } catch {
32836
33083
  return arg === "/" || /^[a-z]:\/?$/i.test(arg);
@@ -32938,7 +33185,7 @@ var BashTool = {
32938
33185
  async validateInput({ command: command4, timeout, dangerouslyDisableSandbox, cwd }, context) {
32939
33186
  const trimmed = command4.trim();
32940
33187
  try {
32941
- await validateSafety(trimmed, cwd ? resolve11(getCwd(), cwd) : getCwd());
33188
+ await validateSafety(trimmed, cwd ? resolve13(getCwd(), cwd) : getCwd());
32942
33189
  } catch (e) {
32943
33190
  return {
32944
33191
  result: false,
@@ -32978,10 +33225,10 @@ var BashTool = {
32978
33225
  };
32979
33226
  }
32980
33227
  if (cwd) {
32981
- const fullTargetDir = isAbsolute8(cwd) ? cwd : resolve11(getCwd(), cwd);
33228
+ const fullTargetDir = isAbsolute9(cwd) ? cwd : resolve13(getCwd(), cwd);
32982
33229
  if (!isInDirectory(
32983
- relative12(getOriginalCwd(), fullTargetDir),
32984
- relative12(getCwd(), getOriginalCwd())
33230
+ relative13(getOriginalCwd(), fullTargetDir),
33231
+ relative13(getCwd(), getOriginalCwd())
32985
33232
  )) {
32986
33233
  return {
32987
33234
  result: false,
@@ -32998,10 +33245,10 @@ var BashTool = {
32998
33245
  continue;
32999
33246
  }
33000
33247
  const targetDir = parts[1].replace(/^['"]|['"]$/g, "");
33001
- const fullTargetDir = isAbsolute8(targetDir) ? targetDir : resolve11(getCwd(), targetDir);
33248
+ const fullTargetDir = isAbsolute9(targetDir) ? targetDir : resolve13(getCwd(), targetDir);
33002
33249
  if (!isInDirectory(
33003
- relative12(getOriginalCwd(), fullTargetDir),
33004
- relative12(getCwd(), getOriginalCwd())
33250
+ relative13(getOriginalCwd(), fullTargetDir),
33251
+ relative13(getCwd(), getOriginalCwd())
33005
33252
  )) {
33006
33253
  return {
33007
33254
  result: false,
@@ -33109,7 +33356,7 @@ Did you mean "git ${cmdParts.slice(1).join(" ")}"?`;
33109
33356
  const safeMode = Boolean(context?.safeMode ?? context?.options?.safeMode);
33110
33357
  const userPrompt = typeof context?.options?.lastUserPrompt === "string" ? context.options.lastUserPrompt.trim() : "";
33111
33358
  const commandDescription = typeof description3 === "string" ? description3.trim() : "";
33112
- const effectiveCwd = cwd ? isAbsolute8(cwd) ? cwd : resolve11(getCwd(), cwd) : getCwd();
33359
+ const effectiveCwd = cwd ? isAbsolute9(cwd) ? cwd : resolve13(getCwd(), cwd) : getCwd();
33113
33360
  try {
33114
33361
  await validateSafety(command4, effectiveCwd);
33115
33362
  } catch (error) {
@@ -33259,7 +33506,7 @@ Did you mean "git ${cmdParts.slice(1).join(" ")}"?`;
33259
33506
  if (abortController.signal.aborted) return false;
33260
33507
  const hostForUrl = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
33261
33508
  const url2 = `http://${hostForUrl}:${port}/`;
33262
- return await new Promise((resolve12) => {
33509
+ return await new Promise((resolve14) => {
33263
33510
  const assistantMessage = createAssistantMessage("");
33264
33511
  if (context.messageId) {
33265
33512
  ;
@@ -33275,13 +33522,13 @@ Did you mean "git ${cmdParts.slice(1).join(" ")}"?`;
33275
33522
  suggestions: void 0,
33276
33523
  riskScore: null,
33277
33524
  onAbort() {
33278
- resolve12(false);
33525
+ resolve14(false);
33279
33526
  },
33280
33527
  onAllow() {
33281
- resolve12(true);
33528
+ resolve14(true);
33282
33529
  },
33283
33530
  onReject() {
33284
- resolve12(false);
33531
+ resolve14(false);
33285
33532
  }
33286
33533
  };
33287
33534
  setToolJSX({
@@ -33375,8 +33622,8 @@ Did you mean "git ${cmdParts.slice(1).join(" ")}"?`;
33375
33622
  );
33376
33623
  let backgroundRequested = false;
33377
33624
  let resolveBackground = null;
33378
- const backgroundPromise = new Promise((resolve12) => {
33379
- resolveBackground = resolve12;
33625
+ const backgroundPromise = new Promise((resolve14) => {
33626
+ resolveBackground = resolve14;
33380
33627
  });
33381
33628
  const requestBackground = () => {
33382
33629
  if (backgroundRequested) return;
@@ -33419,7 +33666,7 @@ ${footerParts.join(" ")}`;
33419
33666
  bashId
33420
33667
  })),
33421
33668
  new Promise(
33422
- (resolve12) => setTimeout(() => resolve12({ kind: "tick" }), waitMs)
33669
+ (resolve14) => setTimeout(() => resolve14({ kind: "tick" }), waitMs)
33423
33670
  )
33424
33671
  ]);
33425
33672
  if (race.kind === "background") {
@@ -33453,7 +33700,7 @@ ${footerParts.join(" ")}`;
33453
33700
  if (process.env.NODE_ENV !== "test") {
33454
33701
  getCommandFilePaths(command4, stdout).then((filePaths) => {
33455
33702
  for (const filePath of filePaths) {
33456
- const fullFilePath = isAbsolute8(filePath) ? filePath : resolve11(getCwd(), filePath);
33703
+ const fullFilePath = isAbsolute9(filePath) ? filePath : resolve13(getCwd(), filePath);
33457
33704
  try {
33458
33705
  readFileTimestamps[fullFilePath] = statSync14(fullFilePath).mtimeMs;
33459
33706
  } catch (e) {
@@ -33740,6 +33987,7 @@ export {
33740
33987
  Cost,
33741
33988
  WebFetchTool,
33742
33989
  Select,
33990
+ recordFileEdit,
33743
33991
  hasReadPermission,
33744
33992
  hasWritePermission,
33745
33993
  grantReadPermissionForOriginalDir,
@@ -33766,6 +34014,11 @@ export {
33766
34014
  generatePybContext,
33767
34015
  refreshPybContext,
33768
34016
  resolveModelResponsePolicy,
34017
+ resolveAutoMemoryFlags,
34018
+ getProjectMemoryDir,
34019
+ getAgentMemoryDir,
34020
+ resolveMemoryPath,
34021
+ resolveProjectId,
33769
34022
  formatSystemPromptWithContext,
33770
34023
  useExitOnCtrlCD,
33771
34024
  clearTerminal,