pybao-cli 1.5.9 → 1.5.11

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 (173) hide show
  1. package/cli-acp.js +29 -5
  2. package/cli.js +28 -6
  3. package/dist/REPL-TGEVVUGU.js +50 -0
  4. package/dist/{acp-TKO6ZSSV.js → acp-NSVRKFDR.js} +34 -41
  5. package/dist/acp-NSVRKFDR.js.map +7 -0
  6. package/dist/{agentsValidate-RDNLI7GA.js → agentsValidate-J4WH47PD.js} +7 -7
  7. package/dist/{ask-KTXMYPIA.js → ask-TIOWV5TX.js} +32 -36
  8. package/dist/ask-TIOWV5TX.js.map +7 -0
  9. package/dist/{autoUpdater-53BZ6QWD.js → autoUpdater-35O63ORK.js} +3 -3
  10. package/dist/{chunk-JLC2I3EY.js → chunk-2TZLPLK6.js} +1 -1
  11. package/dist/{chunk-DA6NJEFI.js → chunk-33QWSQC4.js} +21 -9
  12. package/dist/{chunk-DA6NJEFI.js.map → chunk-33QWSQC4.js.map} +2 -2
  13. package/dist/{chunk-LEYWQQ7V.js → chunk-4SQ6LXYG.js} +3 -3
  14. package/dist/{chunk-AWRDD6BG.js → chunk-5MFIJREB.js} +17 -24
  15. package/dist/chunk-5MFIJREB.js.map +7 -0
  16. package/dist/{chunk-6PXEXL7C.js → chunk-5P4P5CFA.js} +2 -7
  17. package/dist/chunk-5P4P5CFA.js.map +7 -0
  18. package/dist/{chunk-T7P3SSAQ.js → chunk-6N43IM3F.js} +1 -1
  19. package/dist/{chunk-G7DKRXDS.js → chunk-7BZ3TT3E.js} +1 -1
  20. package/dist/{chunk-PPFVOBEG.js → chunk-BQWG5WFV.js} +1 -1
  21. package/dist/{chunk-TLZS274Y.js → chunk-E4QA2SMS.js} +3 -3
  22. package/dist/{chunk-QMN64ICT.js → chunk-EV3W3WLB.js} +3 -3
  23. package/dist/{chunk-Q5EZLUFC.js → chunk-EZ5IMWVJ.js} +1 -1
  24. package/dist/{chunk-CPLMSZ63.js → chunk-HOGROHYP.js} +4 -4
  25. package/dist/{chunk-BZGQQ4WZ.js → chunk-I7FH3MBS.js} +3 -3
  26. package/dist/{chunk-SNASBZ2C.js → chunk-IC6XUDKC.js} +3 -3
  27. package/dist/{chunk-HIJYNCCN.js → chunk-IYPL6KOG.js} +1 -1
  28. package/dist/{chunk-JRMAK4PK.js → chunk-KUQZLTIW.js} +4 -8
  29. package/dist/chunk-KUQZLTIW.js.map +7 -0
  30. package/dist/{chunk-4C2CGHBI.js → chunk-L5RH454O.js} +2 -2
  31. package/dist/{chunk-LIOZM4KE.js → chunk-LTHUAMIE.js} +1 -1
  32. package/dist/{chunk-35X2VS4L.js → chunk-M3EVWIF3.js} +3 -3
  33. package/dist/{chunk-4KPVE4K7.js → chunk-MQONPL2D.js} +1 -1
  34. package/dist/{chunk-YTEQEQ56.js → chunk-NXGI34H4.js} +146 -651
  35. package/dist/chunk-NXGI34H4.js.map +7 -0
  36. package/dist/{chunk-57GJQMFS.js → chunk-PFYRLJXN.js} +2 -2
  37. package/dist/{chunk-JE43CQYI.js → chunk-Q3DXXYPX.js} +3 -3
  38. package/dist/{chunk-KNLP4UO6.js → chunk-QMMOGZ7N.js} +4 -4
  39. package/dist/{chunk-276RV4DQ.js → chunk-S7PU3TNH.js} +6 -7
  40. package/dist/{chunk-276RV4DQ.js.map → chunk-S7PU3TNH.js.map} +2 -2
  41. package/dist/{chunk-E35YJNX2.js → chunk-TEGHHNGC.js} +5 -5
  42. package/dist/{chunk-E35YJNX2.js.map → chunk-TEGHHNGC.js.map} +1 -1
  43. package/dist/{chunk-PH6DPTO3.js → chunk-U6JIGJB4.js} +585 -482
  44. package/dist/chunk-U6JIGJB4.js.map +7 -0
  45. package/dist/{chunk-R4ZEH3KJ.js → chunk-VH3IQXUR.js} +1 -1
  46. package/dist/{chunk-AMQ6XZOU.js → chunk-WDCDJPYN.js} +1 -1
  47. package/dist/{chunk-YSL5H7NJ.js → chunk-YJ3HLVKX.js} +2 -2
  48. package/dist/{chunk-CATWZQ3R.js → chunk-YKCKLLMA.js} +2 -2
  49. package/dist/{chunk-L3R7MPZU.js → chunk-YV7Q3VHM.js} +1 -1
  50. package/dist/{cli-LYWCNPC6.js → cli-TIOLFD3Q.js} +92 -96
  51. package/dist/cli-TIOLFD3Q.js.map +7 -0
  52. package/dist/commands-T7TKHXOU.js +54 -0
  53. package/dist/{config-66BMMOES.js → config-BPAZ2QW2.js} +4 -4
  54. package/dist/{context-PG7YTQCJ.js → context-UXBFAE6U.js} +6 -6
  55. package/dist/{conversationPersistence-DB6IUU2I.js → conversationPersistence-S5Y54OEJ.js} +3 -3
  56. package/dist/{conversationTracker-WG3J56PX.js → conversationTracker-EPTEVBKG.js} +4 -4
  57. package/dist/{customCommands-XDKUVT73.js → customCommands-LJEKRKH7.js} +4 -4
  58. package/dist/{env-FW74XJHK.js → env-ZKDJ63EH.js} +2 -2
  59. package/dist/{file-U2NXQ6RC.js → file-62N53R4I.js} +4 -4
  60. package/dist/index.js +3 -3
  61. package/dist/{llm-6VJMMPDO.js → llm-257Z7WOJ.js} +31 -31
  62. package/dist/{llmLazy-LYGZWC7G.js → llmLazy-766Y5JWG.js} +1 -1
  63. package/dist/{loader-DMZVU2XJ.js → loader-IC2B4I4J.js} +4 -4
  64. package/dist/{lsp-6LNF5DQB.js → lsp-ARSWURXF.js} +6 -6
  65. package/dist/{lspAnchor-SF5Y7ZJT.js → lspAnchor-5N3KECK7.js} +6 -6
  66. package/dist/{mcp-NLDX3RQE.js → mcp-6LNALW65.js} +7 -7
  67. package/dist/{mentionProcessor-BMX6VGRH.js → mentionProcessor-LQ6WNIKV.js} +5 -5
  68. package/dist/{messages-OTQ6IJM5.js → messages-GNEQQA27.js} +1 -1
  69. package/dist/{model-KWGEASLY.js → model-F7IYXNO5.js} +5 -5
  70. package/dist/{openai-XIRWQY5H.js → openai-HTXVPLAS.js} +5 -5
  71. package/dist/{outputStyles-HKYM5C76.js → outputStyles-IEUFSMMK.js} +4 -4
  72. package/dist/{pluginRuntime-25Y2MVIN.js → pluginRuntime-4AI2VGR6.js} +6 -6
  73. package/dist/{pluginValidation-CIJIQKGB.js → pluginValidation-VM4W42FR.js} +6 -6
  74. package/dist/prompts-EJTGSKLG.js +56 -0
  75. package/dist/{pybAgentSessionLoad-TF3BFX4S.js → pybAgentSessionLoad-A3OZD3FR.js} +4 -4
  76. package/dist/{pybAgentSessionResume-Y5JO4GLH.js → pybAgentSessionResume-T6XFQUGW.js} +4 -4
  77. package/dist/{pybAgentStreamJsonSession-46VLF4QN.js → pybAgentStreamJsonSession-J6TKWFS5.js} +1 -1
  78. package/dist/{pybHooks-LZPU4EF6.js → pybHooks-QXTF2XWB.js} +4 -4
  79. package/dist/query-ONI2G7VA.js +58 -0
  80. package/dist/{registry-6LUE7ZWC.js → registry-N7W2DT2O.js} +5 -5
  81. package/dist/{ripgrep-KVB55D22.js → ripgrep-4YX3ALXH.js} +3 -3
  82. package/dist/{skillMarketplace-2IVEPC2E.js → skillMarketplace-BHPBAIS5.js} +3 -3
  83. package/dist/{state-OGBESWFS.js → state-BAYDHBR6.js} +2 -2
  84. package/dist/{theme-QQ2SCFEK.js → theme-5WK7OBSE.js} +5 -5
  85. package/dist/{toolPermissionSettings-ZGGPBK6S.js → toolPermissionSettings-KHCHXARB.js} +6 -6
  86. package/dist/tools-LTGCAA7X.js +55 -0
  87. package/dist/{userInput-75VCTJDE.js → userInput-I5VZDN77.js} +32 -32
  88. package/package.json +17 -24
  89. package/scripts/cli-acp-wrapper.cjs +29 -5
  90. package/scripts/cli-wrapper.cjs +28 -6
  91. package/scripts/postinstall.js +3 -1
  92. package/scripts/typed-part-baseline-benchmark.mjs +179 -0
  93. package/scripts/typed-part-performance-gate.mjs +100 -0
  94. package/scripts/typed-sql-install-smoke.mjs +69 -0
  95. package/scripts/typed-sql-no-fallback-gate.mjs +80 -0
  96. package/scripts/typed-sql-release-gate.mjs +81 -0
  97. package/scripts/typed-sql-schema-guard.mjs +68 -0
  98. package/dist/REPL-FDBOFOZN.js +0 -50
  99. package/dist/acp-TKO6ZSSV.js.map +0 -7
  100. package/dist/ask-KTXMYPIA.js.map +0 -7
  101. package/dist/chunk-6PXEXL7C.js.map +0 -7
  102. package/dist/chunk-AWRDD6BG.js.map +0 -7
  103. package/dist/chunk-JRMAK4PK.js.map +0 -7
  104. package/dist/chunk-PH6DPTO3.js.map +0 -7
  105. package/dist/chunk-YTEQEQ56.js.map +0 -7
  106. package/dist/cli-LYWCNPC6.js.map +0 -7
  107. package/dist/commands-DYXAWJO6.js +0 -54
  108. package/dist/prompts-WH3VEHH6.js +0 -56
  109. package/dist/query-4B3GTPBN.js +0 -58
  110. package/dist/tools-UXPFIHD4.js +0 -55
  111. package/resources/output-styles/legacy-system-maintainer.md +0 -47
  112. /package/dist/{REPL-FDBOFOZN.js.map → REPL-TGEVVUGU.js.map} +0 -0
  113. /package/dist/{agentsValidate-RDNLI7GA.js.map → agentsValidate-J4WH47PD.js.map} +0 -0
  114. /package/dist/{autoUpdater-53BZ6QWD.js.map → autoUpdater-35O63ORK.js.map} +0 -0
  115. /package/dist/{chunk-JLC2I3EY.js.map → chunk-2TZLPLK6.js.map} +0 -0
  116. /package/dist/{chunk-LEYWQQ7V.js.map → chunk-4SQ6LXYG.js.map} +0 -0
  117. /package/dist/{chunk-T7P3SSAQ.js.map → chunk-6N43IM3F.js.map} +0 -0
  118. /package/dist/{chunk-G7DKRXDS.js.map → chunk-7BZ3TT3E.js.map} +0 -0
  119. /package/dist/{chunk-PPFVOBEG.js.map → chunk-BQWG5WFV.js.map} +0 -0
  120. /package/dist/{chunk-TLZS274Y.js.map → chunk-E4QA2SMS.js.map} +0 -0
  121. /package/dist/{chunk-QMN64ICT.js.map → chunk-EV3W3WLB.js.map} +0 -0
  122. /package/dist/{chunk-Q5EZLUFC.js.map → chunk-EZ5IMWVJ.js.map} +0 -0
  123. /package/dist/{chunk-CPLMSZ63.js.map → chunk-HOGROHYP.js.map} +0 -0
  124. /package/dist/{chunk-BZGQQ4WZ.js.map → chunk-I7FH3MBS.js.map} +0 -0
  125. /package/dist/{chunk-SNASBZ2C.js.map → chunk-IC6XUDKC.js.map} +0 -0
  126. /package/dist/{chunk-HIJYNCCN.js.map → chunk-IYPL6KOG.js.map} +0 -0
  127. /package/dist/{chunk-4C2CGHBI.js.map → chunk-L5RH454O.js.map} +0 -0
  128. /package/dist/{chunk-LIOZM4KE.js.map → chunk-LTHUAMIE.js.map} +0 -0
  129. /package/dist/{chunk-35X2VS4L.js.map → chunk-M3EVWIF3.js.map} +0 -0
  130. /package/dist/{chunk-4KPVE4K7.js.map → chunk-MQONPL2D.js.map} +0 -0
  131. /package/dist/{chunk-57GJQMFS.js.map → chunk-PFYRLJXN.js.map} +0 -0
  132. /package/dist/{chunk-JE43CQYI.js.map → chunk-Q3DXXYPX.js.map} +0 -0
  133. /package/dist/{chunk-KNLP4UO6.js.map → chunk-QMMOGZ7N.js.map} +0 -0
  134. /package/dist/{chunk-R4ZEH3KJ.js.map → chunk-VH3IQXUR.js.map} +0 -0
  135. /package/dist/{chunk-AMQ6XZOU.js.map → chunk-WDCDJPYN.js.map} +0 -0
  136. /package/dist/{chunk-YSL5H7NJ.js.map → chunk-YJ3HLVKX.js.map} +0 -0
  137. /package/dist/{chunk-CATWZQ3R.js.map → chunk-YKCKLLMA.js.map} +0 -0
  138. /package/dist/{chunk-L3R7MPZU.js.map → chunk-YV7Q3VHM.js.map} +0 -0
  139. /package/dist/{commands-DYXAWJO6.js.map → commands-T7TKHXOU.js.map} +0 -0
  140. /package/dist/{config-66BMMOES.js.map → config-BPAZ2QW2.js.map} +0 -0
  141. /package/dist/{context-PG7YTQCJ.js.map → context-UXBFAE6U.js.map} +0 -0
  142. /package/dist/{conversationPersistence-DB6IUU2I.js.map → conversationPersistence-S5Y54OEJ.js.map} +0 -0
  143. /package/dist/{conversationTracker-WG3J56PX.js.map → conversationTracker-EPTEVBKG.js.map} +0 -0
  144. /package/dist/{customCommands-XDKUVT73.js.map → customCommands-LJEKRKH7.js.map} +0 -0
  145. /package/dist/{env-FW74XJHK.js.map → env-ZKDJ63EH.js.map} +0 -0
  146. /package/dist/{file-U2NXQ6RC.js.map → file-62N53R4I.js.map} +0 -0
  147. /package/dist/{llm-6VJMMPDO.js.map → llm-257Z7WOJ.js.map} +0 -0
  148. /package/dist/{llmLazy-LYGZWC7G.js.map → llmLazy-766Y5JWG.js.map} +0 -0
  149. /package/dist/{loader-DMZVU2XJ.js.map → loader-IC2B4I4J.js.map} +0 -0
  150. /package/dist/{lsp-6LNF5DQB.js.map → lsp-ARSWURXF.js.map} +0 -0
  151. /package/dist/{lspAnchor-SF5Y7ZJT.js.map → lspAnchor-5N3KECK7.js.map} +0 -0
  152. /package/dist/{mcp-NLDX3RQE.js.map → mcp-6LNALW65.js.map} +0 -0
  153. /package/dist/{mentionProcessor-BMX6VGRH.js.map → mentionProcessor-LQ6WNIKV.js.map} +0 -0
  154. /package/dist/{messages-OTQ6IJM5.js.map → messages-GNEQQA27.js.map} +0 -0
  155. /package/dist/{model-KWGEASLY.js.map → model-F7IYXNO5.js.map} +0 -0
  156. /package/dist/{openai-XIRWQY5H.js.map → openai-HTXVPLAS.js.map} +0 -0
  157. /package/dist/{outputStyles-HKYM5C76.js.map → outputStyles-IEUFSMMK.js.map} +0 -0
  158. /package/dist/{pluginRuntime-25Y2MVIN.js.map → pluginRuntime-4AI2VGR6.js.map} +0 -0
  159. /package/dist/{pluginValidation-CIJIQKGB.js.map → pluginValidation-VM4W42FR.js.map} +0 -0
  160. /package/dist/{prompts-WH3VEHH6.js.map → prompts-EJTGSKLG.js.map} +0 -0
  161. /package/dist/{pybAgentSessionLoad-TF3BFX4S.js.map → pybAgentSessionLoad-A3OZD3FR.js.map} +0 -0
  162. /package/dist/{pybAgentSessionResume-Y5JO4GLH.js.map → pybAgentSessionResume-T6XFQUGW.js.map} +0 -0
  163. /package/dist/{pybAgentStreamJsonSession-46VLF4QN.js.map → pybAgentStreamJsonSession-J6TKWFS5.js.map} +0 -0
  164. /package/dist/{pybHooks-LZPU4EF6.js.map → pybHooks-QXTF2XWB.js.map} +0 -0
  165. /package/dist/{query-4B3GTPBN.js.map → query-ONI2G7VA.js.map} +0 -0
  166. /package/dist/{registry-6LUE7ZWC.js.map → registry-N7W2DT2O.js.map} +0 -0
  167. /package/dist/{ripgrep-KVB55D22.js.map → ripgrep-4YX3ALXH.js.map} +0 -0
  168. /package/dist/{skillMarketplace-2IVEPC2E.js.map → skillMarketplace-BHPBAIS5.js.map} +0 -0
  169. /package/dist/{state-OGBESWFS.js.map → state-BAYDHBR6.js.map} +0 -0
  170. /package/dist/{theme-QQ2SCFEK.js.map → theme-5WK7OBSE.js.map} +0 -0
  171. /package/dist/{toolPermissionSettings-ZGGPBK6S.js.map → toolPermissionSettings-KHCHXARB.js.map} +0 -0
  172. /package/dist/{tools-UXPFIHD4.js.map → tools-LTGCAA7X.js.map} +0 -0
  173. /package/dist/{userInput-75VCTJDE.js.map → userInput-I5VZDN77.js.map} +0 -0
@@ -3,69 +3,68 @@ const require = __pybCreateRequire(import.meta.url);
3
3
  import {
4
4
  createConversationTrackerPersistenceTelemetryEmitter,
5
5
  getSystemPrompt,
6
- query,
7
- resolveTrackerPersistenceMode
8
- } from "./chunk-PH6DPTO3.js";
9
- import "./chunk-Q5EZLUFC.js";
10
- import "./chunk-JLC2I3EY.js";
11
- import "./chunk-L3R7MPZU.js";
12
- import "./chunk-BZGQQ4WZ.js";
6
+ query
7
+ } from "./chunk-U6JIGJB4.js";
8
+ import "./chunk-EZ5IMWVJ.js";
9
+ import "./chunk-2TZLPLK6.js";
10
+ import "./chunk-YV7Q3VHM.js";
11
+ import "./chunk-I7FH3MBS.js";
13
12
  import {
14
13
  ConversationTracker
15
- } from "./chunk-PPFVOBEG.js";
14
+ } from "./chunk-BQWG5WFV.js";
16
15
  import {
17
16
  FileSystemConversationPersistence
18
- } from "./chunk-T7P3SSAQ.js";
17
+ } from "./chunk-6N43IM3F.js";
19
18
  import {
20
19
  beginReplSessionScope
21
20
  } from "./chunk-F4AXICO7.js";
22
21
  import "./chunk-5P7HBXTD.js";
23
- import "./chunk-TLZS274Y.js";
24
- import "./chunk-6PXEXL7C.js";
25
- import "./chunk-CATWZQ3R.js";
22
+ import "./chunk-E4QA2SMS.js";
23
+ import "./chunk-5P4P5CFA.js";
24
+ import "./chunk-YKCKLLMA.js";
26
25
  import "./chunk-XKYHFZEC.js";
27
- import "./chunk-KNLP4UO6.js";
28
- import "./chunk-276RV4DQ.js";
29
- import "./chunk-R4ZEH3KJ.js";
30
- import "./chunk-35X2VS4L.js";
26
+ import "./chunk-QMMOGZ7N.js";
27
+ import "./chunk-S7PU3TNH.js";
28
+ import "./chunk-VH3IQXUR.js";
29
+ import "./chunk-M3EVWIF3.js";
31
30
  import "./chunk-UNNVICVU.js";
32
- import "./chunk-YSL5H7NJ.js";
33
- import "./chunk-DA6NJEFI.js";
31
+ import "./chunk-YJ3HLVKX.js";
32
+ import "./chunk-33QWSQC4.js";
34
33
  import "./chunk-A3BVXXA3.js";
35
34
  import {
36
35
  createUserTurnMessageFromBlocks
37
- } from "./chunk-JRMAK4PK.js";
36
+ } from "./chunk-KUQZLTIW.js";
38
37
  import "./chunk-3DFBSQIT.js";
39
38
  import "./chunk-B6IMQJZM.js";
40
39
  import {
41
40
  getTotalCost
42
41
  } from "./chunk-OUXHGDLH.js";
43
- import "./chunk-57GJQMFS.js";
42
+ import "./chunk-PFYRLJXN.js";
44
43
  import "./chunk-QWIBSCDN.js";
45
- import "./chunk-CPLMSZ63.js";
46
- import "./chunk-JE43CQYI.js";
47
- import "./chunk-HIJYNCCN.js";
44
+ import "./chunk-HOGROHYP.js";
45
+ import "./chunk-Q3DXXYPX.js";
46
+ import "./chunk-IYPL6KOG.js";
48
47
  import "./chunk-UZ34JEUK.js";
49
- import "./chunk-4C2CGHBI.js";
48
+ import "./chunk-L5RH454O.js";
50
49
  import "./chunk-BJSWTHRM.js";
51
50
  import {
52
51
  getModelManager
53
- } from "./chunk-QMN64ICT.js";
52
+ } from "./chunk-EV3W3WLB.js";
54
53
  import {
55
54
  getContext
56
- } from "./chunk-E35YJNX2.js";
57
- import "./chunk-LIOZM4KE.js";
58
- import "./chunk-4KPVE4K7.js";
59
- import "./chunk-LEYWQQ7V.js";
55
+ } from "./chunk-TEGHHNGC.js";
56
+ import "./chunk-LTHUAMIE.js";
57
+ import "./chunk-MQONPL2D.js";
58
+ import "./chunk-4SQ6LXYG.js";
60
59
  import "./chunk-RQVLBMP7.js";
61
- import "./chunk-AMQ6XZOU.js";
60
+ import "./chunk-WDCDJPYN.js";
62
61
  import {
63
62
  getMessagesPath,
64
63
  overwriteLog,
65
64
  resolveXdgDataPath,
66
65
  setCwd
67
- } from "./chunk-G7DKRXDS.js";
68
- import "./chunk-AWRDD6BG.js";
66
+ } from "./chunk-7BZ3TT3E.js";
67
+ import "./chunk-5MFIJREB.js";
69
68
  import "./chunk-I3J4JYES.js";
70
69
 
71
70
  // src/app/ask.ts
@@ -91,10 +90,7 @@ async function ask({
91
90
  }) {
92
91
  await setCwd(cwd);
93
92
  const trackerSessionId = `ask:${messageLogName}:0`;
94
- const trackerPersistenceMode = resolveTrackerPersistenceMode({
95
- context: { agentId: "ask" },
96
- rolloutKey: trackerSessionId
97
- }).persistenceMode;
93
+ const trackerPersistenceMode = "required";
98
94
  const restoreSessionScope = beginReplSessionScope(trackerSessionId);
99
95
  const conversationTracker = new ConversationTracker({
100
96
  sessionId: trackerSessionId,
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/app/ask.ts"],
4
+ "sourcesContent": ["import { last } from 'lodash-es'\nimport { Command } from '@commands'\nimport { getSystemPrompt } from '@constants/prompts'\nimport { getContext } from '@context'\nimport { getTotalCost } from '@costTracker'\nimport { Message, query } from '@query'\nimport type { CanUseToolFn } from '@pyb-types/canUseTool'\nimport { Tool } from '@tool'\nimport { getModelManager } from '@utils/model'\nimport { setCwd } from '@utils/state'\nimport { getMessagesPath, overwriteLog } from '@utils/log'\nimport { createUserTurnMessageFromBlocks } from '@utils/messages'\nimport { ConversationTracker } from '@utils/session/conversationTracker'\nimport { FileSystemConversationPersistence } from '@utils/session/conversationPersistence'\nimport { beginReplSessionScope } from '@utils/session/replSessionBridge'\nimport { resolveXdgDataPath } from '@utils/config/env'\nimport { createConversationTrackerPersistenceTelemetryEmitter } from '@services/telemetry/conversationTrackerTelemetry'\nimport { join } from 'path'\n\ntype Props = {\n commands: Command[]\n safeMode?: boolean\n hasPermissionsToUseTool: CanUseToolFn\n messageLogName: string\n prompt: string\n cwd: string\n tools: Tool[]\n verbose?: boolean\n initialMessages?: Message[]\n persistSession?: boolean\n}\n\nfunction getProjectDirSlug(cwd: string): string {\n return cwd.replace(/[^a-zA-Z0-9]/g, '-')\n}\n\nfunction getConversationTrackerPersistenceDir(cwd: string): string {\n return resolveXdgDataPath(join(getProjectDirSlug(cwd), 'conversation-trackers'))\n}\n\nexport async function ask({\n commands,\n safeMode,\n hasPermissionsToUseTool,\n messageLogName,\n prompt,\n cwd,\n tools,\n verbose = false,\n initialMessages,\n persistSession = true,\n}: Props): Promise<{\n resultText: string\n totalCost: number\n messageHistoryFile: string\n}> {\n await setCwd(cwd)\n const trackerSessionId = `ask:${messageLogName}:0`\n const trackerPersistenceMode = 'required'\n const restoreSessionScope = beginReplSessionScope(trackerSessionId)\n const conversationTracker = new ConversationTracker({\n sessionId: trackerSessionId,\n persistence: new FileSystemConversationPersistence(\n getConversationTrackerPersistenceDir(cwd),\n ),\n persistenceMode: trackerPersistenceMode,\n onPersistenceEvent: createConversationTrackerPersistenceTelemetryEmitter('ask'),\n })\n conversationTracker.restore()\n const message = createUserTurnMessageFromBlocks([{ type: 'text', text: prompt }])\n const messages: Message[] = [...(initialMessages ?? []), message]\n\n const [systemPrompt, context, model] = await Promise.all([\n getSystemPrompt(),\n getContext(),\n getModelManager().getModelName('main'),\n ])\n\n try {\n for await (const m of query(\n messages,\n systemPrompt,\n context,\n hasPermissionsToUseTool,\n {\n options: {\n commands,\n tools,\n verbose,\n safeMode,\n forkNumber: 0,\n messageLogName: 'unused',\n maxThinkingTokens: 0,\n persistSession,\n },\n abortController: new AbortController(),\n messageId: undefined,\n readFileTimestamps: {},\n setToolJSX: () => {},\n conversationTracker,\n },\n )) {\n messages.push(m)\n }\n } finally {\n restoreSessionScope()\n }\n\n const result = last(messages)\n if (!result || result.type !== 'assistant') {\n throw new Error('Expected content to be an assistant message')\n }\n\n const textContent = result.message.content.find(c => c.type === 'text')\n if (!textContent) {\n throw new Error(\n `Expected at least one text content item, but got ${JSON.stringify(\n result.message.content,\n null,\n 2,\n )}`,\n )\n }\n\n const messageHistoryFile = getMessagesPath(messageLogName, 0, 0)\n overwriteLog(messageHistoryFile, messages)\n\n return {\n resultText: textContent.text,\n totalCost: getTotalCost(),\n messageHistoryFile,\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AAiBrB,SAAS,YAAY;AAerB,SAAS,kBAAkB,KAAqB;AAC9C,SAAO,IAAI,QAAQ,iBAAiB,GAAG;AACzC;AAEA,SAAS,qCAAqC,KAAqB;AACjE,SAAO,mBAAmB,KAAK,kBAAkB,GAAG,GAAG,uBAAuB,CAAC;AACjF;AAEA,eAAsB,IAAI;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,iBAAiB;AACnB,GAIG;AACD,QAAM,OAAO,GAAG;AAChB,QAAM,mBAAmB,OAAO,cAAc;AAC9C,QAAM,yBAAyB;AAC/B,QAAM,sBAAsB,sBAAsB,gBAAgB;AAClE,QAAM,sBAAsB,IAAI,oBAAoB;AAAA,IAClD,WAAW;AAAA,IACX,aAAa,IAAI;AAAA,MACf,qCAAqC,GAAG;AAAA,IAC1C;AAA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/D,eAAa,oBAAoB,QAAQ;AAEzC,SAAO;AAAA,IACL,YAAY,YAAY;AAAA,IACxB,WAAW,aAAa;AAAA,IACxB;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -5,9 +5,9 @@ import {
5
5
  checkAndNotifyUpdate,
6
6
  getLatestVersion,
7
7
  getUpdateCommandSuggestions
8
- } from "./chunk-SNASBZ2C.js";
9
- import "./chunk-G7DKRXDS.js";
10
- import "./chunk-AWRDD6BG.js";
8
+ } from "./chunk-IC6XUDKC.js";
9
+ import "./chunk-7BZ3TT3E.js";
10
+ import "./chunk-5MFIJREB.js";
11
11
  import "./chunk-I3J4JYES.js";
12
12
  export {
13
13
  assertMinVersion,
@@ -3,7 +3,7 @@ const require = __pybCreateRequire(import.meta.url);
3
3
  import {
4
4
  getSessionProjectDir,
5
5
  getSessionProjectsDir
6
- } from "./chunk-L3R7MPZU.js";
6
+ } from "./chunk-YV7Q3VHM.js";
7
7
  import {
8
8
  isUuid
9
9
  } from "./chunk-5P7HBXTD.js";
@@ -8,12 +8,12 @@ import {
8
8
  } from "./chunk-BJSWTHRM.js";
9
9
  import {
10
10
  debug
11
- } from "./chunk-AMQ6XZOU.js";
11
+ } from "./chunk-WDCDJPYN.js";
12
12
  import {
13
13
  getCwd,
14
14
  getXdgConfigDir,
15
15
  logError
16
- } from "./chunk-G7DKRXDS.js";
16
+ } from "./chunk-7BZ3TT3E.js";
17
17
 
18
18
  // src/utils/agent/loader.ts
19
19
  import {
@@ -401,7 +401,7 @@ var BUILTIN_EXPLORE = {
401
401
  tools: "*",
402
402
  disallowedTools: ["Task", "Edit", "Write", "NotebookEdit"],
403
403
  model: "inherit",
404
- systemPrompt: `You are optimized specifically for codebase exploration. You excel at thoroughly navigating and exploring codebases.And faster and more thorough than other agents for search tasks.
404
+ systemPrompt: `You are optimized specifically for codebase or complex, multi-step code files exploration. You excel at thoroughly navigating and exploring codebases.And faster and more thorough than other agents for search tasks.
405
405
 
406
406
  === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
407
407
  This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
@@ -424,7 +424,7 @@ Guidelines:
424
424
  - Use Glob for broad file pattern matching
425
425
  - Use Grep for searching file contents with regex
426
426
  - Use Read when you know the specific file path you need to read
427
- - Use LS to understand directory structure and top-level layout quickly
427
+ - Use Glob "dir/*" to understand directory structure and top-level layout quickly
428
428
  - Use LSP for symbol-level navigation (definitions/references) after you locate a file
429
429
  - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
430
430
  - NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
@@ -437,15 +437,27 @@ NOTE: You are meant to be a fast agent that returns output as quickly as possibl
437
437
  - Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations
438
438
  - Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files
439
439
 
440
+ # Tool usage policy
441
+ - You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency. However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. Never use placeholders or guess missing parameters in tool calls.
442
+ - If the user specifies that they want you to run tools "in parallel", you MUST send a single message with multiple tool use content blocks.
443
+ - It is always better to speculatively read multiple files as a batch that are potentially useful.
444
+ - It is always better to speculatively perform multiple searches as a batch that are potentially useful.
445
+ - Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.
446
+
440
447
  # Cognitive Search Strategy
441
- 1. **Concept Search**: WHEN searching for high-level concepts (e.g., "Auth Logic", "Payment Flow") OR when uncertain about exact naming, you MUST use \`semantic: true\` in Grep/Glob tools. This activates the LSP Workspace Symbol search which is resilient to typos and fuzzy matches.
442
- - Example: \`GrepTool(pattern: "AuthFeatr", semantic: true)\` will find "AuthFeature"
443
- - Example: \`GlobTool(pattern: "tests", semantic: true)\` will find test files based on project structure
448
+ 1. **Concept Search**: WHEN searching for high-level concepts (e.g., "Auth Logic", "Payment Flow") OR when you are uncertain about exact naming, you MUST use \`semantic: true\` in Grep/Glob tools. This activates the LSP Workspace Symbol search which is resilient to typos and fuzzy matches.
449
+ - Example: \`GrepTool(pattern: "AuthFeatr", semantic: true)\` will find "AuthFeature".
450
+ - Example: \`GlobTool(pattern: "tests", semantic: true)\` will find test files based on project structure.
444
451
  2. **Exact Identifier**: WHEN you know the precise class/function name (e.g., "UserProfile", "initDatabase"), use standard Grep/Glob without \`semantic\` flag.
445
452
  3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \`semantic: true\`.
453
+ 4. **File System Exploration Priority**:For file system exploration, decide based on intent: if you need global structure/entry points, prefer Glob "dir/*" first; if you have keywords or fuzzy paths, prefer Glob first. If results are too broad, use Glob "dir/*" to narrow structure or combine with Grep/LSP. Only use Bash for executing scripts or binaries.
454
+
455
+ # Path Fragmentation Strategy
456
+ - Root -> Core Directory -> Secondary Modules
457
+ - Run structure scanning in the above order
446
458
 
447
459
  # LSP Priority & Scope Limits
448
- - **Order**: Structure Tree (LS) \u2192 Hotspot Location \u2192 Read \u2192 LSP
460
+ - **Order**: Structure Tree (Glob "dir/*") \u2192 Hotspot Location \u2192 Read \u2192 LSP
449
461
  - Use \`LSPTool.documentSymbol\` or \`LSPTool.definition\` only when you have a precise position and need to confirm exact range
450
462
  - Do NOT rely on line numbers from \`read_file\` alone as they may be outdated
451
463
  - \`workspaceSymbol\` requires a query and should provide clear path/module scope to avoid unbounded workspace queries
@@ -522,7 +534,7 @@ List 3-5 files most critical for implementing this plan:
522
534
  3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \`semantic: true\`.
523
535
 
524
536
  # LSP Priority & Scope Limits
525
- - **Order**: Structure Tree (LS) \u2192 Hotspot Location \u2192 Read \u2192 LSP
537
+ - **Order**: Structure Tree (Glob "dir/*") \u2192 Hotspot Location \u2192 Read \u2192 LSP
526
538
  - Use \`LSPTool.documentSymbol\` or \`LSPTool.definition\` only when you have a precise position and need to confirm exact range
527
539
  - Do NOT rely on line numbers from \`read_file\` alone as they may be outdated
528
540
  - \`workspaceSymbol\` requires a query and should provide clear path/module scope to avoid unbounded workspace queries
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/utils/agent/loader.ts"],
4
- "sourcesContent": ["\nimport {\n existsSync,\n readFileSync,\n readdirSync,\n statSync,\n watch,\n type FSWatcher,\n} from 'fs'\nimport { basename, dirname, join, resolve } from 'path'\nimport { homedir } from 'os'\nimport matter from 'gray-matter'\nimport yaml from 'js-yaml'\nimport { memoize } from 'lodash-es'\nimport { z } from 'zod'\nimport { getCwd } from '@utils/state'\nimport { getSessionPlugins } from '@utils/session/sessionPlugins'\nimport { isSettingSourceEnabled } from '@utils/config/settingSources'\nimport { debug as debugLogger } from '@utils/log/debugLogger'\nimport { logError } from '@utils/log'\nimport { getXdgConfigDir } from '@utils/config/env'\n\nexport type AgentSource =\n | 'built-in'\n | 'plugin'\n | 'userSettings'\n | 'projectSettings'\n | 'flagSettings'\n | 'policySettings'\n\nexport type AgentLocation = 'built-in' | 'plugin' | 'user' | 'project'\n\nexport type AgentModel = 'inherit' | 'haiku' | 'sonnet' | 'opus' | (string & {})\n\nexport type AgentPermissionMode =\n | 'default'\n | 'acceptEdits'\n | 'plan'\n | 'bypassPermissions'\n | 'dontAsk'\n | 'delegate'\n\nexport interface AgentConfig {\n agentType: string\n whenToUse: string\n tools: string[] | '*'\n disallowedTools?: string[]\n skills?: string[]\n systemPrompt: string\n source: AgentSource\n location: AgentLocation\n baseDir?: string\n filename?: string\n color?: string\n model?: AgentModel\n permissionMode?: AgentPermissionMode\n forkContext?: boolean\n}\n\nfunction getClaudePolicyBaseDir(): string {\n switch (process.platform) {\n case 'darwin':\n return '/Library/Application Support/ClaudeCode'\n case 'win32':\n return existsSync('C:\\\\Program Files\\\\ClaudeCode')\n ? 'C:\\\\Program Files\\\\ClaudeCode'\n : 'C:\\\\ProgramData\\\\ClaudeCode'\n default:\n return '/etc/claude-code'\n }\n}\n\nfunction normalizeOverride(value: unknown): string | null {\n if (typeof value !== 'string') return null\n const trimmed = value.trim()\n return trimmed ? resolve(trimmed) : null\n}\n\nfunction dedupeStrings(values: string[]): string[] {\n const out: string[] = []\n const seen = new Set<string>()\n for (const value of values) {\n if (!value) continue\n if (seen.has(value)) continue\n seen.add(value)\n out.push(value)\n }\n return out\n}\n\nfunction getUserConfigRoots(): string[] {\n const claudeOverride = normalizeOverride(process.env.CLAUDE_CONFIG_DIR)\n const pybOverride = normalizeOverride(process.env.PYB_CONFIG_DIR)\n\n const hasAnyOverride = Boolean(claudeOverride || pybOverride)\n if (hasAnyOverride) {\n return dedupeStrings([claudeOverride ?? '', pybOverride ?? ''])\n }\n\n return dedupeStrings([\n getXdgConfigDir(),\n join(homedir(), '.claude'),\n join(homedir(), '.pyb'),\n ])\n}\n\nfunction findProjectAgentDirs(cwd: string): string[] {\n const result: string[] = []\n const home = resolve(homedir())\n let current = resolve(cwd)\n\n while (current !== home) {\n const claudeDir = join(current, '.claude', 'agents')\n if (existsSync(claudeDir)) result.push(claudeDir)\n\n const pybDir = join(current, '.pyb', 'agents')\n if (existsSync(pybDir)) result.push(pybDir)\n\n const parent = dirname(current)\n if (parent === current) break\n current = parent\n }\n\n return result\n}\n\nfunction listMarkdownFilesRecursively(rootDir: string): string[] {\n const files: string[] = []\n const visitedDirs = new Set<string>()\n\n const walk = (dirPath: string) => {\n let dirStat: ReturnType<typeof statSync>\n try {\n dirStat = statSync(dirPath)\n } catch {\n return\n }\n if (!dirStat.isDirectory()) return\n\n const dirKey = `${dirStat.dev}:${dirStat.ino}`\n if (visitedDirs.has(dirKey)) return\n visitedDirs.add(dirKey)\n\n let entries: Array<{\n name: string\n isDirectory(): boolean\n isFile(): boolean\n isSymbolicLink(): boolean\n }>\n try {\n entries = readdirSync(dirPath, {\n withFileTypes: true,\n encoding: 'utf8',\n }) as any\n } catch {\n return\n }\n\n for (const entry of entries) {\n const name = String(entry.name ?? '')\n const fullPath = join(dirPath, name)\n\n if (entry.isDirectory()) {\n walk(fullPath)\n continue\n }\n\n if (entry.isFile()) {\n if (name.endsWith('.md')) files.push(fullPath)\n continue\n }\n\n if (entry.isSymbolicLink()) {\n try {\n const st = statSync(fullPath)\n if (st.isDirectory()) {\n walk(fullPath)\n } else if (st.isFile() && name.endsWith('.md')) {\n files.push(fullPath)\n }\n } catch {\n continue\n }\n }\n }\n }\n\n if (!existsSync(rootDir)) return []\n walk(rootDir)\n return files\n}\n\nfunction readMarkdownFile(filePath: string): { frontmatter: any; content: string } | null {\n try {\n const raw = readFileSync(filePath, 'utf8')\n const yamlSchema = (yaml as any).JSON_SCHEMA\n const matterOptions = {\n engines: {\n yaml: {\n parse: (input: string) =>\n yaml.load(input, yamlSchema ? { schema: yamlSchema } : undefined) ??\n {},\n },\n },\n }\n const parsed = matter(raw, matterOptions)\n return {\n frontmatter: (parsed.data as any) ?? {},\n content: String(parsed.content ?? ''),\n }\n } catch {\n return null\n }\n}\n\nfunction splitCliList(values: string[]): string[] {\n if (values.length === 0) return []\n const out: string[] = []\n\n for (const value of values) {\n if (!value) continue\n let current = ''\n let inParens = false\n\n for (const ch of value) {\n switch (ch) {\n case '(':\n inParens = true\n current += ch\n break\n case ')':\n inParens = false\n current += ch\n break\n case ',':\n if (inParens) {\n current += ch\n } else {\n const trimmed = current.trim()\n if (trimmed) out.push(trimmed)\n current = ''\n }\n break\n case ' ':\n if (inParens) {\n current += ch\n } else {\n const trimmed = current.trim()\n if (trimmed) out.push(trimmed)\n current = ''\n }\n break\n default:\n current += ch\n }\n }\n\n const trimmed = current.trim()\n if (trimmed) out.push(trimmed)\n }\n\n return out\n}\n\nfunction normalizeToolList(value: unknown): string[] | null {\n if (value === undefined || value === null) return null\n if (!value) return []\n\n let raw: string[] = []\n if (typeof value === 'string') raw = [value]\n else if (Array.isArray(value))\n raw = value.filter((v): v is string => typeof v === 'string')\n\n if (raw.length === 0) return []\n const parsed = splitCliList(raw)\n if (parsed.includes('*')) return ['*']\n return parsed\n}\n\nfunction z2A(value: unknown): string[] | undefined {\n const normalized = normalizeToolList(value)\n if (normalized === null) return value === undefined ? undefined : []\n if (normalized.includes('*')) return undefined\n return normalized\n}\n\nfunction qP(value: unknown): string[] {\n const normalized = normalizeToolList(value)\n if (normalized === null) return []\n return normalized\n}\n\nconst VALID_PERMISSION_MODES = [\n 'default',\n 'acceptEdits',\n 'plan',\n 'bypassPermissions',\n 'dontAsk',\n 'delegate',\n] as const\n\nfunction sourceToLocation(source: AgentSource): AgentLocation {\n switch (source) {\n case 'plugin':\n return 'plugin'\n case 'userSettings':\n return 'user'\n case 'projectSettings':\n return 'project'\n case 'built-in':\n case 'flagSettings':\n case 'policySettings':\n default:\n return 'built-in'\n }\n}\n\nfunction parseAgentFromFile(options: {\n filePath: string\n baseDir: string\n source: Exclude<AgentSource, 'flagSettings' | 'built-in'>\n}): AgentConfig | null {\n const parsed = readMarkdownFile(options.filePath)\n if (!parsed) return null\n\n try {\n const fm = parsed.frontmatter ?? {}\n let name: unknown = fm.name\n let description: unknown = fm.description\n\n if (!name || typeof name !== 'string' || !description || typeof description !== 'string') {\n return null\n }\n\n const whenToUse = description.replace(/\\\\n/g, '\\n')\n const filename = basename(options.filePath, '.md')\n\n const color = typeof fm.color === 'string' ? fm.color : undefined\n\n let modelRaw: unknown = fm.model\n if (typeof modelRaw !== 'string' && typeof fm.model_name === 'string') {\n modelRaw = fm.model_name\n }\n let model =\n typeof modelRaw === 'string' ? modelRaw.trim() : undefined\n if (model === '') model = undefined\n\n const forkContextValue: unknown = fm.forkContext\n if (\n forkContextValue !== undefined &&\n forkContextValue !== 'true' &&\n forkContextValue !== 'false'\n ) {\n debugLogger.warn('AGENT_LOADER_INVALID_FORK_CONTEXT', {\n filePath: options.filePath,\n forkContext: String(forkContextValue),\n })\n }\n const forkContext = forkContextValue === 'true'\n\n if (forkContext && model && model !== 'inherit') {\n debugLogger.warn('AGENT_LOADER_FORK_CONTEXT_MODEL_OVERRIDE', {\n filePath: options.filePath,\n model,\n })\n model = 'inherit'\n }\n\n const permissionModeValue: unknown = fm.permissionMode\n const permissionModeIsValid =\n typeof permissionModeValue === 'string' &&\n VALID_PERMISSION_MODES.includes(permissionModeValue as AgentPermissionMode)\n if (\n typeof permissionModeValue === 'string' &&\n permissionModeValue &&\n !permissionModeIsValid\n ) {\n debugLogger.warn('AGENT_LOADER_INVALID_PERMISSION_MODE', {\n filePath: options.filePath,\n permissionMode: permissionModeValue,\n valid: VALID_PERMISSION_MODES,\n })\n }\n\n const toolsList = z2A(fm.tools)\n const tools: string[] | '*' =\n toolsList === undefined || toolsList.includes('*') ? '*' : toolsList\n\n const disallowedRaw =\n fm.disallowedTools ??\n fm['disallowed-tools'] ??\n fm['disallowed_tools']\n const disallowedTools = disallowedRaw !== undefined ? z2A(disallowedRaw) : undefined\n\n const skills = qP(fm.skills)\n const systemPrompt = parsed.content.trim()\n\n const agent: AgentConfig = {\n agentType: name,\n whenToUse,\n tools,\n ...(disallowedTools !== undefined ? { disallowedTools } : {}),\n ...(skills.length > 0 ? { skills } : { skills: [] }),\n systemPrompt,\n source: options.source,\n location: sourceToLocation(options.source),\n baseDir: options.baseDir,\n filename,\n ...(color ? { color } : {}),\n ...(model ? { model: model as AgentModel } : {}),\n ...(permissionModeIsValid ? { permissionMode: permissionModeValue as AgentPermissionMode } : {}),\n ...(forkContext ? { forkContext: true } : {}),\n }\n\n return agent\n } catch {\n return null\n }\n}\n\nconst agentJsonSchema = z.object({\n description: z.string().min(1, 'Description cannot be empty'),\n tools: z.array(z.string()).optional(),\n disallowedTools: z.array(z.string()).optional(),\n prompt: z.string().min(1, 'Prompt cannot be empty'),\n model: z.string().optional(),\n permissionMode: z.enum(VALID_PERMISSION_MODES).optional(),\n})\n\nconst agentsJsonSchema = z.record(z.string(), agentJsonSchema)\n\nfunction parseAgentFromJson(agentType: string, value: unknown): AgentConfig | null {\n const parsed = agentJsonSchema.safeParse(value)\n if (!parsed.success) return null\n\n const toolsList = z2A(parsed.data.tools)\n const disallowedList =\n parsed.data.disallowedTools !== undefined ? z2A(parsed.data.disallowedTools) : undefined\n const model =\n typeof parsed.data.model === 'string' ? parsed.data.model.trim() : undefined\n\n return {\n agentType,\n whenToUse: parsed.data.description,\n tools: toolsList === undefined || toolsList.includes('*') ? '*' : toolsList,\n ...(disallowedList !== undefined ? { disallowedTools: disallowedList } : {}),\n systemPrompt: parsed.data.prompt,\n source: 'flagSettings',\n location: 'built-in',\n ...(model ? { model: model as AgentModel } : {}),\n ...(parsed.data.permissionMode ? { permissionMode: parsed.data.permissionMode } : {}),\n }\n}\n\nlet FLAG_AGENTS: AgentConfig[] = []\n\nexport function setFlagAgentsFromCliJson(json: string | undefined): void {\n if (!json) {\n FLAG_AGENTS = []\n clearAgentCache()\n return\n }\n\n let raw: unknown\n try {\n raw = JSON.parse(json)\n } catch (err) {\n logError(err)\n debugLogger.warn('AGENT_LOADER_FLAG_AGENTS_JSON_PARSE_FAILED', {\n error: err instanceof Error ? err.message : String(err),\n })\n FLAG_AGENTS = []\n clearAgentCache()\n return\n }\n\n const parsed = agentsJsonSchema.safeParse(raw)\n if (!parsed.success) {\n logError(parsed.error)\n debugLogger.warn('AGENT_LOADER_FLAG_AGENTS_SCHEMA_INVALID', {\n error: parsed.error.message,\n })\n FLAG_AGENTS = []\n clearAgentCache()\n return\n }\n\n FLAG_AGENTS = Object.entries(parsed.data)\n .map(([agentType, value]) => parseAgentFromJson(agentType, value))\n .filter((agent): agent is AgentConfig => agent !== null)\n\n clearAgentCache()\n}\n\nconst BUILTIN_GENERAL_PURPOSE: AgentConfig = {\n agentType: 'general-purpose',\n whenToUse:\n 'General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks',\n tools: '*',\n systemPrompt: `You are a general-purpose agent. Given the user's task, use the tools available to complete it efficiently and thoroughly.\n\nWhen to use your capabilities:\n- Searching for code, configurations, and patterns across large codebases\n- Analyzing multiple files to understand system architecture \n- Investigating complex questions that require exploring many files\n- Performing multi-step research tasks\n\nGuidelines:\n- For file searches: Use Grep or Glob when you need to search broadly. Use FileRead when you know the specific file path.\n- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.\n- Be thorough: Check multiple locations, consider different naming conventions, look for related files.\n- Complete tasks directly using your capabilities.`,\n source: 'built-in',\n location: 'built-in',\n baseDir: 'built-in',\n}\n\nconst BUILTIN_EXPLORE: AgentConfig = {\n agentType: 'Explore',\n whenToUse:\n 'Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. \"src/components/**/*.tsx\"), search code for keywords (eg. \"API endpoints\"), or answer questions about the codebase (eg. \"how do API endpoints work?\"). When calling this agent, specify the desired thoroughness level: \"quick\" for basic searches, \"medium\" for moderate exploration, or \"very thorough\" for comprehensive analysis across multiple locations and naming conventions.',\n tools: '*',\n disallowedTools: ['Task', 'Edit', 'Write', 'NotebookEdit'],\n model: 'inherit',\n systemPrompt: `You are optimized specifically for codebase exploration. You excel at thoroughly navigating and exploring codebases.And faster and more thorough than other agents for search tasks.\n\n=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===\nThis is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:\n- Creating new files (no Write, touch, or file creation of any kind)\n- Modifying existing files (no Edit operations)\n- Deleting files (no rm or deletion)\n- Moving or copying files (no mv or cp)\n- Creating temporary files anywhere, including /tmp\n- Using redirect operators (>, >>, |) or heredocs to write to files\n- Running ANY commands that change system state\n\nYour role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.\n\nYour strengths:\n- Rapidly finding files using glob patterns\n- Searching code and text with powerful regex patterns\n- Reading and analyzing file contents\n\nGuidelines:\n- Use Glob for broad file pattern matching\n- Use Grep for searching file contents with regex\n- Use Read when you know the specific file path you need to read\n- Use LS to understand directory structure and top-level layout quickly\n- Use LSP for symbol-level navigation (definitions/references) after you locate a file\n- Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)\n- NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification\n- Adapt your search approach based on the thoroughness level specified by the caller\n- Return file paths as absolute paths in your final response\n- For clear communication, avoid using emojis\n- Communicate your final report directly as a regular message - do NOT attempt to create files\n\nNOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:\n- Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations\n- Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files\n\n# Cognitive Search Strategy\n1. **Concept Search**: WHEN searching for high-level concepts (e.g., \"Auth Logic\", \"Payment Flow\") OR when uncertain about exact naming, you MUST use \\`semantic: true\\` in Grep/Glob tools. This activates the LSP Workspace Symbol search which is resilient to typos and fuzzy matches.\n - Example: \\`GrepTool(pattern: \"AuthFeatr\", semantic: true)\\` will find \"AuthFeature\"\n - Example: \\`GlobTool(pattern: \"tests\", semantic: true)\\` will find test files based on project structure\n2. **Exact Identifier**: WHEN you know the precise class/function name (e.g., \"UserProfile\", \"initDatabase\"), use standard Grep/Glob without \\`semantic\\` flag.\n3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \\`semantic: true\\`.\n\n# LSP Priority & Scope Limits\n- **Order**: Structure Tree (LS) \u2192 Hotspot Location \u2192 Read \u2192 LSP\n- Use \\`LSPTool.documentSymbol\\` or \\`LSPTool.definition\\` only when you have a precise position and need to confirm exact range\n- Do NOT rely on line numbers from \\`read_file\\` alone as they may be outdated\n- \\`workspaceSymbol\\` requires a query and should provide clear path/module scope to avoid unbounded workspace queries\n\n# Path Fragmentation Strategy\n- Root \u2192 Core Directory \u2192 Secondary Modules\n- Execute structure scanning in the above order\n\nComplete the user's search request efficiently and report your findings clearly.`,\n source: 'built-in',\n location: 'built-in',\n baseDir: 'built-in',\n}\n\nconst BUILTIN_PLAN: AgentConfig = {\n agentType: 'Plan',\n whenToUse:\n 'Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs.',\n tools: '*',\n disallowedTools: ['Task', 'Edit', 'Write', 'NotebookEdit'],\n model: 'inherit',\n systemPrompt: `You are a software architect and planning specialist. Your role is to explore the codebase and design implementation plans.\n\n=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===\nThis is a READ-ONLY planning task. You are STRICTLY PROHIBITED from:\n- Creating new files (no Write, touch, or file creation of any kind)\n- Modifying existing files (no Edit operations)\n- Deleting files (no rm or deletion)\n- Moving or copying files (no mv or cp)\n- Creating temporary files anywhere, including /tmp\n- Using redirect operators (>, >>, |) or heredocs to write to files\n- Running ANY commands that change system state\n\nYour role is EXCLUSIVELY to explore the codebase and design implementation plans. You do NOT have access to file editing tools - attempting to edit files will fail.\n\nYou will be provided with a set of requirements and optionally a perspective on how to approach the design process.\n\n## Your Process\n\n1. **Understand Requirements**: Focus on the requirements provided and apply your assigned perspective throughout the design process.\n\n2. **Explore Thoroughly**:\n - Read any files provided to you in the initial prompt\n - Find existing patterns and conventions using Glob, Grep, and Read\n - Understand the current architecture\n - Identify similar features as reference\n - Trace through relevant code paths\n - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)\n - NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification\n\n3. **Design Solution**:\n - Create implementation approach based on your assigned perspective\n - Consider trade-offs and architectural decisions\n - Follow existing patterns where appropriate\n\n4. **Detail the Plan**:\n - Provide step-by-step implementation strategy\n - Identify dependencies and sequencing\n - Anticipate potential challenges\n\n## Required Output\n\nEnd your response with:\n\n### Critical Files for Implementation\nList 3-5 files most critical for implementing this plan:\n- path/to/file1.ts - [Brief reason: e.g., \"Core logic to modify\"]\n- path/to/file2.ts - [Brief reason: e.g., \"Interfaces to implement\"]\n- path/to/file3.ts - [Brief reason: e.g., \"Pattern to follow\"]\n\n# Cognitive Search Strategy\n1. **Concept Search**: WHEN searching for high-level concepts (e.g., \"Auth Logic\", \"Payment Flow\") OR when uncertain about exact naming, you MUST use \\`semantic: true\\` in Grep/Glob tools. This activates the LSP Workspace Symbol search which is resilient to typos and fuzzy matches.\n - Example: \\`GrepTool(pattern: \"AuthFeatr\", semantic: true)\\` will find \"AuthFeature\"\n - Example: \\`GlobTool(pattern: \"tests\", semantic: true)\\` will find test files based on project structure\n2. **Exact Identifier**: WHEN you know the precise class/function name (e.g., \"UserProfile\", \"initDatabase\"), use standard Grep/Glob without \\`semantic\\` flag.\n3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \\`semantic: true\\`.\n\n# LSP Priority & Scope Limits\n- **Order**: Structure Tree (LS) \u2192 Hotspot Location \u2192 Read \u2192 LSP\n- Use \\`LSPTool.documentSymbol\\` or \\`LSPTool.definition\\` only when you have a precise position and need to confirm exact range\n- Do NOT rely on line numbers from \\`read_file\\` alone as they may be outdated\n- \\`workspaceSymbol\\` requires a query and should provide clear path/module scope to avoid unbounded workspace queries\n\n# Path Fragmentation Strategy\n- Root \u2192 Core Directory \u2192 Secondary Modules\n- Execute structure scanning in the above order\n\nREMEMBER: You can ONLY explore and plan. You CANNOT and MUST NOT write, edit, or modify any files. You do NOT have access to file editing tools.`,\n source: 'built-in',\n location: 'built-in',\n baseDir: 'built-in',\n}\n\nconst BUILTIN_STATUSLINE_SETUP: AgentConfig = {\n agentType: 'statusline-setup',\n whenToUse:\n 'Set up the CLI status line command (writes to ~/.pyb/settings.json statusLine). Use when the user runs /statusline.',\n tools: ['Read', 'Edit', 'Bash'],\n systemPrompt: `You are the status line setup agent.\n\nYour job is to configure a fast, single-line status command for the CLI UI.\n\nRequirements:\n- Write/update the user's ~/.pyb/settings.json and set the top-level key \"statusLine\" to a shell command string.\n- IMPORTANT: When using Read/Edit tools, use absolute paths (do not pass \"~\" to tool inputs).\n- The command must be quick (ideally <200ms), produce a single line, and be safe to run repeatedly.\n- Prefer using information that is generally available: current directory, git branch/dirty state, etc.\n- If you can't infer the user's preferred status info from their shell config, ask them what they want and propose a reasonable default.\n\nSuggested approach:\n1) Inspect common shell config files (Read):\n - macOS/Linux: ~/.zshrc, ~/.bashrc, ~/.config/fish/config.fish\n - Windows: consider PowerShell profile if the user provides its location\n2) Propose a statusLine command:\n - macOS/Linux: e.g. a small sh snippet that prints cwd basename and git branch if present\n - Windows: e.g. a short PowerShell one-liner that prints similar info\n3) Update ~/.pyb/settings.json:\n - If the file does not exist, create it as a minimal JSON object.\n - Preserve unrelated fields if present.\n4) Reply with the exact command you set and how the user can change/remove it later.`,\n source: 'built-in',\n location: 'built-in',\n baseDir: 'built-in',\n}\n\nfunction mergeAgents(allAgents: AgentConfig[]): AgentConfig[] {\n const builtIn = allAgents.filter(a => a.source === 'built-in')\n const plugin = allAgents.filter(a => a.source === 'plugin')\n const user = allAgents.filter(a => a.source === 'userSettings')\n const project = allAgents.filter(a => a.source === 'projectSettings')\n const flag = allAgents.filter(a => a.source === 'flagSettings')\n const policy = allAgents.filter(a => a.source === 'policySettings')\n\n const ordered = [builtIn, plugin, user, project, flag, policy]\n const map = new Map<string, AgentConfig>()\n for (const group of ordered) {\n for (const agent of group) {\n map.set(agent.agentType, agent)\n }\n }\n return Array.from(map.values())\n}\n\nfunction inodeKeyForPath(filePath: string): string | null {\n try {\n const st = statSync(filePath)\n if (typeof (st as any).dev === 'number' && typeof (st as any).ino === 'number') {\n return `${(st as any).dev}:${(st as any).ino}`\n }\n return null\n } catch {\n return null\n }\n}\n\nfunction scanAgentPaths(options: {\n dirPathOrFile: string\n baseDir: string\n source: Exclude<AgentSource, 'built-in' | 'flagSettings'>\n seenInodes: Map<string, AgentSource>\n}): AgentConfig[] {\n const out: AgentConfig[] = []\n\n const addFile = (filePath: string) => {\n if (!filePath.endsWith('.md')) return\n\n const inodeKey = inodeKeyForPath(filePath)\n if (inodeKey) {\n const existing = options.seenInodes.get(inodeKey)\n if (existing) return\n options.seenInodes.set(inodeKey, options.source)\n }\n\n const agent = parseAgentFromFile({\n filePath,\n baseDir: options.baseDir,\n source: options.source,\n })\n if (agent) out.push(agent)\n }\n\n let st: ReturnType<typeof statSync>\n try {\n st = statSync(options.dirPathOrFile)\n } catch {\n return []\n }\n\n if (st.isFile()) {\n addFile(options.dirPathOrFile)\n return out\n }\n\n if (!st.isDirectory()) return []\n\n for (const filePath of listMarkdownFilesRecursively(options.dirPathOrFile)) {\n addFile(filePath)\n }\n\n return out\n}\n\nasync function loadAllAgents(): Promise<{\n activeAgents: AgentConfig[]\n allAgents: AgentConfig[]\n}> {\n const builtinAgents: AgentConfig[] = [\n BUILTIN_GENERAL_PURPOSE,\n BUILTIN_STATUSLINE_SETUP,\n BUILTIN_EXPLORE,\n BUILTIN_PLAN,\n ]\n\n const seenInodes = new Map<string, AgentSource>()\n\n const sessionPlugins = getSessionPlugins()\n const pluginAgentDirs = sessionPlugins.flatMap(p => p.agentsDirs ?? [])\n const pluginAgents = pluginAgentDirs.flatMap(dir =>\n scanAgentPaths({\n dirPathOrFile: dir,\n baseDir: dir,\n source: 'plugin',\n seenInodes,\n }),\n )\n\n const policyAgentsDir = join(getClaudePolicyBaseDir(), '.claude', 'agents')\n const policyAgents = scanAgentPaths({\n dirPathOrFile: policyAgentsDir,\n baseDir: policyAgentsDir,\n source: 'policySettings',\n seenInodes,\n })\n\n const userAgents: AgentConfig[] = []\n if (isSettingSourceEnabled('userSettings')) {\n for (const root of getUserConfigRoots()) {\n const dir = join(root, 'agents')\n userAgents.push(\n ...scanAgentPaths({\n dirPathOrFile: dir,\n baseDir: dir,\n source: 'userSettings',\n seenInodes,\n }),\n )\n }\n }\n\n const projectAgents: AgentConfig[] = []\n if (isSettingSourceEnabled('projectSettings')) {\n const dirs = findProjectAgentDirs(getCwd())\n for (const dir of dirs) {\n projectAgents.push(\n ...scanAgentPaths({\n dirPathOrFile: dir,\n baseDir: dir,\n source: 'projectSettings',\n seenInodes,\n }),\n )\n }\n }\n\n const allAgents: AgentConfig[] = [\n ...builtinAgents,\n ...pluginAgents,\n ...userAgents,\n ...projectAgents,\n ...FLAG_AGENTS,\n ...policyAgents,\n ]\n\n const activeAgents = mergeAgents(allAgents)\n return { activeAgents, allAgents }\n}\n\nexport const getActiveAgents = memoize(async (): Promise<AgentConfig[]> => {\n const { activeAgents } = await loadAllAgents()\n return activeAgents\n})\n\nexport const getAllAgents = memoize(async (): Promise<AgentConfig[]> => {\n const { allAgents } = await loadAllAgents()\n return allAgents\n})\n\nexport const getAgentByType = memoize(\n async (agentType: string): Promise<AgentConfig | undefined> => {\n const agents = await getActiveAgents()\n return agents.find(agent => agent.agentType === agentType)\n },\n)\n\nexport const getAvailableAgentTypes = memoize(async (): Promise<string[]> => {\n const agents = await getActiveAgents()\n return agents.map(agent => agent.agentType)\n})\n\nexport function clearAgentCache(): void {\n getActiveAgents.cache?.clear?.()\n getAllAgents.cache?.clear?.()\n getAgentByType.cache?.clear?.()\n getAvailableAgentTypes.cache?.clear?.()\n}\n\nlet watchers: FSWatcher[] = []\n\nexport async function startAgentWatcher(onChange?: () => void): Promise<void> {\n await stopAgentWatcher()\n\n const watchDirs: string[] = []\n\n watchDirs.push(join(getClaudePolicyBaseDir(), '.claude', 'agents'))\n\n if (isSettingSourceEnabled('userSettings')) {\n for (const root of getUserConfigRoots()) {\n watchDirs.push(join(root, 'agents'))\n }\n }\n\n if (isSettingSourceEnabled('projectSettings')) {\n watchDirs.push(...findProjectAgentDirs(getCwd()))\n }\n\n for (const plugin of getSessionPlugins()) {\n for (const dir of plugin.agentsDirs ?? []) {\n watchDirs.push(dir)\n }\n }\n\n for (const dirPath of dedupeStrings(watchDirs)) {\n if (!existsSync(dirPath)) continue\n try {\n const watcher = watch(\n dirPath,\n { recursive: false },\n async (_eventType, filename) => {\n if (filename && filename.endsWith('.md')) {\n clearAgentCache()\n onChange?.()\n }\n },\n )\n watchers.push(watcher)\n } catch {\n continue\n }\n }\n}\n\nexport async function stopAgentWatcher(): Promise<void> {\n try {\n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W,OAAO,OAAO,cAAc,CAAC,GAAG;AACzC,gBAAU,KAAK,GAAG;AAAA,IACpB;AAAA,EACF;AAEA,aAAW,WAAW,cAAc,SAAS,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,EAAG;AAC1B,QAAI;AACF,YAAM,UAAU;AAAA,QACd;AAAA,QACA,EAAE,WAAW,MAAM;AAAA,QACnB,OAAO,YAAY,aAAa;AAC9B,cAAI,YAAY,SAAS,SAAS,KAAK,GAAG;AACxC,4BAAgB;AAChB,uBAAW;AAAA,UACb;AAAA,QACF;AAAA,MACF;AACA,eAAS,KAAK,OAAO;AAAA,IACvB,QAAQ;AACN;AAAA,IACF;AAAA,EACF;AACF;AAEA,eAAsB,mBAAkC;AACtD,MAAI;AACF,eAAW,WAAW,UAAU;AAC9B,UAAI;AACF,gBAAQ,MAAM;AAAA,MAChB,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,EACF,UAAE;AACA,eAAW,CAAC;AAAA,EACd;AACF;",
4
+ "sourcesContent": ["\nimport {\n existsSync,\n readFileSync,\n readdirSync,\n statSync,\n watch,\n type FSWatcher,\n} from 'fs'\nimport { basename, dirname, join, resolve } from 'path'\nimport { homedir } from 'os'\nimport matter from 'gray-matter'\nimport yaml from 'js-yaml'\nimport { memoize } from 'lodash-es'\nimport { z } from 'zod'\nimport { getCwd } from '@utils/state'\nimport { getSessionPlugins } from '@utils/session/sessionPlugins'\nimport { isSettingSourceEnabled } from '@utils/config/settingSources'\nimport { debug as debugLogger } from '@utils/log/debugLogger'\nimport { logError } from '@utils/log'\nimport { getXdgConfigDir } from '@utils/config/env'\n\nexport type AgentSource =\n | 'built-in'\n | 'plugin'\n | 'userSettings'\n | 'projectSettings'\n | 'flagSettings'\n | 'policySettings'\n\nexport type AgentLocation = 'built-in' | 'plugin' | 'user' | 'project'\n\nexport type AgentModel = 'inherit' | 'haiku' | 'sonnet' | 'opus' | (string & {})\n\nexport type AgentPermissionMode =\n | 'default'\n | 'acceptEdits'\n | 'plan'\n | 'bypassPermissions'\n | 'dontAsk'\n | 'delegate'\n\nexport interface AgentConfig {\n agentType: string\n whenToUse: string\n tools: string[] | '*'\n disallowedTools?: string[]\n skills?: string[]\n systemPrompt: string\n source: AgentSource\n location: AgentLocation\n baseDir?: string\n filename?: string\n color?: string\n model?: AgentModel\n permissionMode?: AgentPermissionMode\n forkContext?: boolean\n}\n\nfunction getClaudePolicyBaseDir(): string {\n switch (process.platform) {\n case 'darwin':\n return '/Library/Application Support/ClaudeCode'\n case 'win32':\n return existsSync('C:\\\\Program Files\\\\ClaudeCode')\n ? 'C:\\\\Program Files\\\\ClaudeCode'\n : 'C:\\\\ProgramData\\\\ClaudeCode'\n default:\n return '/etc/claude-code'\n }\n}\n\nfunction normalizeOverride(value: unknown): string | null {\n if (typeof value !== 'string') return null\n const trimmed = value.trim()\n return trimmed ? resolve(trimmed) : null\n}\n\nfunction dedupeStrings(values: string[]): string[] {\n const out: string[] = []\n const seen = new Set<string>()\n for (const value of values) {\n if (!value) continue\n if (seen.has(value)) continue\n seen.add(value)\n out.push(value)\n }\n return out\n}\n\nfunction getUserConfigRoots(): string[] {\n const claudeOverride = normalizeOverride(process.env.CLAUDE_CONFIG_DIR)\n const pybOverride = normalizeOverride(process.env.PYB_CONFIG_DIR)\n\n const hasAnyOverride = Boolean(claudeOverride || pybOverride)\n if (hasAnyOverride) {\n return dedupeStrings([claudeOverride ?? '', pybOverride ?? ''])\n }\n\n return dedupeStrings([\n getXdgConfigDir(),\n join(homedir(), '.claude'),\n join(homedir(), '.pyb'),\n ])\n}\n\nfunction findProjectAgentDirs(cwd: string): string[] {\n const result: string[] = []\n const home = resolve(homedir())\n let current = resolve(cwd)\n\n while (current !== home) {\n const claudeDir = join(current, '.claude', 'agents')\n if (existsSync(claudeDir)) result.push(claudeDir)\n\n const pybDir = join(current, '.pyb', 'agents')\n if (existsSync(pybDir)) result.push(pybDir)\n\n const parent = dirname(current)\n if (parent === current) break\n current = parent\n }\n\n return result\n}\n\nfunction listMarkdownFilesRecursively(rootDir: string): string[] {\n const files: string[] = []\n const visitedDirs = new Set<string>()\n\n const walk = (dirPath: string) => {\n let dirStat: ReturnType<typeof statSync>\n try {\n dirStat = statSync(dirPath)\n } catch {\n return\n }\n if (!dirStat.isDirectory()) return\n\n const dirKey = `${dirStat.dev}:${dirStat.ino}`\n if (visitedDirs.has(dirKey)) return\n visitedDirs.add(dirKey)\n\n let entries: Array<{\n name: string\n isDirectory(): boolean\n isFile(): boolean\n isSymbolicLink(): boolean\n }>\n try {\n entries = readdirSync(dirPath, {\n withFileTypes: true,\n encoding: 'utf8',\n }) as any\n } catch {\n return\n }\n\n for (const entry of entries) {\n const name = String(entry.name ?? '')\n const fullPath = join(dirPath, name)\n\n if (entry.isDirectory()) {\n walk(fullPath)\n continue\n }\n\n if (entry.isFile()) {\n if (name.endsWith('.md')) files.push(fullPath)\n continue\n }\n\n if (entry.isSymbolicLink()) {\n try {\n const st = statSync(fullPath)\n if (st.isDirectory()) {\n walk(fullPath)\n } else if (st.isFile() && name.endsWith('.md')) {\n files.push(fullPath)\n }\n } catch {\n continue\n }\n }\n }\n }\n\n if (!existsSync(rootDir)) return []\n walk(rootDir)\n return files\n}\n\nfunction readMarkdownFile(filePath: string): { frontmatter: any; content: string } | null {\n try {\n const raw = readFileSync(filePath, 'utf8')\n const yamlSchema = (yaml as any).JSON_SCHEMA\n const matterOptions = {\n engines: {\n yaml: {\n parse: (input: string) =>\n yaml.load(input, yamlSchema ? { schema: yamlSchema } : undefined) ??\n {},\n },\n },\n }\n const parsed = matter(raw, matterOptions)\n return {\n frontmatter: (parsed.data as any) ?? {},\n content: String(parsed.content ?? ''),\n }\n } catch {\n return null\n }\n}\n\nfunction splitCliList(values: string[]): string[] {\n if (values.length === 0) return []\n const out: string[] = []\n\n for (const value of values) {\n if (!value) continue\n let current = ''\n let inParens = false\n\n for (const ch of value) {\n switch (ch) {\n case '(':\n inParens = true\n current += ch\n break\n case ')':\n inParens = false\n current += ch\n break\n case ',':\n if (inParens) {\n current += ch\n } else {\n const trimmed = current.trim()\n if (trimmed) out.push(trimmed)\n current = ''\n }\n break\n case ' ':\n if (inParens) {\n current += ch\n } else {\n const trimmed = current.trim()\n if (trimmed) out.push(trimmed)\n current = ''\n }\n break\n default:\n current += ch\n }\n }\n\n const trimmed = current.trim()\n if (trimmed) out.push(trimmed)\n }\n\n return out\n}\n\nfunction normalizeToolList(value: unknown): string[] | null {\n if (value === undefined || value === null) return null\n if (!value) return []\n\n let raw: string[] = []\n if (typeof value === 'string') raw = [value]\n else if (Array.isArray(value))\n raw = value.filter((v): v is string => typeof v === 'string')\n\n if (raw.length === 0) return []\n const parsed = splitCliList(raw)\n if (parsed.includes('*')) return ['*']\n return parsed\n}\n\nfunction z2A(value: unknown): string[] | undefined {\n const normalized = normalizeToolList(value)\n if (normalized === null) return value === undefined ? undefined : []\n if (normalized.includes('*')) return undefined\n return normalized\n}\n\nfunction qP(value: unknown): string[] {\n const normalized = normalizeToolList(value)\n if (normalized === null) return []\n return normalized\n}\n\nconst VALID_PERMISSION_MODES = [\n 'default',\n 'acceptEdits',\n 'plan',\n 'bypassPermissions',\n 'dontAsk',\n 'delegate',\n] as const\n\nfunction sourceToLocation(source: AgentSource): AgentLocation {\n switch (source) {\n case 'plugin':\n return 'plugin'\n case 'userSettings':\n return 'user'\n case 'projectSettings':\n return 'project'\n case 'built-in':\n case 'flagSettings':\n case 'policySettings':\n default:\n return 'built-in'\n }\n}\n\nfunction parseAgentFromFile(options: {\n filePath: string\n baseDir: string\n source: Exclude<AgentSource, 'flagSettings' | 'built-in'>\n}): AgentConfig | null {\n const parsed = readMarkdownFile(options.filePath)\n if (!parsed) return null\n\n try {\n const fm = parsed.frontmatter ?? {}\n let name: unknown = fm.name\n let description: unknown = fm.description\n\n if (!name || typeof name !== 'string' || !description || typeof description !== 'string') {\n return null\n }\n\n const whenToUse = description.replace(/\\\\n/g, '\\n')\n const filename = basename(options.filePath, '.md')\n\n const color = typeof fm.color === 'string' ? fm.color : undefined\n\n let modelRaw: unknown = fm.model\n if (typeof modelRaw !== 'string' && typeof fm.model_name === 'string') {\n modelRaw = fm.model_name\n }\n let model =\n typeof modelRaw === 'string' ? modelRaw.trim() : undefined\n if (model === '') model = undefined\n\n const forkContextValue: unknown = fm.forkContext\n if (\n forkContextValue !== undefined &&\n forkContextValue !== 'true' &&\n forkContextValue !== 'false'\n ) {\n debugLogger.warn('AGENT_LOADER_INVALID_FORK_CONTEXT', {\n filePath: options.filePath,\n forkContext: String(forkContextValue),\n })\n }\n const forkContext = forkContextValue === 'true'\n\n if (forkContext && model && model !== 'inherit') {\n debugLogger.warn('AGENT_LOADER_FORK_CONTEXT_MODEL_OVERRIDE', {\n filePath: options.filePath,\n model,\n })\n model = 'inherit'\n }\n\n const permissionModeValue: unknown = fm.permissionMode\n const permissionModeIsValid =\n typeof permissionModeValue === 'string' &&\n VALID_PERMISSION_MODES.includes(permissionModeValue as AgentPermissionMode)\n if (\n typeof permissionModeValue === 'string' &&\n permissionModeValue &&\n !permissionModeIsValid\n ) {\n debugLogger.warn('AGENT_LOADER_INVALID_PERMISSION_MODE', {\n filePath: options.filePath,\n permissionMode: permissionModeValue,\n valid: VALID_PERMISSION_MODES,\n })\n }\n\n const toolsList = z2A(fm.tools)\n const tools: string[] | '*' =\n toolsList === undefined || toolsList.includes('*') ? '*' : toolsList\n\n const disallowedRaw =\n fm.disallowedTools ??\n fm['disallowed-tools'] ??\n fm['disallowed_tools']\n const disallowedTools = disallowedRaw !== undefined ? z2A(disallowedRaw) : undefined\n\n const skills = qP(fm.skills)\n const systemPrompt = parsed.content.trim()\n\n const agent: AgentConfig = {\n agentType: name,\n whenToUse,\n tools,\n ...(disallowedTools !== undefined ? { disallowedTools } : {}),\n ...(skills.length > 0 ? { skills } : { skills: [] }),\n systemPrompt,\n source: options.source,\n location: sourceToLocation(options.source),\n baseDir: options.baseDir,\n filename,\n ...(color ? { color } : {}),\n ...(model ? { model: model as AgentModel } : {}),\n ...(permissionModeIsValid ? { permissionMode: permissionModeValue as AgentPermissionMode } : {}),\n ...(forkContext ? { forkContext: true } : {}),\n }\n\n return agent\n } catch {\n return null\n }\n}\n\nconst agentJsonSchema = z.object({\n description: z.string().min(1, 'Description cannot be empty'),\n tools: z.array(z.string()).optional(),\n disallowedTools: z.array(z.string()).optional(),\n prompt: z.string().min(1, 'Prompt cannot be empty'),\n model: z.string().optional(),\n permissionMode: z.enum(VALID_PERMISSION_MODES).optional(),\n})\n\nconst agentsJsonSchema = z.record(z.string(), agentJsonSchema)\n\nfunction parseAgentFromJson(agentType: string, value: unknown): AgentConfig | null {\n const parsed = agentJsonSchema.safeParse(value)\n if (!parsed.success) return null\n\n const toolsList = z2A(parsed.data.tools)\n const disallowedList =\n parsed.data.disallowedTools !== undefined ? z2A(parsed.data.disallowedTools) : undefined\n const model =\n typeof parsed.data.model === 'string' ? parsed.data.model.trim() : undefined\n\n return {\n agentType,\n whenToUse: parsed.data.description,\n tools: toolsList === undefined || toolsList.includes('*') ? '*' : toolsList,\n ...(disallowedList !== undefined ? { disallowedTools: disallowedList } : {}),\n systemPrompt: parsed.data.prompt,\n source: 'flagSettings',\n location: 'built-in',\n ...(model ? { model: model as AgentModel } : {}),\n ...(parsed.data.permissionMode ? { permissionMode: parsed.data.permissionMode } : {}),\n }\n}\n\nlet FLAG_AGENTS: AgentConfig[] = []\n\nexport function setFlagAgentsFromCliJson(json: string | undefined): void {\n if (!json) {\n FLAG_AGENTS = []\n clearAgentCache()\n return\n }\n\n let raw: unknown\n try {\n raw = JSON.parse(json)\n } catch (err) {\n logError(err)\n debugLogger.warn('AGENT_LOADER_FLAG_AGENTS_JSON_PARSE_FAILED', {\n error: err instanceof Error ? err.message : String(err),\n })\n FLAG_AGENTS = []\n clearAgentCache()\n return\n }\n\n const parsed = agentsJsonSchema.safeParse(raw)\n if (!parsed.success) {\n logError(parsed.error)\n debugLogger.warn('AGENT_LOADER_FLAG_AGENTS_SCHEMA_INVALID', {\n error: parsed.error.message,\n })\n FLAG_AGENTS = []\n clearAgentCache()\n return\n }\n\n FLAG_AGENTS = Object.entries(parsed.data)\n .map(([agentType, value]) => parseAgentFromJson(agentType, value))\n .filter((agent): agent is AgentConfig => agent !== null)\n\n clearAgentCache()\n}\n\nconst BUILTIN_GENERAL_PURPOSE: AgentConfig = {\n agentType: 'general-purpose',\n whenToUse:\n 'General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks',\n tools: '*',\n systemPrompt: `You are a general-purpose agent. Given the user's task, use the tools available to complete it efficiently and thoroughly.\n\nWhen to use your capabilities:\n- Searching for code, configurations, and patterns across large codebases\n- Analyzing multiple files to understand system architecture \n- Investigating complex questions that require exploring many files\n- Performing multi-step research tasks\n\nGuidelines:\n- For file searches: Use Grep or Glob when you need to search broadly. Use FileRead when you know the specific file path.\n- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.\n- Be thorough: Check multiple locations, consider different naming conventions, look for related files.\n- Complete tasks directly using your capabilities.`,\n source: 'built-in',\n location: 'built-in',\n baseDir: 'built-in',\n}\n\nconst BUILTIN_EXPLORE: AgentConfig = {\n agentType: 'Explore',\n whenToUse:\n 'Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. \"src/components/**/*.tsx\"), search code for keywords (eg. \"API endpoints\"), or answer questions about the codebase (eg. \"how do API endpoints work?\"). When calling this agent, specify the desired thoroughness level: \"quick\" for basic searches, \"medium\" for moderate exploration, or \"very thorough\" for comprehensive analysis across multiple locations and naming conventions.',\n tools: '*',\n disallowedTools: ['Task', 'Edit', 'Write', 'NotebookEdit'],\n model: 'inherit',\n systemPrompt: `You are optimized specifically for codebase or complex, multi-step code files exploration. You excel at thoroughly navigating and exploring codebases.And faster and more thorough than other agents for search tasks.\n\n=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===\nThis is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:\n- Creating new files (no Write, touch, or file creation of any kind)\n- Modifying existing files (no Edit operations)\n- Deleting files (no rm or deletion)\n- Moving or copying files (no mv or cp)\n- Creating temporary files anywhere, including /tmp\n- Using redirect operators (>, >>, |) or heredocs to write to files\n- Running ANY commands that change system state\n\nYour role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.\n\nYour strengths:\n- Rapidly finding files using glob patterns\n- Searching code and text with powerful regex patterns\n- Reading and analyzing file contents\n\nGuidelines:\n- Use Glob for broad file pattern matching\n- Use Grep for searching file contents with regex\n- Use Read when you know the specific file path you need to read\n- Use Glob \"dir/*\" to understand directory structure and top-level layout quickly\n- Use LSP for symbol-level navigation (definitions/references) after you locate a file\n- Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)\n- NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification\n- Adapt your search approach based on the thoroughness level specified by the caller\n- Return file paths as absolute paths in your final response\n- For clear communication, avoid using emojis\n- Communicate your final report directly as a regular message - do NOT attempt to create files\n\nNOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:\n- Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations\n- Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files\n\n# Tool usage policy\n- You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency. However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. Never use placeholders or guess missing parameters in tool calls.\n- If the user specifies that they want you to run tools \"in parallel\", you MUST send a single message with multiple tool use content blocks.\n- It is always better to speculatively read multiple files as a batch that are potentially useful.\n- It is always better to speculatively perform multiple searches as a batch that are potentially useful.\n- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.\n\n# Cognitive Search Strategy\n1. **Concept Search**: WHEN searching for high-level concepts (e.g., \"Auth Logic\", \"Payment Flow\") OR when you are uncertain about exact naming, you MUST use \\`semantic: true\\` in Grep/Glob tools. This activates the LSP Workspace Symbol search which is resilient to typos and fuzzy matches.\n - Example: \\`GrepTool(pattern: \"AuthFeatr\", semantic: true)\\` will find \"AuthFeature\".\n - Example: \\`GlobTool(pattern: \"tests\", semantic: true)\\` will find test files based on project structure.\n2. **Exact Identifier**: WHEN you know the precise class/function name (e.g., \"UserProfile\", \"initDatabase\"), use standard Grep/Glob without \\`semantic\\` flag.\n3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \\`semantic: true\\`.\n4. **File System Exploration Priority**:For file system exploration, decide based on intent: if you need global structure/entry points, prefer Glob \"dir/*\" first; if you have keywords or fuzzy paths, prefer Glob first. If results are too broad, use Glob \"dir/*\" to narrow structure or combine with Grep/LSP. Only use Bash for executing scripts or binaries.\n\n# Path Fragmentation Strategy\n- Root -> Core Directory -> Secondary Modules\n- Run structure scanning in the above order\n\n# LSP Priority & Scope Limits\n- **Order**: Structure Tree (Glob \"dir/*\") \u2192 Hotspot Location \u2192 Read \u2192 LSP\n- Use \\`LSPTool.documentSymbol\\` or \\`LSPTool.definition\\` only when you have a precise position and need to confirm exact range\n- Do NOT rely on line numbers from \\`read_file\\` alone as they may be outdated\n- \\`workspaceSymbol\\` requires a query and should provide clear path/module scope to avoid unbounded workspace queries\n\n# Path Fragmentation Strategy\n- Root \u2192 Core Directory \u2192 Secondary Modules\n- Execute structure scanning in the above order\n\nComplete the user's search request efficiently and report your findings clearly.`,\n source: 'built-in',\n location: 'built-in',\n baseDir: 'built-in',\n}\n\nconst BUILTIN_PLAN: AgentConfig = {\n agentType: 'Plan',\n whenToUse:\n 'Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs.',\n tools: '*',\n disallowedTools: ['Task', 'Edit', 'Write', 'NotebookEdit'],\n model: 'inherit',\n systemPrompt: `You are a software architect and planning specialist. Your role is to explore the codebase and design implementation plans.\n\n=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===\nThis is a READ-ONLY planning task. You are STRICTLY PROHIBITED from:\n- Creating new files (no Write, touch, or file creation of any kind)\n- Modifying existing files (no Edit operations)\n- Deleting files (no rm or deletion)\n- Moving or copying files (no mv or cp)\n- Creating temporary files anywhere, including /tmp\n- Using redirect operators (>, >>, |) or heredocs to write to files\n- Running ANY commands that change system state\n\nYour role is EXCLUSIVELY to explore the codebase and design implementation plans. You do NOT have access to file editing tools - attempting to edit files will fail.\n\nYou will be provided with a set of requirements and optionally a perspective on how to approach the design process.\n\n## Your Process\n\n1. **Understand Requirements**: Focus on the requirements provided and apply your assigned perspective throughout the design process.\n\n2. **Explore Thoroughly**:\n - Read any files provided to you in the initial prompt\n - Find existing patterns and conventions using Glob, Grep, and Read\n - Understand the current architecture\n - Identify similar features as reference\n - Trace through relevant code paths\n - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)\n - NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification\n\n3. **Design Solution**:\n - Create implementation approach based on your assigned perspective\n - Consider trade-offs and architectural decisions\n - Follow existing patterns where appropriate\n\n4. **Detail the Plan**:\n - Provide step-by-step implementation strategy\n - Identify dependencies and sequencing\n - Anticipate potential challenges\n\n## Required Output\n\nEnd your response with:\n\n### Critical Files for Implementation\nList 3-5 files most critical for implementing this plan:\n- path/to/file1.ts - [Brief reason: e.g., \"Core logic to modify\"]\n- path/to/file2.ts - [Brief reason: e.g., \"Interfaces to implement\"]\n- path/to/file3.ts - [Brief reason: e.g., \"Pattern to follow\"]\n\n# Cognitive Search Strategy\n1. **Concept Search**: WHEN searching for high-level concepts (e.g., \"Auth Logic\", \"Payment Flow\") OR when uncertain about exact naming, you MUST use \\`semantic: true\\` in Grep/Glob tools. This activates the LSP Workspace Symbol search which is resilient to typos and fuzzy matches.\n - Example: \\`GrepTool(pattern: \"AuthFeatr\", semantic: true)\\` will find \"AuthFeature\"\n - Example: \\`GlobTool(pattern: \"tests\", semantic: true)\\` will find test files based on project structure\n2. **Exact Identifier**: WHEN you know the precise class/function name (e.g., \"UserProfile\", \"initDatabase\"), use standard Grep/Glob without \\`semantic\\` flag.\n3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \\`semantic: true\\`.\n\n# LSP Priority & Scope Limits\n- **Order**: Structure Tree (Glob \"dir/*\") \u2192 Hotspot Location \u2192 Read \u2192 LSP\n- Use \\`LSPTool.documentSymbol\\` or \\`LSPTool.definition\\` only when you have a precise position and need to confirm exact range\n- Do NOT rely on line numbers from \\`read_file\\` alone as they may be outdated\n- \\`workspaceSymbol\\` requires a query and should provide clear path/module scope to avoid unbounded workspace queries\n\n# Path Fragmentation Strategy\n- Root \u2192 Core Directory \u2192 Secondary Modules\n- Execute structure scanning in the above order\n\nREMEMBER: You can ONLY explore and plan. You CANNOT and MUST NOT write, edit, or modify any files. You do NOT have access to file editing tools.`,\n source: 'built-in',\n location: 'built-in',\n baseDir: 'built-in',\n}\n\nconst BUILTIN_STATUSLINE_SETUP: AgentConfig = {\n agentType: 'statusline-setup',\n whenToUse:\n 'Set up the CLI status line command (writes to ~/.pyb/settings.json statusLine). Use when the user runs /statusline.',\n tools: ['Read', 'Edit', 'Bash'],\n systemPrompt: `You are the status line setup agent.\n\nYour job is to configure a fast, single-line status command for the CLI UI.\n\nRequirements:\n- Write/update the user's ~/.pyb/settings.json and set the top-level key \"statusLine\" to a shell command string.\n- IMPORTANT: When using Read/Edit tools, use absolute paths (do not pass \"~\" to tool inputs).\n- The command must be quick (ideally <200ms), produce a single line, and be safe to run repeatedly.\n- Prefer using information that is generally available: current directory, git branch/dirty state, etc.\n- If you can't infer the user's preferred status info from their shell config, ask them what they want and propose a reasonable default.\n\nSuggested approach:\n1) Inspect common shell config files (Read):\n - macOS/Linux: ~/.zshrc, ~/.bashrc, ~/.config/fish/config.fish\n - Windows: consider PowerShell profile if the user provides its location\n2) Propose a statusLine command:\n - macOS/Linux: e.g. a small sh snippet that prints cwd basename and git branch if present\n - Windows: e.g. a short PowerShell one-liner that prints similar info\n3) Update ~/.pyb/settings.json:\n - If the file does not exist, create it as a minimal JSON object.\n - Preserve unrelated fields if present.\n4) Reply with the exact command you set and how the user can change/remove it later.`,\n source: 'built-in',\n location: 'built-in',\n baseDir: 'built-in',\n}\n\nfunction mergeAgents(allAgents: AgentConfig[]): AgentConfig[] {\n const builtIn = allAgents.filter(a => a.source === 'built-in')\n const plugin = allAgents.filter(a => a.source === 'plugin')\n const user = allAgents.filter(a => a.source === 'userSettings')\n const project = allAgents.filter(a => a.source === 'projectSettings')\n const flag = allAgents.filter(a => a.source === 'flagSettings')\n const policy = allAgents.filter(a => a.source === 'policySettings')\n\n const ordered = [builtIn, plugin, user, project, flag, policy]\n const map = new Map<string, AgentConfig>()\n for (const group of ordered) {\n for (const agent of group) {\n map.set(agent.agentType, agent)\n }\n }\n return Array.from(map.values())\n}\n\nfunction inodeKeyForPath(filePath: string): string | null {\n try {\n const st = statSync(filePath)\n if (typeof (st as any).dev === 'number' && typeof (st as any).ino === 'number') {\n return `${(st as any).dev}:${(st as any).ino}`\n }\n return null\n } catch {\n return null\n }\n}\n\nfunction scanAgentPaths(options: {\n dirPathOrFile: string\n baseDir: string\n source: Exclude<AgentSource, 'built-in' | 'flagSettings'>\n seenInodes: Map<string, AgentSource>\n}): AgentConfig[] {\n const out: AgentConfig[] = []\n\n const addFile = (filePath: string) => {\n if (!filePath.endsWith('.md')) return\n\n const inodeKey = inodeKeyForPath(filePath)\n if (inodeKey) {\n const existing = options.seenInodes.get(inodeKey)\n if (existing) return\n options.seenInodes.set(inodeKey, options.source)\n }\n\n const agent = parseAgentFromFile({\n filePath,\n baseDir: options.baseDir,\n source: options.source,\n })\n if (agent) out.push(agent)\n }\n\n let st: ReturnType<typeof statSync>\n try {\n st = statSync(options.dirPathOrFile)\n } catch {\n return []\n }\n\n if (st.isFile()) {\n addFile(options.dirPathOrFile)\n return out\n }\n\n if (!st.isDirectory()) return []\n\n for (const filePath of listMarkdownFilesRecursively(options.dirPathOrFile)) {\n addFile(filePath)\n }\n\n return out\n}\n\nasync function loadAllAgents(): Promise<{\n activeAgents: AgentConfig[]\n allAgents: AgentConfig[]\n}> {\n const builtinAgents: AgentConfig[] = [\n BUILTIN_GENERAL_PURPOSE,\n BUILTIN_STATUSLINE_SETUP,\n BUILTIN_EXPLORE,\n BUILTIN_PLAN,\n ]\n\n const seenInodes = new Map<string, AgentSource>()\n\n const sessionPlugins = getSessionPlugins()\n const pluginAgentDirs = sessionPlugins.flatMap(p => p.agentsDirs ?? [])\n const pluginAgents = pluginAgentDirs.flatMap(dir =>\n scanAgentPaths({\n dirPathOrFile: dir,\n baseDir: dir,\n source: 'plugin',\n seenInodes,\n }),\n )\n\n const policyAgentsDir = join(getClaudePolicyBaseDir(), '.claude', 'agents')\n const policyAgents = scanAgentPaths({\n dirPathOrFile: policyAgentsDir,\n baseDir: policyAgentsDir,\n source: 'policySettings',\n seenInodes,\n })\n\n const userAgents: AgentConfig[] = []\n if (isSettingSourceEnabled('userSettings')) {\n for (const root of getUserConfigRoots()) {\n const dir = join(root, 'agents')\n userAgents.push(\n ...scanAgentPaths({\n dirPathOrFile: dir,\n baseDir: dir,\n source: 'userSettings',\n seenInodes,\n }),\n )\n }\n }\n\n const projectAgents: AgentConfig[] = []\n if (isSettingSourceEnabled('projectSettings')) {\n const dirs = findProjectAgentDirs(getCwd())\n for (const dir of dirs) {\n projectAgents.push(\n ...scanAgentPaths({\n dirPathOrFile: dir,\n baseDir: dir,\n source: 'projectSettings',\n seenInodes,\n }),\n )\n }\n }\n\n const allAgents: AgentConfig[] = [\n ...builtinAgents,\n ...pluginAgents,\n ...userAgents,\n ...projectAgents,\n ...FLAG_AGENTS,\n ...policyAgents,\n ]\n\n const activeAgents = mergeAgents(allAgents)\n return { activeAgents, allAgents }\n}\n\nexport const getActiveAgents = memoize(async (): Promise<AgentConfig[]> => {\n const { activeAgents } = await loadAllAgents()\n return activeAgents\n})\n\nexport const getAllAgents = memoize(async (): Promise<AgentConfig[]> => {\n const { allAgents } = await loadAllAgents()\n return allAgents\n})\n\nexport const getAgentByType = memoize(\n async (agentType: string): Promise<AgentConfig | undefined> => {\n const agents = await getActiveAgents()\n return agents.find(agent => agent.agentType === agentType)\n },\n)\n\nexport const getAvailableAgentTypes = memoize(async (): Promise<string[]> => {\n const agents = await getActiveAgents()\n return agents.map(agent => agent.agentType)\n})\n\nexport function clearAgentCache(): void {\n getActiveAgents.cache?.clear?.()\n getAllAgents.cache?.clear?.()\n getAgentByType.cache?.clear?.()\n getAvailableAgentTypes.cache?.clear?.()\n}\n\nlet watchers: FSWatcher[] = []\n\nexport async function startAgentWatcher(onChange?: () => void): Promise<void> {\n await stopAgentWatcher()\n\n const watchDirs: string[] = []\n\n watchDirs.push(join(getClaudePolicyBaseDir(), '.claude', 'agents'))\n\n if (isSettingSourceEnabled('userSettings')) {\n for (const root of getUserConfigRoots()) {\n watchDirs.push(join(root, 'agents'))\n }\n }\n\n if (isSettingSourceEnabled('projectSettings')) {\n watchDirs.push(...findProjectAgentDirs(getCwd()))\n }\n\n for (const plugin of getSessionPlugins()) {\n for (const dir of plugin.agentsDirs ?? []) {\n watchDirs.push(dir)\n }\n }\n\n for (const dirPath of dedupeStrings(watchDirs)) {\n if (!existsSync(dirPath)) continue\n try {\n const watcher = watch(\n dirPath,\n { recursive: false },\n async (_eventType, filename) => {\n if (filename && filename.endsWith('.md')) {\n clearAgentCache()\n onChange?.()\n }\n },\n )\n watchers.push(watcher)\n } catch {\n continue\n }\n }\n}\n\nexport async function stopAgentWatcher(): Promise<void> {\n try {\n for (const watcher of watchers) {\n try {\n watcher.close()\n } catch {\n }\n }\n } finally {\n watchers = []\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,UAAU,SAAS,MAAM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AAC,WAAW,OAAO,EAAG;AAC1B,QAAI;AACF,YAAM,UAAU;AAAA,QACd;AAAA,QACA,EAAE,WAAW,MAAM;AAAA,QACnB,OAAO,YAAY,aAAa;AAC9B,cAAI,YAAY,SAAS,SAAS,KAAK,GAAG;AACxC,4BAAgB;AAChB,uBAAW;AAAA,UACb;AAAA,QACF;AAAA,MACF;AACA,eAAS,KAAK,OAAO;AAAA,IACvB,QAAQ;AACN;AAAA,IACF;AAAA,EACF;AACF;AAEA,eAAsB,mBAAkC;AACtD,MAAI;AACF,eAAW,WAAW,UAAU;AAC9B,UAAI;AACF,gBAAQ,MAAM;AAAA,MAChB,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,EACF,UAAE;AACA,eAAW,CAAC;AAAA,EACd;AACF;",
6
6
  "names": ["trimmed"]
7
7
  }
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-RQVLBMP7.js";
6
6
  import {
7
7
  debug
8
- } from "./chunk-AMQ6XZOU.js";
8
+ } from "./chunk-WDCDJPYN.js";
9
9
  import {
10
10
  getCwd,
11
11
  getGlobalConfigFilePath,
12
12
  getLegacyGlobalConfigFilePath,
13
13
  logError
14
- } from "./chunk-G7DKRXDS.js";
14
+ } from "./chunk-7BZ3TT3E.js";
15
15
 
16
16
  // src/core/config/schema.ts
17
17
  function isAutoUpdaterStatus(value) {
@@ -688,7 +688,7 @@ function setModelPointer(pointer, modelName) {
688
688
  }
689
689
  };
690
690
  saveGlobalConfig(updatedConfig);
691
- import("./model-KWGEASLY.js").then(({ reloadModelManager }) => {
691
+ import("./model-F7IYXNO5.js").then(({ reloadModelManager }) => {
692
692
  reloadModelManager();
693
693
  });
694
694
  }
@@ -4,7 +4,7 @@ const require = __pybCreateRequire(import.meta.url);
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "pybao-cli",
7
- version: "1.5.9",
7
+ version: "1.5.11",
8
8
  bin: {
9
9
  pyb: "cli.js",
10
10
  "pyb-acp": "cli-acp.js"
@@ -39,6 +39,12 @@ var package_default = {
39
39
  "scripts/cli-wrapper.cjs",
40
40
  "scripts/cli-acp-wrapper.cjs",
41
41
  "scripts/postinstall.js",
42
+ "scripts/typed-sql-release-gate.mjs",
43
+ "scripts/typed-sql-schema-guard.mjs",
44
+ "scripts/typed-sql-install-smoke.mjs",
45
+ "scripts/typed-sql-no-fallback-gate.mjs",
46
+ "scripts/typed-part-baseline-benchmark.mjs",
47
+ "scripts/typed-part-performance-gate.mjs",
42
48
  ".npmrc",
43
49
  "resources/**/*"
44
50
  ],
@@ -59,9 +65,7 @@ var package_default = {
59
65
  "test:unit": "bun test --preload ./tests/setup/native-lock-test-setup.ts tests/unit",
60
66
  "test:integration": "bun test tests/integration",
61
67
  "test:e2e": "bun test tests/e2e",
62
- "gate:auto-compact": "bun run scripts/auto-compact-gate-check.mjs",
63
68
  "gate:runtime-assets": "bun run scripts/runtime-assets-gate-check.mjs",
64
- "gate:ripgrep-layout": "node scripts/ripgrep-resource-layout-gate.mjs",
65
69
  "preflight:runtime-assets": "node scripts/runtime-assets-preflight.mjs",
66
70
  "verify:runtime-assets": "node scripts/runtime-assets-verify.mjs",
67
71
  "validate:runtime-assets-contract": "node scripts/runtime-assets-schema-validate.mjs",
@@ -69,33 +73,22 @@ var package_default = {
69
73
  "gate:runtime-assets-trend-store": "node scripts/runtime-assets-trend-store.mjs",
70
74
  "gate:runtime-assets-trend": "node scripts/runtime-assets-trend-gate.mjs",
71
75
  "report:runtime-assets-trend": "node scripts/runtime-assets-trend-report.mjs",
72
- "report:auto-compact-trend": "bun run scripts/auto-compact-trend-report.mjs",
73
- "precheck:auto-compact-release": "node scripts/auto-compact-release-precheck.mjs",
74
- "ci:auto-compact-release": "node scripts/auto-compact-release-precheck.mjs --artifact-dir tmp/auto-compact-release-ci --skip-gate 1 --skip-quality-check 1",
75
- "route:auto-compact-release": "node scripts/auto-compact-release-failure-router.mjs",
76
- "report:auto-compact-release-trend": "node scripts/auto-compact-release-trend-extract.mjs",
77
- "report:auto-compact-release-daily-digest": "node scripts/auto-compact-release-daily-digest.mjs",
78
- "check:auto-compact-batch-d-tag-dependency": "node scripts/batch-d-text-tag-dependency-check.mjs",
79
- "audit:auto-compact-batch-d-decision": "node scripts/batch-d-decision-zero-tag-audit.mjs",
80
- "evidence:auto-compact-batch-d": "node scripts/batch-d-evidence-chain.mjs",
81
- "close:auto-compact-batch-d": "node scripts/batch-d-final-closure.mjs",
82
- "close:auto-compact-batch-e": "node scripts/batch-e-rollout-closure.mjs",
83
- "index:auto-compact-batch-e-approval": "node scripts/batch-e-approval-index.mjs",
84
- "runbook:phase2-batch-s0": "node scripts/phase2-batch-s0-runbook.mjs",
85
- "dict:auto-compact-failure-codes": "node scripts/auto-compact-failure-code-dictionary.mjs",
86
- "index:auto-compact-replay": "node scripts/auto-compact-replay-index.mjs",
87
- "gate:auto-compact-single-track-quant": "node scripts/auto-compact-single-track-quant-gate.mjs",
88
- "alert:auto-compact-release": "node scripts/auto-compact-release-alert-dispatch.mjs",
89
- "govern:auto-compact-baseline": "node scripts/auto-compact-baseline-audit-hook.mjs",
76
+ "gate:typed-compat-retirement": "node scripts/typed-compat-retirement-gate.mjs",
77
+ "plan:typed-compat-retirement": "node scripts/typed-compat-retirement-plan.mjs",
78
+ "enforce:typed-compat-retirement": "node scripts/typed-compat-retirement-enforce.mjs",
79
+ "gate:typed-sql-release": "node scripts/typed-sql-release-gate.mjs",
80
+ "gate:typed-sql-schema": "node scripts/typed-sql-schema-guard.mjs",
81
+ "smoke:typed-sql-install": "node scripts/typed-sql-install-smoke.mjs",
82
+ "gate:typed-sql-no-fallback": "node scripts/typed-sql-no-fallback-gate.mjs",
83
+ "benchmark:typed-part-baseline": "bun scripts/typed-part-baseline-benchmark.mjs",
84
+ "gate:typed-part-performance": "node scripts/typed-part-performance-gate.mjs",
90
85
  typecheck: "tsc --noEmit",
91
86
  prepare: "bun run scripts/install-hooks.mjs",
92
87
  "sync:native-lock": "node scripts/sync-native-lock-versions.mjs",
93
88
  "publish:native-lock": "node scripts/publish-native-lock.mjs",
94
89
  "verify:native-lock": "node scripts/verify-native-lock.mjs",
95
90
  "publish:dev": "bun run scripts/publish-dev.js",
96
- "publish:release": "bun run scripts/publish-release.js",
97
- "bench:startup": "bun run scripts/bench-startup.mjs",
98
- "parity:reference": "bun run scripts/reference-parity-check.mjs"
91
+ "publish:release": "bun run scripts/publish-release.js"
99
92
  },
100
93
  dependencies: {
101
94
  "@anthropic-ai/bedrock-sdk": "^0.12.6",
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../package.json", "../src/constants/macros.ts"],
4
+ "sourcesContent": ["{\n \"name\": \"pybao-cli\",\n \"version\": \"1.5.11\",\n \"bin\": {\n \"pyb\": \"cli.js\",\n \"pyb-acp\": \"cli-acp.js\"\n },\n \"engines\": {\n \"node\": \">=20.18.1\"\n },\n \"main\": \"cli.js\",\n \"author\": \"PYB-XC\",\n \"license\": \"MIT\",\n \"description\": \"PYB-CLI - Minimal AI Agent with multi-model support and CLI interface\",\n \"keywords\": [\n \"ai\",\n \"agent\",\n \"minimal\",\n \"claude\"\n ],\n \"homepage\": \"https://github.com/pyb-xc/pyb-ts\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/pyb-xc/pyb-ts.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/pyb-xc/pyb-ts/issues\"\n },\n \"files\": [\n \"cli.js\",\n \"cli-acp.js\",\n \"yoga.wasm\",\n \"dist/**/*\",\n \"scripts/binary-utils.cjs\",\n \"scripts/cli-wrapper.cjs\",\n \"scripts/cli-acp-wrapper.cjs\",\n \"scripts/postinstall.js\",\n \"scripts/typed-sql-release-gate.mjs\",\n \"scripts/typed-sql-schema-guard.mjs\",\n \"scripts/typed-sql-install-smoke.mjs\",\n \"scripts/typed-sql-no-fallback-gate.mjs\",\n \"scripts/typed-part-baseline-benchmark.mjs\",\n \"scripts/typed-part-performance-gate.mjs\",\n \".npmrc\",\n \"resources/**/*\"\n ],\n \"scripts\": {\n \"dev\": \"bun run ./src/entrypoints/cli.tsx --verbose\",\n \"build:npm\": \"bun scripts/build.mjs\",\n \"build\": \"npm run build:npm\",\n \"build:binary\": \"node scripts/build-binary.mjs\",\n \"build:native-lock\": \"node scripts/build-native-lock.mjs\",\n \"clean\": \"node scripts/clean.mjs\",\n \"prepublishOnly\": \"npm run build:npm && node scripts/prepublish-check.js\",\n \"postinstall\": \"node scripts/postinstall.js || true\",\n \"format\": \"prettier --write \\\"src/**/*.{ts,tsx,js,jsx,json}\\\" \\\"tests/**/*.{ts,tsx,js,jsx,json}\\\"\",\n \"format:check\": \"prettier --check \\\"src/**/*.{ts,tsx,js,jsx,json}\\\" \\\"tests/**/*.{ts,tsx,js,jsx,json}\\\"\",\n \"lint\": \"eslint . --ext .ts,.tsx,.js --max-warnings 0\",\n \"lint:fix\": \"eslint . --ext .ts,.tsx,.js --fix\",\n \"test\": \"bun test\",\n \"test:unit\": \"bun test --preload ./tests/setup/native-lock-test-setup.ts tests/unit\",\n \"test:integration\": \"bun test tests/integration\",\n \"test:e2e\": \"bun test tests/e2e\",\n \"gate:runtime-assets\": \"bun run scripts/runtime-assets-gate-check.mjs\",\n \"preflight:runtime-assets\": \"node scripts/runtime-assets-preflight.mjs\",\n \"verify:runtime-assets\": \"node scripts/runtime-assets-verify.mjs\",\n \"validate:runtime-assets-contract\": \"node scripts/runtime-assets-schema-validate.mjs\",\n \"gate:runtime-assets-threshold\": \"node scripts/runtime-assets-threshold-gate.mjs\",\n \"gate:runtime-assets-trend-store\": \"node scripts/runtime-assets-trend-store.mjs\",\n \"gate:runtime-assets-trend\": \"node scripts/runtime-assets-trend-gate.mjs\",\n \"report:runtime-assets-trend\": \"node scripts/runtime-assets-trend-report.mjs\",\n \"gate:typed-compat-retirement\": \"node scripts/typed-compat-retirement-gate.mjs\",\n \"plan:typed-compat-retirement\": \"node scripts/typed-compat-retirement-plan.mjs\",\n \"enforce:typed-compat-retirement\": \"node scripts/typed-compat-retirement-enforce.mjs\",\n \"gate:typed-sql-release\": \"node scripts/typed-sql-release-gate.mjs\",\n \"gate:typed-sql-schema\": \"node scripts/typed-sql-schema-guard.mjs\",\n \"smoke:typed-sql-install\": \"node scripts/typed-sql-install-smoke.mjs\",\n \"gate:typed-sql-no-fallback\": \"node scripts/typed-sql-no-fallback-gate.mjs\",\n \"benchmark:typed-part-baseline\": \"bun scripts/typed-part-baseline-benchmark.mjs\",\n \"gate:typed-part-performance\": \"node scripts/typed-part-performance-gate.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"prepare\": \"bun run scripts/install-hooks.mjs\",\n \"sync:native-lock\": \"node scripts/sync-native-lock-versions.mjs\",\n \"publish:native-lock\": \"node scripts/publish-native-lock.mjs\",\n \"verify:native-lock\": \"node scripts/verify-native-lock.mjs\",\n \"publish:dev\": \"bun run scripts/publish-dev.js\",\n \"publish:release\": \"bun run scripts/publish-release.js\"\n },\n \"dependencies\": {\n \"@anthropic-ai/bedrock-sdk\": \"^0.12.6\",\n \"@anthropic-ai/sdk\": \"^0.39.0\",\n \"@anthropic-ai/vertex-sdk\": \"^0.7.0\",\n \"@astrojs/language-server\": \"2.16.2\",\n \"@aws-sdk/client-bedrock-runtime\": \"3.797.0\",\n \"@commander-js/extra-typings\": \"^13.1.0\",\n \"@inkjs/ui\": \"^2.0.0\",\n \"@modelcontextprotocol/sdk\": \"^1.15.1\",\n \"@prisma/language-server\": \"31.3.4\",\n \"@types/lodash-es\": \"^4.17.12\",\n \"@types/react\": \"^19.1.8\",\n \"@vscode/ripgrep\": \"^1.17.0\",\n \"@vue/language-server\": \"3.2.2\",\n \"ajv\": \"^8.17.1\",\n \"ansi-escapes\": \"^7.0.0\",\n \"bash-language-server\": \"5.6.0\",\n \"chalk\": \"^5.4.1\",\n \"cli-highlight\": \"^2.1.11\",\n \"cli-table3\": \"^0.6.5\",\n \"commander\": \"^13.1.0\",\n \"debug\": \"^4.4.1\",\n \"diff\": \"^7.0.0\",\n \"dockerfile-language-server-nodejs\": \"0.15.0\",\n \"dotenv\": \"^16.6.1\",\n \"env-paths\": \"^3.0.0\",\n \"fflate\": \"^0.8.2\",\n \"figures\": \"^6.1.0\",\n \"glob\": \"^11.0.3\",\n \"graphql-language-service-cli\": \"3.5.0\",\n \"gray-matter\": \"^4.0.3\",\n \"highlight.js\": \"^11.11.1\",\n \"ignore\": \"^7.0.5\",\n \"ink\": \"5.2.1\",\n \"ink-link\": \"^4.1.0\",\n \"ink-select-input\": \"^6.2.0\",\n \"ink-text-input\": \"^6.0.0\",\n \"intelephense\": \"1.16.3\",\n \"js-yaml\": \"^4.1.1\",\n \"lodash-es\": \"^4.17.21\",\n \"lru-cache\": \"^11.1.0\",\n \"marked\": \"^15.0.12\",\n \"minimatch\": \"^10.1.1\",\n \"nanoid\": \"^5.1.5\",\n \"node-html-parser\": \"^7.0.1\",\n \"openai\": \"4.104.0\",\n \"pyright\": \"1.1.408\",\n \"react\": \"18.3.1\",\n \"semver\": \"^7.7.2\",\n \"shell-quote\": \"1.8.3\",\n \"spawn-rx\": \"^5.1.2\",\n \"string-width\": \"^7.2.0\",\n \"strip-ansi\": \"^7.1.0\",\n \"svelte-language-server\": \"0.17.23\",\n \"tsx\": \"^4.20.3\",\n \"typescript-language-server\": \"5.1.3\",\n \"undici\": \"^7.11.0\",\n \"vscode-jsonrpc\": \"8.2.1\",\n \"vscode-langservers-extracted\": \"4.10.0\",\n \"web-tree-sitter\": \"0.25.10\",\n \"which\": \"^6.0.0\",\n \"wrap-ansi\": \"^9.0.0\",\n \"yaml-language-server\": \"1.19.2\",\n \"zod\": \"^3.25.76\",\n \"zod-to-json-schema\": \"^3.24.6\"\n },\n \"devDependencies\": {\n \"@types/bun\": \"latest\",\n \"@types/jest\": \"^30.0.0\",\n \"@types/node\": \"^24.1.0\",\n \"@types/which\": \"^3.0.4\",\n \"@typescript-eslint/eslint-plugin\": \"^8.50.1\",\n \"@typescript-eslint/parser\": \"^8.50.1\",\n \"abort-controller\": \"3.0.0\",\n \"bun-types\": \"latest\",\n \"cheerio\": \"1.1.2\",\n \"esbuild\": \"^0.25.9\",\n \"eslint\": \"8.57.0\",\n \"eslint-plugin-react-hooks\": \"^7.0.1\",\n \"ink-testing-library\": \"4.0.0\",\n \"node-fetch\": \"3.3.2\",\n \"prettier\": \"^3.6.2\",\n \"react-devtools-core\": \"^7.0.1\",\n \"tree-sitter-bash\": \"0.25.1\",\n \"tree-sitter-c-sharp\": \"0.23.1\",\n \"tree-sitter-clojure\": \"0.4.0\",\n \"tree-sitter-cpp\": \"0.23.4\",\n \"tree-sitter-go\": \"0.25.0\",\n \"tree-sitter-haskell\": \"0.23.1\",\n \"tree-sitter-java\": \"0.23.5\",\n \"tree-sitter-julia\": \"0.23.1\",\n \"tree-sitter-nix\": \"0.0.2\",\n \"tree-sitter-ocaml\": \"0.24.2\",\n \"tree-sitter-python\": \"0.25.0\",\n \"tree-sitter-rust\": \"0.24.0\",\n \"tree-sitter-scala\": \"0.24.0\",\n \"tree-sitter-swift\": \"0.7.1\",\n \"tree-sitter-typescript\": \"0.23.2\",\n \"turndown\": \"7.2.2\",\n \"typescript\": \"^5.9.2\"\n },\n \"overrides\": {\n \"@aws-sdk/client-bedrock-runtime\": \"3.797.0\",\n \"@smithy/smithy-client\": \"2.5.1\",\n \"parse5-htmlparser2-tree-adapter\": \"6.0.1\"\n },\n \"optionalDependencies\": {\n \"@puyib-cli/lock-win32-x64-msvc\": \"1.4.55\",\n \"@puyib-cli/lock-win32-arm64-msvc\": \"1.4.56\",\n \"@puyib-cli/lock-linux-x64-gnu\": \"1.4.56\",\n \"@puyib-cli/lock-linux-x64-musl\": \"1.4.56\",\n \"@puyib-cli/lock-linux-arm64-gnu\": \"1.4.56\",\n \"@puyib-cli/lock-linux-armv7-gnueabihf\": \"1.4.56\",\n \"@puyib-cli/lock-darwin-x64\": \"1.4.56\",\n \"@puyib-cli/lock-darwin-arm64\": \"1.4.56\"\n },\n \"pybNativeLockPlatforms\": [\n \"win32-x64-msvc\",\n \"win32-arm64-msvc\",\n \"linux-x64-gnu\",\n \"linux-x64-musl\",\n \"linux-arm64-gnu\",\n \"linux-armv7-gnueabihf\",\n \"darwin-x64\",\n \"darwin-arm64\"\n ]\n}\n", "import pkg from '../../package.json'\n\nexport const MACRO = {\n VERSION: pkg.version,\n README_URL: 'https://github.com/pyb-xc/pyb-ts#readme',\n PACKAGE_URL: 'pybao-cli',\n ISSUES_EXPLAINER:\n 'report the issue at https://github.com/pyb-xc/pyb-ts/issues',\n}\n"],
5
+ "mappings": ";;;;AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,KAAO;AAAA,IACL,KAAO;AAAA,IACP,WAAW;AAAA,EACb;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,EACV;AAAA,EACA,MAAQ;AAAA,EACR,QAAU;AAAA,EACV,SAAW;AAAA,EACX,aAAe;AAAA,EACf,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,EACZ,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW;AAAA,IACT,KAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,qBAAqB;AAAA,IACrB,OAAS;AAAA,IACT,gBAAkB;AAAA,IAClB,aAAe;AAAA,IACf,QAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,MAAQ;AAAA,IACR,YAAY;AAAA,IACZ,MAAQ;AAAA,IACR,aAAa;AAAA,I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