pybao-cli 1.5.10 → 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.
- package/dist/REPL-TGEVVUGU.js +50 -0
- package/dist/{acp-OPW4NHQM.js → acp-NSVRKFDR.js} +31 -31
- package/dist/{agentsValidate-ZVFEF4KY.js → agentsValidate-J4WH47PD.js} +7 -7
- package/dist/{ask-SLRDSXCI.js → ask-TIOWV5TX.js} +30 -30
- package/dist/{autoUpdater-BZ7E2E54.js → autoUpdater-35O63ORK.js} +3 -3
- package/dist/{chunk-AJEGTH5Q.js → chunk-2TZLPLK6.js} +1 -1
- package/dist/{chunk-72ICL3CH.js → chunk-33QWSQC4.js} +6 -7
- package/dist/{chunk-72ICL3CH.js.map → chunk-33QWSQC4.js.map} +2 -2
- package/dist/{chunk-AO6J7LEE.js → chunk-4SQ6LXYG.js} +3 -3
- package/dist/{chunk-UFR47H5I.js → chunk-5MFIJREB.js} +7 -1
- package/dist/chunk-5MFIJREB.js.map +7 -0
- package/dist/{chunk-HPUNAUYE.js → chunk-5P4P5CFA.js} +2 -2
- package/dist/{chunk-YTESBILA.js → chunk-6N43IM3F.js} +1 -1
- package/dist/{chunk-7SZNDNLK.js → chunk-7BZ3TT3E.js} +1 -1
- package/dist/{chunk-6UPWXBMK.js → chunk-BQWG5WFV.js} +1 -1
- package/dist/{chunk-WKSMEOKH.js → chunk-E4QA2SMS.js} +3 -3
- package/dist/{chunk-UV2N4M64.js → chunk-EV3W3WLB.js} +3 -3
- package/dist/{chunk-UPULEKBE.js → chunk-EZ5IMWVJ.js} +1 -1
- package/dist/{chunk-3YDOR2NA.js → chunk-HOGROHYP.js} +4 -4
- package/dist/{chunk-MT3ZAKKO.js → chunk-I7FH3MBS.js} +3 -3
- package/dist/{chunk-MPEAANUT.js → chunk-IC6XUDKC.js} +3 -3
- package/dist/{chunk-7FGPQ22V.js → chunk-IYPL6KOG.js} +1 -1
- package/dist/{chunk-EWXKQF7L.js → chunk-KUQZLTIW.js} +1 -1
- package/dist/{chunk-W6OFNZ3W.js → chunk-L5RH454O.js} +2 -2
- package/dist/{chunk-PUG4EOMG.js → chunk-LTHUAMIE.js} +1 -1
- package/dist/{chunk-E6OFGHIW.js → chunk-M3EVWIF3.js} +3 -3
- package/dist/{chunk-46JMZBCX.js → chunk-MQONPL2D.js} +1 -1
- package/dist/{chunk-NIW3GVZ6.js → chunk-NXGI34H4.js} +146 -626
- package/dist/chunk-NXGI34H4.js.map +7 -0
- package/dist/{chunk-4LLCMT3D.js → chunk-PFYRLJXN.js} +2 -2
- package/dist/{chunk-EEKXOPVZ.js → chunk-Q3DXXYPX.js} +3 -3
- package/dist/{chunk-OHW6JWIB.js → chunk-QMMOGZ7N.js} +4 -4
- package/dist/{chunk-RSYAAJ5F.js → chunk-S7PU3TNH.js} +6 -7
- package/dist/{chunk-RSYAAJ5F.js.map → chunk-S7PU3TNH.js.map} +2 -2
- package/dist/{chunk-SJIE5KQR.js → chunk-TEGHHNGC.js} +5 -5
- package/dist/{chunk-SJIE5KQR.js.map → chunk-TEGHHNGC.js.map} +1 -1
- package/dist/{chunk-4USBSNI7.js → chunk-U6JIGJB4.js} +195 -107
- package/dist/chunk-U6JIGJB4.js.map +7 -0
- package/dist/{chunk-25MWUHVP.js → chunk-VH3IQXUR.js} +1 -1
- package/dist/{chunk-2KTGONPT.js → chunk-WDCDJPYN.js} +1 -1
- package/dist/{chunk-TF4T573B.js → chunk-YJ3HLVKX.js} +2 -2
- package/dist/{chunk-P6O6FCAD.js → chunk-YKCKLLMA.js} +2 -2
- package/dist/{chunk-TQTC7KJZ.js → chunk-YV7Q3VHM.js} +1 -1
- package/dist/{cli-OZWYRJHM.js → cli-TIOLFD3Q.js} +91 -91
- package/dist/commands-T7TKHXOU.js +54 -0
- package/dist/{config-LCNYYLVP.js → config-BPAZ2QW2.js} +4 -4
- package/dist/{context-DPW4MYE4.js → context-UXBFAE6U.js} +6 -6
- package/dist/{conversationPersistence-JLI7ZCBG.js → conversationPersistence-S5Y54OEJ.js} +3 -3
- package/dist/{conversationTracker-KVYAMRCS.js → conversationTracker-EPTEVBKG.js} +4 -4
- package/dist/{customCommands-O2J3V24X.js → customCommands-LJEKRKH7.js} +4 -4
- package/dist/{env-VUPUO64W.js → env-ZKDJ63EH.js} +2 -2
- package/dist/{file-VJBZTSIC.js → file-62N53R4I.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-BXWBQJQA.js → llm-257Z7WOJ.js} +31 -31
- package/dist/{llmLazy-XR66QEVP.js → llmLazy-766Y5JWG.js} +1 -1
- package/dist/{loader-IHQ33LHG.js → loader-IC2B4I4J.js} +4 -4
- package/dist/{lsp-57NLFUAK.js → lsp-ARSWURXF.js} +6 -6
- package/dist/{lspAnchor-VWSO7YZY.js → lspAnchor-5N3KECK7.js} +6 -6
- package/dist/{mcp-XJJDR27I.js → mcp-6LNALW65.js} +7 -7
- package/dist/{mentionProcessor-6MSAZVVB.js → mentionProcessor-LQ6WNIKV.js} +5 -5
- package/dist/{messages-4KD4FLFL.js → messages-GNEQQA27.js} +1 -1
- package/dist/{model-AA5UZIM5.js → model-F7IYXNO5.js} +5 -5
- package/dist/{openai-HAAQ3Y7C.js → openai-HTXVPLAS.js} +5 -5
- package/dist/{outputStyles-MJS6OUKM.js → outputStyles-IEUFSMMK.js} +4 -4
- package/dist/{pluginRuntime-O23ERPKS.js → pluginRuntime-4AI2VGR6.js} +6 -6
- package/dist/{pluginValidation-T25KVTG4.js → pluginValidation-VM4W42FR.js} +6 -6
- package/dist/prompts-EJTGSKLG.js +56 -0
- package/dist/{pybAgentSessionLoad-M3JZ2DH3.js → pybAgentSessionLoad-A3OZD3FR.js} +4 -4
- package/dist/{pybAgentSessionResume-D2R55SPH.js → pybAgentSessionResume-T6XFQUGW.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-LKZILYAG.js → pybAgentStreamJsonSession-J6TKWFS5.js} +1 -1
- package/dist/{pybHooks-GAJ5GRHI.js → pybHooks-QXTF2XWB.js} +4 -4
- package/dist/query-ONI2G7VA.js +58 -0
- package/dist/{registry-GDKX2X34.js → registry-N7W2DT2O.js} +5 -5
- package/dist/{ripgrep-FJH77I5J.js → ripgrep-4YX3ALXH.js} +3 -3
- package/dist/{skillMarketplace-6NXN5AYJ.js → skillMarketplace-BHPBAIS5.js} +3 -3
- package/dist/{state-5JZ6HLQY.js → state-BAYDHBR6.js} +2 -2
- package/dist/{theme-HJNALYGQ.js → theme-5WK7OBSE.js} +5 -5
- package/dist/{toolPermissionSettings-KPM5KUAD.js → toolPermissionSettings-KHCHXARB.js} +6 -6
- package/dist/tools-LTGCAA7X.js +55 -0
- package/dist/{userInput-BXJEMFWI.js → userInput-I5VZDN77.js} +32 -32
- package/package.json +7 -1
- package/scripts/typed-part-baseline-benchmark.mjs +179 -0
- package/scripts/typed-part-performance-gate.mjs +100 -0
- package/scripts/typed-sql-no-fallback-gate.mjs +28 -9
- package/scripts/typed-sql-release-gate.mjs +30 -0
- package/scripts/typed-sql-schema-guard.mjs +68 -0
- package/dist/REPL-LEORZMM6.js +0 -50
- package/dist/chunk-4USBSNI7.js.map +0 -7
- package/dist/chunk-NIW3GVZ6.js.map +0 -7
- package/dist/chunk-UFR47H5I.js.map +0 -7
- package/dist/commands-ASLDRXGO.js +0 -54
- package/dist/prompts-CU2RK7D3.js +0 -56
- package/dist/query-2X4R5ZCX.js +0 -58
- package/dist/tools-C65SWXV6.js +0 -55
- /package/dist/{REPL-LEORZMM6.js.map → REPL-TGEVVUGU.js.map} +0 -0
- /package/dist/{acp-OPW4NHQM.js.map → acp-NSVRKFDR.js.map} +0 -0
- /package/dist/{agentsValidate-ZVFEF4KY.js.map → agentsValidate-J4WH47PD.js.map} +0 -0
- /package/dist/{ask-SLRDSXCI.js.map → ask-TIOWV5TX.js.map} +0 -0
- /package/dist/{autoUpdater-BZ7E2E54.js.map → autoUpdater-35O63ORK.js.map} +0 -0
- /package/dist/{chunk-AJEGTH5Q.js.map → chunk-2TZLPLK6.js.map} +0 -0
- /package/dist/{chunk-AO6J7LEE.js.map → chunk-4SQ6LXYG.js.map} +0 -0
- /package/dist/{chunk-HPUNAUYE.js.map → chunk-5P4P5CFA.js.map} +0 -0
- /package/dist/{chunk-YTESBILA.js.map → chunk-6N43IM3F.js.map} +0 -0
- /package/dist/{chunk-7SZNDNLK.js.map → chunk-7BZ3TT3E.js.map} +0 -0
- /package/dist/{chunk-6UPWXBMK.js.map → chunk-BQWG5WFV.js.map} +0 -0
- /package/dist/{chunk-WKSMEOKH.js.map → chunk-E4QA2SMS.js.map} +0 -0
- /package/dist/{chunk-UV2N4M64.js.map → chunk-EV3W3WLB.js.map} +0 -0
- /package/dist/{chunk-UPULEKBE.js.map → chunk-EZ5IMWVJ.js.map} +0 -0
- /package/dist/{chunk-3YDOR2NA.js.map → chunk-HOGROHYP.js.map} +0 -0
- /package/dist/{chunk-MT3ZAKKO.js.map → chunk-I7FH3MBS.js.map} +0 -0
- /package/dist/{chunk-MPEAANUT.js.map → chunk-IC6XUDKC.js.map} +0 -0
- /package/dist/{chunk-7FGPQ22V.js.map → chunk-IYPL6KOG.js.map} +0 -0
- /package/dist/{chunk-EWXKQF7L.js.map → chunk-KUQZLTIW.js.map} +0 -0
- /package/dist/{chunk-W6OFNZ3W.js.map → chunk-L5RH454O.js.map} +0 -0
- /package/dist/{chunk-PUG4EOMG.js.map → chunk-LTHUAMIE.js.map} +0 -0
- /package/dist/{chunk-E6OFGHIW.js.map → chunk-M3EVWIF3.js.map} +0 -0
- /package/dist/{chunk-46JMZBCX.js.map → chunk-MQONPL2D.js.map} +0 -0
- /package/dist/{chunk-4LLCMT3D.js.map → chunk-PFYRLJXN.js.map} +0 -0
- /package/dist/{chunk-EEKXOPVZ.js.map → chunk-Q3DXXYPX.js.map} +0 -0
- /package/dist/{chunk-OHW6JWIB.js.map → chunk-QMMOGZ7N.js.map} +0 -0
- /package/dist/{chunk-25MWUHVP.js.map → chunk-VH3IQXUR.js.map} +0 -0
- /package/dist/{chunk-2KTGONPT.js.map → chunk-WDCDJPYN.js.map} +0 -0
- /package/dist/{chunk-TF4T573B.js.map → chunk-YJ3HLVKX.js.map} +0 -0
- /package/dist/{chunk-P6O6FCAD.js.map → chunk-YKCKLLMA.js.map} +0 -0
- /package/dist/{chunk-TQTC7KJZ.js.map → chunk-YV7Q3VHM.js.map} +0 -0
- /package/dist/{cli-OZWYRJHM.js.map → cli-TIOLFD3Q.js.map} +0 -0
- /package/dist/{commands-ASLDRXGO.js.map → commands-T7TKHXOU.js.map} +0 -0
- /package/dist/{config-LCNYYLVP.js.map → config-BPAZ2QW2.js.map} +0 -0
- /package/dist/{context-DPW4MYE4.js.map → context-UXBFAE6U.js.map} +0 -0
- /package/dist/{conversationPersistence-JLI7ZCBG.js.map → conversationPersistence-S5Y54OEJ.js.map} +0 -0
- /package/dist/{conversationTracker-KVYAMRCS.js.map → conversationTracker-EPTEVBKG.js.map} +0 -0
- /package/dist/{customCommands-O2J3V24X.js.map → customCommands-LJEKRKH7.js.map} +0 -0
- /package/dist/{env-VUPUO64W.js.map → env-ZKDJ63EH.js.map} +0 -0
- /package/dist/{file-VJBZTSIC.js.map → file-62N53R4I.js.map} +0 -0
- /package/dist/{llm-BXWBQJQA.js.map → llm-257Z7WOJ.js.map} +0 -0
- /package/dist/{llmLazy-XR66QEVP.js.map → llmLazy-766Y5JWG.js.map} +0 -0
- /package/dist/{loader-IHQ33LHG.js.map → loader-IC2B4I4J.js.map} +0 -0
- /package/dist/{lsp-57NLFUAK.js.map → lsp-ARSWURXF.js.map} +0 -0
- /package/dist/{lspAnchor-VWSO7YZY.js.map → lspAnchor-5N3KECK7.js.map} +0 -0
- /package/dist/{mcp-XJJDR27I.js.map → mcp-6LNALW65.js.map} +0 -0
- /package/dist/{mentionProcessor-6MSAZVVB.js.map → mentionProcessor-LQ6WNIKV.js.map} +0 -0
- /package/dist/{messages-4KD4FLFL.js.map → messages-GNEQQA27.js.map} +0 -0
- /package/dist/{model-AA5UZIM5.js.map → model-F7IYXNO5.js.map} +0 -0
- /package/dist/{openai-HAAQ3Y7C.js.map → openai-HTXVPLAS.js.map} +0 -0
- /package/dist/{outputStyles-MJS6OUKM.js.map → outputStyles-IEUFSMMK.js.map} +0 -0
- /package/dist/{pluginRuntime-O23ERPKS.js.map → pluginRuntime-4AI2VGR6.js.map} +0 -0
- /package/dist/{pluginValidation-T25KVTG4.js.map → pluginValidation-VM4W42FR.js.map} +0 -0
- /package/dist/{prompts-CU2RK7D3.js.map → prompts-EJTGSKLG.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-M3JZ2DH3.js.map → pybAgentSessionLoad-A3OZD3FR.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-D2R55SPH.js.map → pybAgentSessionResume-T6XFQUGW.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-LKZILYAG.js.map → pybAgentStreamJsonSession-J6TKWFS5.js.map} +0 -0
- /package/dist/{pybHooks-GAJ5GRHI.js.map → pybHooks-QXTF2XWB.js.map} +0 -0
- /package/dist/{query-2X4R5ZCX.js.map → query-ONI2G7VA.js.map} +0 -0
- /package/dist/{registry-GDKX2X34.js.map → registry-N7W2DT2O.js.map} +0 -0
- /package/dist/{ripgrep-FJH77I5J.js.map → ripgrep-4YX3ALXH.js.map} +0 -0
- /package/dist/{skillMarketplace-6NXN5AYJ.js.map → skillMarketplace-BHPBAIS5.js.map} +0 -0
- /package/dist/{state-5JZ6HLQY.js.map → state-BAYDHBR6.js.map} +0 -0
- /package/dist/{theme-HJNALYGQ.js.map → theme-5WK7OBSE.js.map} +0 -0
- /package/dist/{toolPermissionSettings-KPM5KUAD.js.map → toolPermissionSettings-KHCHXARB.js.map} +0 -0
- /package/dist/{tools-C65SWXV6.js.map → tools-LTGCAA7X.js.map} +0 -0
- /package/dist/{userInput-BXJEMFWI.js.map → userInput-I5VZDN77.js.map} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createRequire as __pybCreateRequire } from "node:module";
|
|
2
|
+
const require = __pybCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
REPL
|
|
5
|
+
} from "./chunk-U6JIGJB4.js";
|
|
6
|
+
import "./chunk-EZ5IMWVJ.js";
|
|
7
|
+
import "./chunk-2TZLPLK6.js";
|
|
8
|
+
import "./chunk-YV7Q3VHM.js";
|
|
9
|
+
import "./chunk-I7FH3MBS.js";
|
|
10
|
+
import "./chunk-BQWG5WFV.js";
|
|
11
|
+
import "./chunk-6N43IM3F.js";
|
|
12
|
+
import "./chunk-F4AXICO7.js";
|
|
13
|
+
import "./chunk-5P7HBXTD.js";
|
|
14
|
+
import "./chunk-E4QA2SMS.js";
|
|
15
|
+
import "./chunk-5P4P5CFA.js";
|
|
16
|
+
import "./chunk-YKCKLLMA.js";
|
|
17
|
+
import "./chunk-XKYHFZEC.js";
|
|
18
|
+
import "./chunk-QMMOGZ7N.js";
|
|
19
|
+
import "./chunk-S7PU3TNH.js";
|
|
20
|
+
import "./chunk-VH3IQXUR.js";
|
|
21
|
+
import "./chunk-M3EVWIF3.js";
|
|
22
|
+
import "./chunk-UNNVICVU.js";
|
|
23
|
+
import "./chunk-YJ3HLVKX.js";
|
|
24
|
+
import "./chunk-33QWSQC4.js";
|
|
25
|
+
import "./chunk-A3BVXXA3.js";
|
|
26
|
+
import "./chunk-KUQZLTIW.js";
|
|
27
|
+
import "./chunk-3DFBSQIT.js";
|
|
28
|
+
import "./chunk-B6IMQJZM.js";
|
|
29
|
+
import "./chunk-OUXHGDLH.js";
|
|
30
|
+
import "./chunk-PFYRLJXN.js";
|
|
31
|
+
import "./chunk-QWIBSCDN.js";
|
|
32
|
+
import "./chunk-HOGROHYP.js";
|
|
33
|
+
import "./chunk-Q3DXXYPX.js";
|
|
34
|
+
import "./chunk-IYPL6KOG.js";
|
|
35
|
+
import "./chunk-UZ34JEUK.js";
|
|
36
|
+
import "./chunk-L5RH454O.js";
|
|
37
|
+
import "./chunk-BJSWTHRM.js";
|
|
38
|
+
import "./chunk-EV3W3WLB.js";
|
|
39
|
+
import "./chunk-TEGHHNGC.js";
|
|
40
|
+
import "./chunk-LTHUAMIE.js";
|
|
41
|
+
import "./chunk-MQONPL2D.js";
|
|
42
|
+
import "./chunk-4SQ6LXYG.js";
|
|
43
|
+
import "./chunk-RQVLBMP7.js";
|
|
44
|
+
import "./chunk-WDCDJPYN.js";
|
|
45
|
+
import "./chunk-7BZ3TT3E.js";
|
|
46
|
+
import "./chunk-5MFIJREB.js";
|
|
47
|
+
import "./chunk-I3J4JYES.js";
|
|
48
|
+
export {
|
|
49
|
+
REPL
|
|
50
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-MWPFU2KU.js";
|
|
7
7
|
import {
|
|
8
8
|
getTools
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NXGI34H4.js";
|
|
10
10
|
import {
|
|
11
11
|
createConversationTrackerPersistenceTelemetryEmitter,
|
|
12
12
|
getCommands,
|
|
@@ -14,70 +14,70 @@ import {
|
|
|
14
14
|
grantReadPermissionForOriginalDir,
|
|
15
15
|
hasPermissionsToUseTool,
|
|
16
16
|
query
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-U6JIGJB4.js";
|
|
18
|
+
import "./chunk-EZ5IMWVJ.js";
|
|
19
|
+
import "./chunk-2TZLPLK6.js";
|
|
20
|
+
import "./chunk-YV7Q3VHM.js";
|
|
21
|
+
import "./chunk-I7FH3MBS.js";
|
|
22
22
|
import {
|
|
23
23
|
ConversationTracker
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-BQWG5WFV.js";
|
|
25
25
|
import {
|
|
26
26
|
FileSystemConversationPersistence
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6N43IM3F.js";
|
|
28
28
|
import "./chunk-F4AXICO7.js";
|
|
29
29
|
import "./chunk-5P7HBXTD.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-E4QA2SMS.js";
|
|
31
|
+
import "./chunk-5P4P5CFA.js";
|
|
32
|
+
import "./chunk-YKCKLLMA.js";
|
|
33
33
|
import {
|
|
34
34
|
ensureSessionState,
|
|
35
35
|
getCurrentSessionId,
|
|
36
36
|
setCurrentSessionId
|
|
37
37
|
} from "./chunk-XKYHFZEC.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-QMMOGZ7N.js";
|
|
39
39
|
import {
|
|
40
40
|
getClients
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
41
|
+
} from "./chunk-S7PU3TNH.js";
|
|
42
|
+
import "./chunk-VH3IQXUR.js";
|
|
43
43
|
import {
|
|
44
44
|
loadToolPermissionContextFromDisk,
|
|
45
45
|
persistToolPermissionUpdateToDisk
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-M3EVWIF3.js";
|
|
47
47
|
import {
|
|
48
48
|
applyToolPermissionContextUpdates
|
|
49
49
|
} from "./chunk-UNNVICVU.js";
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-YJ3HLVKX.js";
|
|
51
|
+
import "./chunk-33QWSQC4.js";
|
|
52
52
|
import "./chunk-A3BVXXA3.js";
|
|
53
53
|
import {
|
|
54
54
|
createAssistantMessage,
|
|
55
55
|
createUserTurnMessageFromBlocks
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-KUQZLTIW.js";
|
|
57
57
|
import "./chunk-3DFBSQIT.js";
|
|
58
58
|
import "./chunk-B6IMQJZM.js";
|
|
59
59
|
import "./chunk-OUXHGDLH.js";
|
|
60
|
-
import "./chunk-
|
|
60
|
+
import "./chunk-PFYRLJXN.js";
|
|
61
61
|
import "./chunk-QWIBSCDN.js";
|
|
62
|
-
import "./chunk-
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
62
|
+
import "./chunk-HOGROHYP.js";
|
|
63
|
+
import "./chunk-Q3DXXYPX.js";
|
|
64
|
+
import "./chunk-IYPL6KOG.js";
|
|
65
65
|
import "./chunk-UZ34JEUK.js";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-L5RH454O.js";
|
|
67
67
|
import "./chunk-BJSWTHRM.js";
|
|
68
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-EV3W3WLB.js";
|
|
69
69
|
import {
|
|
70
70
|
getContext
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import "./chunk-
|
|
73
|
-
import "./chunk-
|
|
71
|
+
} from "./chunk-TEGHHNGC.js";
|
|
72
|
+
import "./chunk-LTHUAMIE.js";
|
|
73
|
+
import "./chunk-MQONPL2D.js";
|
|
74
74
|
import {
|
|
75
75
|
enableConfigs
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-4SQ6LXYG.js";
|
|
77
77
|
import "./chunk-RQVLBMP7.js";
|
|
78
78
|
import {
|
|
79
79
|
initDebugLogger
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-WDCDJPYN.js";
|
|
81
81
|
import {
|
|
82
82
|
PRODUCT_COMMAND,
|
|
83
83
|
initSentry,
|
|
@@ -85,10 +85,10 @@ import {
|
|
|
85
85
|
resolveXdgDataPath,
|
|
86
86
|
setCwd,
|
|
87
87
|
setOriginalCwd
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-7BZ3TT3E.js";
|
|
89
89
|
import {
|
|
90
90
|
MACRO
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-5MFIJREB.js";
|
|
92
92
|
import "./chunk-I3J4JYES.js";
|
|
93
93
|
|
|
94
94
|
// src/acp/jsonrpc.ts
|
|
@@ -2,14 +2,14 @@ import { createRequire as __pybCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __pybCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
getModelManager
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-EV3W3WLB.js";
|
|
6
|
+
import "./chunk-4SQ6LXYG.js";
|
|
7
7
|
import "./chunk-RQVLBMP7.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-WDCDJPYN.js";
|
|
9
9
|
import {
|
|
10
10
|
getXdgConfigDir
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-7BZ3TT3E.js";
|
|
12
|
+
import "./chunk-5MFIJREB.js";
|
|
13
13
|
import "./chunk-I3J4JYES.js";
|
|
14
14
|
|
|
15
15
|
// src/entrypoints/cli/agentsValidate.ts
|
|
@@ -344,8 +344,8 @@ async function validateAgentTemplates(args) {
|
|
|
344
344
|
let knownToolNames;
|
|
345
345
|
if (args.checkTools) {
|
|
346
346
|
try {
|
|
347
|
-
const { getTools } = await import("./tools-
|
|
348
|
-
const { getCurrentProjectConfig } = await import("./config-
|
|
347
|
+
const { getTools } = await import("./tools-LTGCAA7X.js");
|
|
348
|
+
const { getCurrentProjectConfig } = await import("./config-BPAZ2QW2.js");
|
|
349
349
|
const allTools = await getTools(getCurrentProjectConfig().enableArchitectTool);
|
|
350
350
|
knownToolNames = new Set(allTools.map((t) => t.name));
|
|
351
351
|
} catch {
|
|
@@ -4,67 +4,67 @@ import {
|
|
|
4
4
|
createConversationTrackerPersistenceTelemetryEmitter,
|
|
5
5
|
getSystemPrompt,
|
|
6
6
|
query
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
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";
|
|
12
12
|
import {
|
|
13
13
|
ConversationTracker
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BQWG5WFV.js";
|
|
15
15
|
import {
|
|
16
16
|
FileSystemConversationPersistence
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6N43IM3F.js";
|
|
18
18
|
import {
|
|
19
19
|
beginReplSessionScope
|
|
20
20
|
} from "./chunk-F4AXICO7.js";
|
|
21
21
|
import "./chunk-5P7HBXTD.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-E4QA2SMS.js";
|
|
23
|
+
import "./chunk-5P4P5CFA.js";
|
|
24
|
+
import "./chunk-YKCKLLMA.js";
|
|
25
25
|
import "./chunk-XKYHFZEC.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-QMMOGZ7N.js";
|
|
27
|
+
import "./chunk-S7PU3TNH.js";
|
|
28
|
+
import "./chunk-VH3IQXUR.js";
|
|
29
|
+
import "./chunk-M3EVWIF3.js";
|
|
30
30
|
import "./chunk-UNNVICVU.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-YJ3HLVKX.js";
|
|
32
|
+
import "./chunk-33QWSQC4.js";
|
|
33
33
|
import "./chunk-A3BVXXA3.js";
|
|
34
34
|
import {
|
|
35
35
|
createUserTurnMessageFromBlocks
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-KUQZLTIW.js";
|
|
37
37
|
import "./chunk-3DFBSQIT.js";
|
|
38
38
|
import "./chunk-B6IMQJZM.js";
|
|
39
39
|
import {
|
|
40
40
|
getTotalCost
|
|
41
41
|
} from "./chunk-OUXHGDLH.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-PFYRLJXN.js";
|
|
43
43
|
import "./chunk-QWIBSCDN.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-HOGROHYP.js";
|
|
45
|
+
import "./chunk-Q3DXXYPX.js";
|
|
46
|
+
import "./chunk-IYPL6KOG.js";
|
|
47
47
|
import "./chunk-UZ34JEUK.js";
|
|
48
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-L5RH454O.js";
|
|
49
49
|
import "./chunk-BJSWTHRM.js";
|
|
50
50
|
import {
|
|
51
51
|
getModelManager
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-EV3W3WLB.js";
|
|
53
53
|
import {
|
|
54
54
|
getContext
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
55
|
+
} from "./chunk-TEGHHNGC.js";
|
|
56
|
+
import "./chunk-LTHUAMIE.js";
|
|
57
|
+
import "./chunk-MQONPL2D.js";
|
|
58
|
+
import "./chunk-4SQ6LXYG.js";
|
|
59
59
|
import "./chunk-RQVLBMP7.js";
|
|
60
|
-
import "./chunk-
|
|
60
|
+
import "./chunk-WDCDJPYN.js";
|
|
61
61
|
import {
|
|
62
62
|
getMessagesPath,
|
|
63
63
|
overwriteLog,
|
|
64
64
|
resolveXdgDataPath,
|
|
65
65
|
setCwd
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import "./chunk-
|
|
66
|
+
} from "./chunk-7BZ3TT3E.js";
|
|
67
|
+
import "./chunk-5MFIJREB.js";
|
|
68
68
|
import "./chunk-I3J4JYES.js";
|
|
69
69
|
|
|
70
70
|
// src/app/ask.ts
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
checkAndNotifyUpdate,
|
|
6
6
|
getLatestVersion,
|
|
7
7
|
getUpdateCommandSuggestions
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
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,
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
} from "./chunk-BJSWTHRM.js";
|
|
9
9
|
import {
|
|
10
10
|
debug
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WDCDJPYN.js";
|
|
12
12
|
import {
|
|
13
13
|
getCwd,
|
|
14
14
|
getXdgConfigDir,
|
|
15
15
|
logError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7BZ3TT3E.js";
|
|
17
17
|
|
|
18
18
|
// src/utils/agent/loader.ts
|
|
19
19
|
import {
|
|
@@ -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
|
|
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
|
|
@@ -439,7 +439,6 @@ NOTE: You are meant to be a fast agent that returns output as quickly as possibl
|
|
|
439
439
|
|
|
440
440
|
# Tool usage policy
|
|
441
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
|
-
- **LS vs Glob "dir/*"**: LS provides complexity stats (directory/file ratio, max depth) to guide strategy; Glob "dir/*" is faster but no stats. Use LS when you need structural insights; use Glob for quick one-level checks.
|
|
443
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.
|
|
444
443
|
- It is always better to speculatively read multiple files as a batch that are potentially useful.
|
|
445
444
|
- It is always better to speculatively perform multiple searches as a batch that are potentially useful.
|
|
@@ -451,14 +450,14 @@ NOTE: You are meant to be a fast agent that returns output as quickly as possibl
|
|
|
451
450
|
- Example: \`GlobTool(pattern: "tests", semantic: true)\` will find test files based on project structure.
|
|
452
451
|
2. **Exact Identifier**: WHEN you know the precise class/function name (e.g., "UserProfile", "initDatabase"), use standard Grep/Glob without \`semantic\` flag.
|
|
453
452
|
3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \`semantic: true\`.
|
|
454
|
-
4. **File System Exploration Priority**:For file system exploration, decide based on intent: if you need global structure/entry points, prefer
|
|
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.
|
|
455
454
|
|
|
456
455
|
# Path Fragmentation Strategy
|
|
457
456
|
- Root -> Core Directory -> Secondary Modules
|
|
458
457
|
- Run structure scanning in the above order
|
|
459
458
|
|
|
460
459
|
# LSP Priority & Scope Limits
|
|
461
|
-
- **Order**: Structure Tree (
|
|
460
|
+
- **Order**: Structure Tree (Glob "dir/*") \u2192 Hotspot Location \u2192 Read \u2192 LSP
|
|
462
461
|
- Use \`LSPTool.documentSymbol\` or \`LSPTool.definition\` only when you have a precise position and need to confirm exact range
|
|
463
462
|
- Do NOT rely on line numbers from \`read_file\` alone as they may be outdated
|
|
464
463
|
- \`workspaceSymbol\` requires a query and should provide clear path/module scope to avoid unbounded workspace queries
|
|
@@ -535,7 +534,7 @@ List 3-5 files most critical for implementing this plan:
|
|
|
535
534
|
3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \`semantic: true\`.
|
|
536
535
|
|
|
537
536
|
# LSP Priority & Scope Limits
|
|
538
|
-
- **Order**: Structure Tree (
|
|
537
|
+
- **Order**: Structure Tree (Glob "dir/*") \u2192 Hotspot Location \u2192 Read \u2192 LSP
|
|
539
538
|
- Use \`LSPTool.documentSymbol\` or \`LSPTool.definition\` only when you have a precise position and need to confirm exact range
|
|
540
539
|
- Do NOT rely on line numbers from \`read_file\` alone as they may be outdated
|
|
541
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 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 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# 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- **LS vs Glob \"dir/*\"**: LS provides complexity stats (directory/file ratio, max depth) to guide strategy; Glob \"dir/*\" is faster but no stats. Use LS when you need structural insights; use Glob for quick one-level checks.\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 LS or Glob \"dir/*\" first; if you have keywords or fuzzy paths, prefer Glob first. If results are too broad, use LS or 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 (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 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;AAA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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,eAAe;AACjD,SAAS,eAAe;AACxB,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