pybao-cli 1.5.37 → 1.5.39

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 (157) hide show
  1. package/dist/REPL-QXWIXDPD.js +51 -0
  2. package/dist/{acp-JW3TIYAD.js → acp-Z3ROU4NT.js} +30 -30
  3. package/dist/{agentsValidate-SBWTSOTC.js → agentsValidate-T5RRKNH7.js} +7 -7
  4. package/dist/{ask-REOHQELX.js → ask-Q5DD7Y5V.js} +30 -30
  5. package/dist/{autoUpdater-QOASKMIL.js → autoUpdater-X4MGXTHY.js} +3 -3
  6. package/dist/{chunk-66IQQBOM.js → chunk-25DI6YMP.js} +1 -1
  7. package/dist/{chunk-Q6ADAH2V.js → chunk-3YYZBLYE.js} +3 -3
  8. package/dist/{chunk-UBR4EMJG.js → chunk-4L2R7COO.js} +3 -3
  9. package/dist/{chunk-GBRPRP4C.js → chunk-6ZXSYUC4.js} +3 -3
  10. package/dist/{chunk-GBRPRP4C.js.map → chunk-6ZXSYUC4.js.map} +1 -1
  11. package/dist/{chunk-T5T43XFI.js → chunk-7A7AGNEX.js} +5 -5
  12. package/dist/{chunk-T5T43XFI.js.map → chunk-7A7AGNEX.js.map} +1 -1
  13. package/dist/{chunk-HS72NWQM.js → chunk-B6KK6QP2.js} +1 -1
  14. package/dist/chunk-BKCAVW2G.js.map +7 -0
  15. package/dist/{chunk-JRCCJJTK.js → chunk-C2XL4PP4.js} +5 -4
  16. package/dist/chunk-C2XL4PP4.js.map +7 -0
  17. package/dist/{chunk-BV4JBKPK.js → chunk-CARZ3VV2.js} +3 -3
  18. package/dist/{chunk-LQ3YSDHE.js → chunk-E2O5ZNMG.js} +1 -1
  19. package/dist/{chunk-PKMXJDHS.js → chunk-IOJSVTJI.js} +1 -1
  20. package/dist/{chunk-VNJSOVCS.js → chunk-J6RVV73S.js} +3 -20
  21. package/dist/chunk-J6RVV73S.js.map +7 -0
  22. package/dist/{chunk-K53ERJZE.js → chunk-JZ7UEGNN.js} +1 -1
  23. package/dist/{chunk-XYD26HOU.js → chunk-K5F6WOED.js} +1 -1
  24. package/dist/{chunk-T5VIUVWS.js → chunk-K6USRWZZ.js} +583 -408
  25. package/dist/chunk-K6USRWZZ.js.map +7 -0
  26. package/dist/{chunk-ORTVYWVH.js → chunk-K6ZSF4XV.js} +4 -4
  27. package/dist/{chunk-TM2IQSS6.js → chunk-M74TFPOY.js} +3 -3
  28. package/dist/{chunk-6EUA3JLK.js → chunk-N4KEHLUE.js} +6 -6
  29. package/dist/{chunk-6EUA3JLK.js.map → chunk-N4KEHLUE.js.map} +1 -1
  30. package/dist/{chunk-EXOVGTTX.js → chunk-OQV3ASGW.js} +3 -3
  31. package/dist/{chunk-2OX2HGKH.js → chunk-OXMRNROM.js} +2 -2
  32. package/dist/{chunk-66GPSPHJ.js → chunk-PMPJBZ4W.js} +3 -3
  33. package/dist/{chunk-T3NFIJVE.js → chunk-QJPGHOOD.js} +3 -3
  34. package/dist/{chunk-SFFHKLKV.js → chunk-RF4TLZ2G.js} +1 -1
  35. package/dist/{chunk-HKC3XNTU.js → chunk-TNVELATG.js} +4 -4
  36. package/dist/{chunk-DNJ2EUI4.js → chunk-TPEX7GP6.js} +2 -2
  37. package/dist/{chunk-PJMRV734.js → chunk-UIHCMY35.js} +2 -2
  38. package/dist/{chunk-6UJ2IX6O.js → chunk-UXJEDV2F.js} +1 -1
  39. package/dist/{chunk-37VT7CBN.js → chunk-WU3KYQFA.js} +3 -3
  40. package/dist/{chunk-A4MELTXR.js → chunk-XEZ4I2EW.js} +1 -1
  41. package/dist/{chunk-GAHOCTVO.js → chunk-XQZYIKQG.js} +1 -1
  42. package/dist/{chunk-CWEWMSYK.js → chunk-YGMNRXWM.js} +2 -2
  43. package/dist/{chunk-X2LEA5WZ.js → chunk-YQX2PZMK.js} +4 -4
  44. package/dist/{cli-ILXOOGOB.js → cli-KXJVBKJ3.js} +91 -91
  45. package/dist/commands-ESZSE6NV.js +55 -0
  46. package/dist/{config-HVU5BUJR.js → config-WAHXMCBU.js} +4 -4
  47. package/dist/{context-Z3QI3FNI.js → context-F57XOU2V.js} +6 -6
  48. package/dist/{conversationPersistence-FKNK4HLK.js → conversationPersistence-AQ4ICXAB.js} +3 -3
  49. package/dist/{conversationTracker-2LFSHPJQ.js → conversationTracker-E4JUPWAN.js} +4 -4
  50. package/dist/{customCommands-JC4SMHEG.js → customCommands-JIPCN2R2.js} +4 -4
  51. package/dist/{env-C4DAPLWY.js → env-CQDTZSMG.js} +2 -2
  52. package/dist/{file-V2C5K5KH.js → file-67TG46SO.js} +4 -4
  53. package/dist/index.js +3 -3
  54. package/dist/{llm-YTSS25IN.js → llm-S4UIKFEI.js} +32 -32
  55. package/dist/{llmLazy-TFIRXTKR.js → llmLazy-C4LTCDFH.js} +1 -1
  56. package/dist/{loader-GTHCSRZZ.js → loader-TEMIJTXY.js} +4 -4
  57. package/dist/{lsp-GS74PXYZ.js → lsp-NRIYSZQ4.js} +6 -6
  58. package/dist/{lspAnchor-ACLDKRMF.js → lspAnchor-FM5VJH4Y.js} +6 -6
  59. package/dist/{mcp-WULQ66CY.js → mcp-TCYAGRRL.js} +7 -7
  60. package/dist/{mentionProcessor-GWPPEFEF.js → mentionProcessor-I3NLABF6.js} +5 -5
  61. package/dist/{messages-OGPCOESK.js → messages-RI367EVZ.js} +1 -1
  62. package/dist/{model-URPSX5FV.js → model-NJI57V4I.js} +5 -5
  63. package/dist/{openai-6W76QZ5A.js → openai-CD6FJTQW.js} +5 -5
  64. package/dist/{outputStyles-IUWSV34Z.js → outputStyles-DTQLGYLI.js} +4 -4
  65. package/dist/{pluginRuntime-7ZEORM4F.js → pluginRuntime-HAYCLP4K.js} +6 -6
  66. package/dist/{pluginValidation-OJES7FNG.js → pluginValidation-EXHNDUOT.js} +6 -6
  67. package/dist/prompts-UGQX7FG5.js +57 -0
  68. package/dist/{pybAgentSessionLoad-HQOBJLOU.js → pybAgentSessionLoad-WRYHVHEJ.js} +4 -4
  69. package/dist/{pybAgentSessionResume-XDKORGD2.js → pybAgentSessionResume-UWLIZORC.js} +4 -4
  70. package/dist/{pybAgentStreamJsonSession-FTCT4HKD.js → pybAgentStreamJsonSession-IPKXSPWK.js} +1 -1
  71. package/dist/{pybHooks-FKA2AQ47.js → pybHooks-GMZAQ3EO.js} +4 -4
  72. package/dist/query-LBWLTCLG.js +55 -0
  73. package/dist/{registry-GT6NBBK5.js → registry-63DZ2LVO.js} +5 -5
  74. package/dist/{ripgrep-GHL736ND.js → ripgrep-XTOLMKN5.js} +3 -3
  75. package/dist/{skillMarketplace-2IXTVWA6.js → skillMarketplace-BY4UWKWZ.js} +3 -3
  76. package/dist/{state-M7627Z3G.js → state-34X5ECUL.js} +2 -2
  77. package/dist/{theme-NDLGHEH5.js → theme-CDSY27SJ.js} +5 -5
  78. package/dist/{toolPermissionSettings-KVBN66MO.js → toolPermissionSettings-RCPBRGPK.js} +6 -6
  79. package/dist/tools-53UXDJ64.js +55 -0
  80. package/dist/{userInput-GU6FNIO4.js → userInput-4FVP4WYV.js} +32 -32
  81. package/package.json +3 -20
  82. package/dist/REPL-N755RAFU.js +0 -51
  83. package/dist/chunk-2DKSGO53.js.map +0 -7
  84. package/dist/chunk-JRCCJJTK.js.map +0 -7
  85. package/dist/chunk-T5VIUVWS.js.map +0 -7
  86. package/dist/chunk-VNJSOVCS.js.map +0 -7
  87. package/dist/commands-EMWY7YKA.js +0 -55
  88. package/dist/prompts-XOIWSFPX.js +0 -57
  89. package/dist/query-FMWLAT3K.js +0 -55
  90. package/dist/tools-LHTT7WYX.js +0 -55
  91. /package/dist/{REPL-N755RAFU.js.map → REPL-QXWIXDPD.js.map} +0 -0
  92. /package/dist/{acp-JW3TIYAD.js.map → acp-Z3ROU4NT.js.map} +0 -0
  93. /package/dist/{agentsValidate-SBWTSOTC.js.map → agentsValidate-T5RRKNH7.js.map} +0 -0
  94. /package/dist/{ask-REOHQELX.js.map → ask-Q5DD7Y5V.js.map} +0 -0
  95. /package/dist/{autoUpdater-QOASKMIL.js.map → autoUpdater-X4MGXTHY.js.map} +0 -0
  96. /package/dist/{chunk-66IQQBOM.js.map → chunk-25DI6YMP.js.map} +0 -0
  97. /package/dist/{chunk-Q6ADAH2V.js.map → chunk-3YYZBLYE.js.map} +0 -0
  98. /package/dist/{chunk-UBR4EMJG.js.map → chunk-4L2R7COO.js.map} +0 -0
  99. /package/dist/{chunk-HS72NWQM.js.map → chunk-B6KK6QP2.js.map} +0 -0
  100. /package/dist/{chunk-2DKSGO53.js → chunk-BKCAVW2G.js} +0 -0
  101. /package/dist/{chunk-BV4JBKPK.js.map → chunk-CARZ3VV2.js.map} +0 -0
  102. /package/dist/{chunk-LQ3YSDHE.js.map → chunk-E2O5ZNMG.js.map} +0 -0
  103. /package/dist/{chunk-PKMXJDHS.js.map → chunk-IOJSVTJI.js.map} +0 -0
  104. /package/dist/{chunk-K53ERJZE.js.map → chunk-JZ7UEGNN.js.map} +0 -0
  105. /package/dist/{chunk-XYD26HOU.js.map → chunk-K5F6WOED.js.map} +0 -0
  106. /package/dist/{chunk-ORTVYWVH.js.map → chunk-K6ZSF4XV.js.map} +0 -0
  107. /package/dist/{chunk-TM2IQSS6.js.map → chunk-M74TFPOY.js.map} +0 -0
  108. /package/dist/{chunk-EXOVGTTX.js.map → chunk-OQV3ASGW.js.map} +0 -0
  109. /package/dist/{chunk-2OX2HGKH.js.map → chunk-OXMRNROM.js.map} +0 -0
  110. /package/dist/{chunk-66GPSPHJ.js.map → chunk-PMPJBZ4W.js.map} +0 -0
  111. /package/dist/{chunk-T3NFIJVE.js.map → chunk-QJPGHOOD.js.map} +0 -0
  112. /package/dist/{chunk-SFFHKLKV.js.map → chunk-RF4TLZ2G.js.map} +0 -0
  113. /package/dist/{chunk-HKC3XNTU.js.map → chunk-TNVELATG.js.map} +0 -0
  114. /package/dist/{chunk-DNJ2EUI4.js.map → chunk-TPEX7GP6.js.map} +0 -0
  115. /package/dist/{chunk-PJMRV734.js.map → chunk-UIHCMY35.js.map} +0 -0
  116. /package/dist/{chunk-6UJ2IX6O.js.map → chunk-UXJEDV2F.js.map} +0 -0
  117. /package/dist/{chunk-37VT7CBN.js.map → chunk-WU3KYQFA.js.map} +0 -0
  118. /package/dist/{chunk-A4MELTXR.js.map → chunk-XEZ4I2EW.js.map} +0 -0
  119. /package/dist/{chunk-GAHOCTVO.js.map → chunk-XQZYIKQG.js.map} +0 -0
  120. /package/dist/{chunk-CWEWMSYK.js.map → chunk-YGMNRXWM.js.map} +0 -0
  121. /package/dist/{chunk-X2LEA5WZ.js.map → chunk-YQX2PZMK.js.map} +0 -0
  122. /package/dist/{cli-ILXOOGOB.js.map → cli-KXJVBKJ3.js.map} +0 -0
  123. /package/dist/{commands-EMWY7YKA.js.map → commands-ESZSE6NV.js.map} +0 -0
  124. /package/dist/{config-HVU5BUJR.js.map → config-WAHXMCBU.js.map} +0 -0
  125. /package/dist/{context-Z3QI3FNI.js.map → context-F57XOU2V.js.map} +0 -0
  126. /package/dist/{conversationPersistence-FKNK4HLK.js.map → conversationPersistence-AQ4ICXAB.js.map} +0 -0
  127. /package/dist/{conversationTracker-2LFSHPJQ.js.map → conversationTracker-E4JUPWAN.js.map} +0 -0
  128. /package/dist/{customCommands-JC4SMHEG.js.map → customCommands-JIPCN2R2.js.map} +0 -0
  129. /package/dist/{env-C4DAPLWY.js.map → env-CQDTZSMG.js.map} +0 -0
  130. /package/dist/{file-V2C5K5KH.js.map → file-67TG46SO.js.map} +0 -0
  131. /package/dist/{llm-YTSS25IN.js.map → llm-S4UIKFEI.js.map} +0 -0
  132. /package/dist/{llmLazy-TFIRXTKR.js.map → llmLazy-C4LTCDFH.js.map} +0 -0
  133. /package/dist/{loader-GTHCSRZZ.js.map → loader-TEMIJTXY.js.map} +0 -0
  134. /package/dist/{lsp-GS74PXYZ.js.map → lsp-NRIYSZQ4.js.map} +0 -0
  135. /package/dist/{lspAnchor-ACLDKRMF.js.map → lspAnchor-FM5VJH4Y.js.map} +0 -0
  136. /package/dist/{mcp-WULQ66CY.js.map → mcp-TCYAGRRL.js.map} +0 -0
  137. /package/dist/{mentionProcessor-GWPPEFEF.js.map → mentionProcessor-I3NLABF6.js.map} +0 -0
  138. /package/dist/{messages-OGPCOESK.js.map → messages-RI367EVZ.js.map} +0 -0
  139. /package/dist/{model-URPSX5FV.js.map → model-NJI57V4I.js.map} +0 -0
  140. /package/dist/{openai-6W76QZ5A.js.map → openai-CD6FJTQW.js.map} +0 -0
  141. /package/dist/{outputStyles-IUWSV34Z.js.map → outputStyles-DTQLGYLI.js.map} +0 -0
  142. /package/dist/{pluginRuntime-7ZEORM4F.js.map → pluginRuntime-HAYCLP4K.js.map} +0 -0
  143. /package/dist/{pluginValidation-OJES7FNG.js.map → pluginValidation-EXHNDUOT.js.map} +0 -0
  144. /package/dist/{prompts-XOIWSFPX.js.map → prompts-UGQX7FG5.js.map} +0 -0
  145. /package/dist/{pybAgentSessionLoad-HQOBJLOU.js.map → pybAgentSessionLoad-WRYHVHEJ.js.map} +0 -0
  146. /package/dist/{pybAgentSessionResume-XDKORGD2.js.map → pybAgentSessionResume-UWLIZORC.js.map} +0 -0
  147. /package/dist/{pybAgentStreamJsonSession-FTCT4HKD.js.map → pybAgentStreamJsonSession-IPKXSPWK.js.map} +0 -0
  148. /package/dist/{pybHooks-FKA2AQ47.js.map → pybHooks-GMZAQ3EO.js.map} +0 -0
  149. /package/dist/{query-FMWLAT3K.js.map → query-LBWLTCLG.js.map} +0 -0
  150. /package/dist/{registry-GT6NBBK5.js.map → registry-63DZ2LVO.js.map} +0 -0
  151. /package/dist/{ripgrep-GHL736ND.js.map → ripgrep-XTOLMKN5.js.map} +0 -0
  152. /package/dist/{skillMarketplace-2IXTVWA6.js.map → skillMarketplace-BY4UWKWZ.js.map} +0 -0
  153. /package/dist/{state-M7627Z3G.js.map → state-34X5ECUL.js.map} +0 -0
  154. /package/dist/{theme-NDLGHEH5.js.map → theme-CDSY27SJ.js.map} +0 -0
  155. /package/dist/{toolPermissionSettings-KVBN66MO.js.map → toolPermissionSettings-RCPBRGPK.js.map} +0 -0
  156. /package/dist/{tools-LHTT7WYX.js.map → tools-53UXDJ64.js.map} +0 -0
  157. /package/dist/{userInput-GU6FNIO4.js.map → userInput-4FVP4WYV.js.map} +0 -0
@@ -8,13 +8,13 @@ import {
8
8
  } from "./chunk-KFEHHKZ2.js";
9
9
  import {
10
10
  ripGrepWithStatus
11
- } from "./chunk-PKMXJDHS.js";
11
+ } from "./chunk-IOJSVTJI.js";
12
12
  import {
13
13
  getCurrentProjectConfig,
14
14
  getGlobalConfig,
15
15
  getOrCreateUserID,
16
16
  saveCurrentProjectConfig
17
- } from "./chunk-BV4JBKPK.js";
17
+ } from "./chunk-CARZ3VV2.js";
18
18
  import {
19
19
  SESSION_ID,
20
20
  env,
@@ -22,10 +22,10 @@ import {
22
22
  getCwd,
23
23
  isContextScanDisabled,
24
24
  logError
25
- } from "./chunk-GBRPRP4C.js";
25
+ } from "./chunk-6ZXSYUC4.js";
26
26
  import {
27
27
  MACRO
28
- } from "./chunk-VNJSOVCS.js";
28
+ } from "./chunk-J6RVV73S.js";
29
29
  import {
30
30
  __require
31
31
  } from "./chunk-I3J4JYES.js";
@@ -484,7 +484,7 @@ var ENV_STATS_IGNORE_PATTERNS = [
484
484
  "venv/",
485
485
  "env/"
486
486
  ];
487
- var PROJECT_STRUCTURE_STATS_GUIDANCE = 'Based on current project structure statistics, preliminary complexity analysis: 1 High directory/file ratio \u2192 more fragmented structure, potentially finer hierarchy, higher complexity. 2 Deep max depth \u2192 obvious deep nesting, higher navigation and positioning cost. 3 Many top-level directories \u2192 scattered module entries, need stricter layer confirmation. 4 Large total files \u2192 more likely to trigger output truncation. Processing: Low complexity \u2192 use Glob "dir/*" to get structure clues then proceed to locate; High complexity \u2192 use Glob "dir/*" to get top-level clues first, then use Glob for layered path confirmation.';
487
+ var PROJECT_STRUCTURE_STATS_GUIDANCE = "Based on current project structure statistics, preliminary complexity analysis: 1 High directory/file ratio \u2192 more fragmented structure, potentially finer hierarchy, higher complexity. 2 Deep max depth \u2192 obvious deep nesting, higher navigation and positioning cost. 3 Many top-level directories \u2192 scattered module entries, need stricter layer confirmation. 4 Large total files \u2192 more likely to trigger output truncation. Processing: Low complexity \u2192 read target directory paths for one-level structure clues, then proceed to locate; High complexity \u2192 read top-level directory paths first, then use Glob for layered path confirmation.";
488
488
  var getWorkingDirectoryStructureStatsSnapshot = memoize4(
489
489
  async () => computeWorkingDirectoryStructureStats()
490
490
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/utils/config/style.ts", "../src/context/index.ts", "../src/utils/system/git.ts", "../src/utils/identity/user.ts", "../src/utils/config/rules.ts"],
4
- "sourcesContent": ["import { readFileSync } from 'fs'\nimport { memoize } from 'lodash-es'\nimport { getCwd } from '@utils/state'\nimport { getProjectInstructionFiles } from './projectInstructions'\n\nconst STYLE_PROMPT =\n 'The codebase follows strict style guidelines shown below. All code changes must strictly adhere to these guidelines to maintain consistency and quality.'\n\nexport const getCodeStyle = memoize((): string => {\n const styles: string[] = []\n\n const instructionFiles = getProjectInstructionFiles(getCwd())\n for (const file of instructionFiles) {\n try {\n styles.push(\n `Contents of ${file.absolutePath}:\\n\\n${readFileSync(file.absolutePath, 'utf-8')}`,\n )\n } catch {\n }\n }\n\n if (styles.length === 0) {\n return ''\n }\n\n return `${STYLE_PROMPT}\\n\\n${styles.join('\\n\\n')}`\n})\n", "import {\n getCurrentProjectConfig,\n saveCurrentProjectConfig,\n} from '@utils/config'\nimport { logError } from '@utils/log'\nimport { getCodeStyle } from '@utils/config/style'\nimport { isContextScanDisabled } from '@utils/config/env'\nimport { getCwd } from '@utils/state'\nimport { memoize, omit } from 'lodash-es'\nimport { getIsGit } from '@utils/system/git'\nimport { execFileNoThrow } from '@utils/system/execFileNoThrow'\nimport { isAbsolute, join, relative, resolve, sep } from 'path'\nimport { readFile } from 'fs/promises'\nimport { existsSync, readdirSync } from 'fs'\nimport { getModelManager } from '@utils/model'\nimport { lastX } from '@utils/text/generators'\nimport { getGitEmail } from '@utils/identity/user'\nimport {\n getProjectInstructionFiles,\n readAndConcatProjectInstructionFiles,\n} from '@utils/config/projectInstructions'\nimport { getProjectRules } from '@utils/config/rules'\nimport { ripGrepWithStatus } from '@utils/system/ripgrep'\nimport { minimatch } from 'minimatch'\n\nexport async function getInstructionFilesNote(): Promise<string | null> {\n try {\n if (isContextScanDisabled()) {\n return null\n }\n const cwd = getCwd()\n const instructionFiles = getProjectInstructionFiles(cwd)\n const legacyPath = join(cwd, 'CLAUDE.md')\n const hasLegacy = existsSync(legacyPath)\n\n if (instructionFiles.length === 0 && !hasLegacy) {\n return null\n }\n\n const fileTypes = new Set<string>()\n for (const f of instructionFiles) fileTypes.add(f.filename)\n if (hasLegacy) fileTypes.add('CLAUDE.md (legacy)')\n\n const allFiles = [\n ...instructionFiles.map(f => f.absolutePath),\n ...(hasLegacy ? [legacyPath] : []),\n ]\n\n return `NOTE: Additional project instruction files (${Array.from(fileTypes).join(', ')}) were found. When working in these directories, make sure to read and follow the instructions in the corresponding files:\\n${allFiles\n .map(_ => `- ${_}`)\n .join('\\n')}`\n } catch (error) {\n logError(error)\n return null\n }\n}\n\nexport function setContext(key: string, value: string): void {\n const projectConfig = getCurrentProjectConfig()\n const context = omit(\n { ...projectConfig.context, [key]: value },\n 'codeStyle',\n 'directoryStructure',\n )\n saveCurrentProjectConfig({ ...projectConfig, context })\n}\n\nexport function removeContext(key: string): void {\n const projectConfig = getCurrentProjectConfig()\n const context = omit(\n projectConfig.context,\n key,\n 'codeStyle',\n 'directoryStructure',\n )\n saveCurrentProjectConfig({ ...projectConfig, context })\n}\n\nexport const getReadme = memoize(async (): Promise<string | null> => {\n try {\n const readmePath = join(getCwd(), 'README.md')\n if (!existsSync(readmePath)) {\n return null\n }\n const content = await readFile(readmePath, 'utf-8')\n return content\n } catch (e) {\n logError(e)\n return null\n }\n})\n\nexport async function getProjectDocsForCwd(\n cwd: string,\n): Promise<string | null> {\n try {\n const instructionFiles = getProjectInstructionFiles(cwd)\n const legacyPath = join(cwd, 'CLAUDE.md')\n\n const docs = []\n\n if (instructionFiles.length > 0) {\n const { content } = readAndConcatProjectInstructionFiles(\n instructionFiles,\n { includeHeadings: true },\n )\n if (content.trim().length > 0) docs.push(content)\n }\n\n const rules = getProjectRules(cwd)\n if (rules.length > 0) {\n const formattedRules = `\n# Project Rules (MANDATORY)\nThe following content represents the immutable rules for this project.\n<project_rules>\n${rules.join('\\n\\n')}\n</project_rules>\n`.trim()\n docs.unshift(formattedRules)\n }\n\n if (existsSync(legacyPath)) {\n try {\n const content = await readFile(legacyPath, 'utf-8')\n docs.push(\n `# Legacy instructions (CLAUDE.md)\\n\\n${content}`,\n )\n } catch (e) {\n logError(e)\n }\n }\n\n return docs.length > 0 ? docs.join('\\n\\n---\\n\\n') : null\n } catch (e) {\n logError(e)\n return null\n }\n}\n\nexport const getProjectDocs = memoize(async (): Promise<string | null> => {\n return getProjectDocsForCwd(getCwd())\n})\n\nexport const getGitStatus = memoize(async (): Promise<string | null> => {\n if (process.env.NODE_ENV === 'test') {\n return null\n }\n if (!(await getIsGit())) {\n return null\n }\n\n try {\n const [branch, mainBranch, status, log, authorLog] = await Promise.all([\n execFileNoThrow(\n 'git',\n ['branch', '--show-current'],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.trim()),\n execFileNoThrow(\n 'git',\n ['rev-parse', '--abbrev-ref', 'origin/HEAD'],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.replace('origin/', '').trim()),\n execFileNoThrow(\n 'git',\n ['status', '--short'],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.trim()),\n execFileNoThrow(\n 'git',\n ['log', '--oneline', '-n', '5'],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.trim()),\n execFileNoThrow(\n 'git',\n [\n 'log',\n '--oneline',\n '-n',\n '5',\n '--author',\n (await getGitEmail()) || '',\n ],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.trim()),\n ])\n const statusLines = status.split('\\n').length\n const truncatedStatus =\n statusLines > 200\n ? status.split('\\n').slice(0, 200).join('\\n') +\n '\\n... (truncated because there are more than 200 lines. If you need more information, run \"git status\" using BashTool)'\n : status\n\n return `This is the git status at the start of the conversation. Note that this status is a snapshot in time, and will not update during the conversation.\\nCurrent branch: ${branch}\\n\\nMain branch (you will usually use this for PRs): ${mainBranch}\\n\\nStatus:\\n${truncatedStatus || '(clean)'}\\n\\nRecent commits:\\n${log}\\n\\nYour recent commits:\\n${authorLog || '(no recent commits)'}`\n } catch (error) {\n logError(error)\n return null\n }\n})\n\nexport const getContext = memoize(\n async (): Promise<{\n [k: string]: string\n }> => {\n const codeStyle = getCodeStyle()\n const projectConfig = getCurrentProjectConfig()\n const dontCrawl = projectConfig.dontCrawlDirectory || isContextScanDisabled()\n const [\n gitStatus,\n directoryStructure,\n instructionFilesNote,\n readme,\n projectDocs,\n ] = await Promise.all([\n getGitStatus(),\n dontCrawl ? Promise.resolve('') : getDirectoryStructure(),\n dontCrawl ? Promise.resolve('') : getInstructionFilesNote(),\n getReadme(),\n getProjectDocs(),\n ])\n return {\n ...projectConfig.context,\n ...(directoryStructure ? { directoryStructure } : {}),\n ...(gitStatus ? { gitStatus } : {}),\n ...(codeStyle ? { codeStyle } : {}),\n ...(instructionFilesNote ? { instructionFilesNote } : {}),\n ...(readme ? { readme } : {}),\n ...(projectDocs ? { projectDocs } : {}),\n }\n },\n)\n\nexport const getDirectoryStructure = memoize(\n async function (): Promise<string> {\n if (isContextScanDisabled()) {\n return ''\n }\n let lines: string\n try {\n lines = buildDirectoryStructure()\n } catch (error) {\n logError(error)\n return ''\n }\n\n return `Below is a snapshot of this project's file tree structure at the start of the conversation. This snapshot will NOT update during the conversation.\n\n${lines}`\n },\n)\n\nconst buildDirectoryStructure = (): string => {\n const entries = readdirSync(getCwd(), { withFileTypes: true })\n const directories = entries\n .filter(entry => entry.isDirectory())\n .map(entry => entry.name)\n .sort((a, b) => a.localeCompare(b))\n const files = entries\n .filter(entry => !entry.isDirectory())\n .map(entry => entry.name)\n .sort((a, b) => a.localeCompare(b))\n const root = getCwd()\n const rootLabel = root.endsWith(sep) ? root : `${root}${sep}`\n return renderTopLevelTree(rootLabel, directories, files)\n}\n\ntype WorkingDirectoryStructureStats = {\n topLevelDirectoryCount: number\n topLevelFileCount: number\n totalDirectoryCount: number\n totalFileCount: number\n directoryFileRatio: string\n maxDepth: number\n}\n\nconst ENV_STATS_IGNORE_PATTERNS = [\n 'node_modules/',\n '__pycache__/',\n '.git/',\n 'dist/',\n 'build/',\n 'target/',\n 'bin/',\n 'obj/',\n '.idea/',\n '.vscode/',\n '.zig-cache/',\n 'zig-out',\n '.coverage',\n 'coverage/',\n 'vendor/',\n 'tmp/',\n 'temp/',\n '.cache/',\n 'cache/',\n 'logs/',\n '.venv/',\n 'venv/',\n 'env/',\n]\n\nconst PROJECT_STRUCTURE_STATS_GUIDANCE =\n 'Based on current project structure statistics, preliminary complexity analysis: 1 High directory/file ratio \u2192 more fragmented structure, potentially finer hierarchy, higher complexity. 2 Deep max depth \u2192 obvious deep nesting, higher navigation and positioning cost. 3 Many top-level directories \u2192 scattered module entries, need stricter layer confirmation. 4 Large total files \u2192 more likely to trigger output truncation. Processing: Low complexity \u2192 use Glob \"dir/*\" to get structure clues then proceed to locate; High complexity \u2192 use Glob \"dir/*\" to get top-level clues first, then use Glob for layered path confirmation.'\n\nconst getWorkingDirectoryStructureStatsSnapshot = memoize(\n async (): Promise<WorkingDirectoryStructureStats | null> =>\n computeWorkingDirectoryStructureStats(),\n)\n\nexport function resetWorkingDirectoryStatsCacheForTests(): void {\n ;(getWorkingDirectoryStructureStatsSnapshot as any).cache?.clear?.()\n}\n\nexport async function getWorkingDirectoryStructureStats(): Promise<WorkingDirectoryStructureStats | null> {\n const mode = String(process.env.PYB_ENV_STATS_MODE || 'realtime')\n .trim()\n .toLowerCase()\n if (mode === 'snapshot') {\n return getWorkingDirectoryStructureStatsSnapshot()\n }\n return computeWorkingDirectoryStructureStats()\n}\n\nexport async function getProjectStructureStatisticsBlock(): Promise<string> {\n if (isContextScanDisabled()) return ''\n const stats = await getWorkingDirectoryStructureStats()\n if (!stats) return ''\n const statsLine = `\u5F53\u524D\u9879\u76EE\u7EDF\u8BA1\u4FE1\u606F: \u9876\u5C42\u76EE\u5F55\u6570\uFF1A${stats.topLevelDirectoryCount}\u4E2A\uFF0C\u9876\u5C42\u6587\u4EF6\u6570\uFF1A${stats.topLevelFileCount}\u4E2A\uFF0C\u603B\u76EE\u5F55\u6570\uFF1A${stats.totalDirectoryCount}\u4E2A\uFF0C\u603B\u6587\u4EF6\u6570\uFF1A${stats.totalFileCount}\u4E2A\uFF0C\u603B\u76EE\u5F55/\u603B\u6587\u4EF6\u6BD4\u4F8B=${stats.directoryFileRatio}\uFF0C\u6700\u6DF1\u76EE\u5F55\u5C42\u7EA7=${stats.maxDepth}\u3002\uFF08\u7EDF\u8BA1\u6570\u636E\u4E0D\u5305\u542B\u7A7A\u76EE\u5F55\u4EE5\u53CA\u5E38\u89C1\u975E\u6838\u5FC3\u76EE\u5F55/\u6784\u5EFA\u4EA7\u7269/\u4F9D\u8D56\u7F13\u5B58\u7B49\u6587\u4EF6\u6216\u76EE\u5F55\uFF09`\n return `<context name=\"Project Structure Statistics\">\\n${PROJECT_STRUCTURE_STATS_GUIDANCE}\\n\\n${statsLine}</context>`\n}\n\nconst computeWorkingDirectoryStructureStats = async (): Promise<WorkingDirectoryStructureStats | null> => {\n const cwd = getCwd()\n const abortController = new AbortController()\n const rgIgnoreGlobs = ENV_STATS_IGNORE_PATTERNS.map(pattern => `!${pattern}*`)\n const rgArgs = [\n '--files',\n ...rgIgnoreGlobs.flatMap(pattern => ['--glob', pattern]),\n ]\n const result = await ripGrepWithStatus(rgArgs, cwd, abortController.signal)\n if (result.status !== 'ok') return null\n const matchIgnorePatterns = ENV_STATS_IGNORE_PATTERNS.map(pattern =>\n pattern.endsWith('/') ? `${pattern}**` : pattern,\n )\n const files = result.files\n .filter(Boolean)\n .map(file => {\n const absolutePath = isAbsolute(file) ? file : resolve(cwd, file)\n const relativePath = relative(cwd, absolutePath)\n const normalized = relativePath.split(sep).join('/')\n return { normalized }\n })\n .filter(entry => {\n if (matchIgnorePatterns.length === 0) return true\n return !matchIgnorePatterns.some(pattern =>\n minimatch(entry.normalized, pattern, { dot: true, nocase: false }),\n )\n })\n const totalFileCount = files.length\n const directorySet = getDirectorySet(files.map(entry => entry.normalized))\n let maxDepth = 0\n for (const entry of files) {\n const parts = entry.normalized.split('/').filter(Boolean)\n const depth = Math.max(0, parts.length - 1)\n if (depth > maxDepth) maxDepth = depth\n }\n const ratio =\n totalFileCount === 0\n ? '0.00'\n : (directorySet.size / totalFileCount).toFixed(2)\n const topLevelEntries = readdirSync(cwd, { withFileTypes: true })\n const visibleTopLevel = topLevelEntries.filter(entry => {\n const normalized = entry.isDirectory() ? `${entry.name}/` : entry.name\n if (matchIgnorePatterns.length === 0) return true\n return !matchIgnorePatterns.some(pattern =>\n minimatch(normalized, pattern, { dot: true, nocase: false }),\n )\n })\n const topLevelDirectoryCount = visibleTopLevel.filter(entry =>\n entry.isDirectory(),\n ).length\n const topLevelFileCount = visibleTopLevel.filter(\n entry => !entry.isDirectory(),\n ).length\n return {\n topLevelDirectoryCount,\n topLevelFileCount,\n totalDirectoryCount: directorySet.size,\n totalFileCount,\n directoryFileRatio: ratio,\n maxDepth,\n }\n}\n\nconst getDirectorySet = (paths: string[]) => {\n const directories = new Set<string>()\n for (const entry of paths) {\n const parts = entry.split('/').filter(Boolean)\n if (parts.length <= 1) continue\n for (let i = 0; i < parts.length - 1; i++) {\n directories.add(parts.slice(0, i + 1).join('/'))\n }\n }\n return directories\n}\n\nconst renderTopLevelTree = (\n rootLabel: string,\n directories: string[],\n files: string[],\n): string => {\n const items = [\n ...directories.map(name => ({ name: `${name}${sep}`, isDir: true })),\n ...files.map(name => ({ name, isDir: false })),\n ]\n const lines: string[] = []\n lines.push(rootLabel)\n for (let i = 0; i < items.length; i++) {\n const connector = i === items.length - 1 ? '\u2514\u2500\u2500 ' : '\u251C\u2500\u2500 '\n lines.push(`${connector}${items[i].name}`)\n }\n return lines.join('\\n')\n}\n", "import { memoize } from 'lodash-es'\nimport { execFileNoThrow } from './execFileNoThrow'\n\nexport const getIsGit = memoize(async (): Promise<boolean> => {\n const { code } = await execFileNoThrow('git', [\n 'rev-parse',\n '--is-inside-work-tree',\n ])\n return code === 0\n})\n\nexport const getHead = async (): Promise<string> => {\n const { stdout } = await execFileNoThrow('git', ['rev-parse', 'HEAD'])\n return stdout.trim()\n}\n\nexport const getBranch = async (): Promise<string> => {\n const { stdout } = await execFileNoThrow(\n 'git',\n ['rev-parse', '--abbrev-ref', 'HEAD'],\n undefined,\n undefined,\n false,\n )\n return stdout.trim()\n}\n\nexport const getRemoteUrl = async (): Promise<string | null> => {\n const { stdout, code } = await execFileNoThrow(\n 'git',\n ['remote', 'get-url', 'origin'],\n undefined,\n undefined,\n false,\n )\n return code === 0 ? stdout.trim() : null\n}\n\nexport const getIsHeadOnRemote = async (): Promise<boolean> => {\n const { code } = await execFileNoThrow(\n 'git',\n ['rev-parse', '@{u}'],\n undefined,\n undefined,\n false,\n )\n return code === 0\n}\n\nexport const getIsClean = async (): Promise<boolean> => {\n const { stdout } = await execFileNoThrow(\n 'git',\n ['status', '--porcelain'],\n undefined,\n undefined,\n false,\n )\n return stdout.trim().length === 0\n}\n\nexport interface GitRepoState {\n commitHash: string\n branchName: string\n remoteUrl: string | null\n isHeadOnRemote: boolean\n isClean: boolean\n}\n\nexport async function getGitState(): Promise<GitRepoState | null> {\n try {\n const [commitHash, branchName, remoteUrl, isHeadOnRemote, isClean] =\n await Promise.all([\n getHead(),\n getBranch(),\n getRemoteUrl(),\n getIsHeadOnRemote(),\n getIsClean(),\n ])\n\n return {\n commitHash,\n branchName,\n remoteUrl,\n isHeadOnRemote,\n isClean,\n }\n } catch (_) {\n return null\n }\n}\n", "import { getGlobalConfig, getOrCreateUserID } from '@utils/config'\nimport { memoize } from 'lodash-es'\nimport { env } from '@utils/config/env'\nimport { execFileNoThrow } from '@utils/system/execFileNoThrow'\nimport { logError, SESSION_ID } from '@utils/log'\nimport { MACRO } from '@constants/macros'\nexport const getGitEmail = memoize(async (): Promise<string | undefined> => {\n const result = await execFileNoThrow('git', ['config', 'user.email'])\n if (result.code !== 0) {\n logError(`Failed to get git email: ${result.stdout} ${result.stderr}`)\n return undefined\n }\n return result.stdout.trim() || undefined\n})\n\ntype SimpleUser = {\n customIDs?: Record<string, string>\n userID: string\n appVersion?: string\n userAgent?: string\n email?: string\n custom?: Record<string, unknown>\n}\n\nexport const getUser = memoize(async (): Promise<SimpleUser> => {\n const userID = getOrCreateUserID()\n const config = getGlobalConfig()\n const email = undefined\n return {\n customIDs: {\n sessionId: SESSION_ID,\n },\n userID,\n appVersion: MACRO.VERSION,\n userAgent: env.platform,\n email,\n custom: {\n nodeVersion: env.nodeVersion,\n userType: process.env.USER_TYPE,\n organizationUuid: config.oauthAccount?.organizationUuid,\n accountUuid: config.oauthAccount?.accountUuid,\n },\n }\n})\n", "import { existsSync, readdirSync, readFileSync, statSync } from 'fs'\r\nimport { join, relative, resolve } from 'path'\r\nimport matter from 'gray-matter'\r\nimport { minimatch } from 'minimatch'\r\nimport { findGitRoot, getDirsFromGitRootToCwd } from './projectInstructions'\r\nimport { logError } from '@utils/log'\r\n\r\nexport interface RuleFile {\r\n filename: string\r\n content: string\r\n paths?: string[]\r\n}\r\n\r\nfunction getRulesFromDir(dir: string, root: string, cwd: string): string[] {\r\n if (!existsSync(dir)) return []\r\n\r\n const rules: string[] = []\r\n const files = readdirSync(dir)\r\n\r\n for (const file of files) {\r\n if (!file.endsWith('.md')) continue\r\n\r\n const filePath = join(dir, file)\r\n if (!statSync(filePath).isFile()) continue\r\n\r\n try {\r\n const fileContent = readFileSync(filePath, 'utf-8')\r\n // gray-matter by default uses js-yaml.safeLoad which is removed in js-yaml v4.\r\n // We need to provide a custom parser if we want to be safe, or rely on gray-matter's auto-detection if updated.\r\n // However, looking at the error \"Function yaml.safeLoad is removed\", it seems gray-matter 4.0.3 (in package.json)\r\n // might not be fully compatible with js-yaml 4.x out of the box without options?\r\n // Actually, checking gray-matter docs/issues, v4.0.3 should work.\r\n // But the error comes from gray-matter calling yaml.safeLoad.\r\n \r\n // Solution: Pass a custom parser engine to gray-matter\r\n const yaml = require('js-yaml')\r\n const matterOptions = {\r\n engines: {\r\n yaml: {\r\n parse: yaml.load.bind(yaml),\r\n stringify: yaml.dump.bind(yaml)\r\n }\r\n }\r\n }\r\n \r\n const { content, data } = matter(fileContent, matterOptions)\r\n \r\n // User rule: If no paths (YAML frontmatter), it applies globally.\r\n if (!data.paths || !Array.isArray(data.paths) || data.paths.length === 0) {\r\n rules.push(content.trim())\r\n continue\r\n }\r\n\r\n // If paths are specified, check if current context (cwd) matches\r\n // This is a simplification. Ideally we'd check active files, but cwd is a good proxy.\r\n const relCwd = relative(root, cwd)\r\n // On Windows, relative paths might use backslashes, but glob patterns usually expect forward slashes.\r\n // Also ensure we don't have a leading slash unless absolute, but relative returns without leading slash usually.\r\n // However, if relCwd is empty (cwd == root), we want it to match \"**\" but maybe not \"src/**\".\r\n // If relCwd is \"src\", it matches \"src/**\".\r\n \r\n const normalizedRelCwd = relCwd.split('\\\\').join('/')\r\n\r\n // Let's iterate over paths patterns\r\n const hasMatch = data.paths.some((pattern: string) => {\r\n // minimatch(path, pattern)\r\n // If pattern is \"src/**\", and path is \"src\", minimatch(\"src\", \"src/**\") is FALSE.\r\n // We need to check if the path is INSIDE the pattern.\r\n // But the rules say: \"Rules are included when the file being edited matches the path\".\r\n // Since we are approximating by CWD, we should check:\r\n // 1. Is CWD inside the pattern? (e.g. pattern=\"src/**\", cwd=\"src/utils\" -> YES)\r\n // 2. Is CWD the pattern itself? (e.g. pattern=\"src\", cwd=\"src\" -> YES)\r\n // 3. Is the pattern inside CWD? (e.g. pattern=\"src/utils/**\", cwd=\"src\" -> Maybe? If I edit src/index.ts, no. If I edit src/utils/foo.ts, yes.)\r\n \r\n // Let's stick to: CWD must match the pattern OR be a child of the pattern.\r\n // minimatch(\"src/utils\", \"src/**\") -> true\r\n \r\n // Debugging logs in test might help, but let's try to be more robust.\r\n // Maybe \"src\" does NOT match \"src/**\" in minimatch?\r\n // \"src/\" matches \"src/**\"?\r\n \r\n if (minimatch(normalizedRelCwd, pattern)) return true\r\n \r\n // Try appending slash if not empty\r\n if (normalizedRelCwd && minimatch(normalizedRelCwd + '/', pattern)) return true\r\n \r\n return false\r\n })\r\n\r\n if (hasMatch) {\r\n rules.push(content.trim())\r\n }\r\n } catch (e) {\r\n logError(e)\r\n }\r\n }\r\n\r\n return rules\r\n}\r\n\r\nexport function getProjectRules(cwd: string): string[] {\r\n const gitRoot = findGitRoot(cwd)\r\n const root = gitRoot ?? resolve(cwd)\r\n const dirs = getDirsFromGitRootToCwd(root, cwd)\r\n\r\n const rules: string[] = []\r\n\r\n // Iterate from root down to cwd to collect rules from .claude/rules, .cursor/rules and .pyb/rules\r\n for (const dir of dirs) {\r\n // .claude/rules\r\n const claudeRulesDir = join(dir, '.claude', 'rules')\r\n rules.push(...getRulesFromDir(claudeRulesDir, root, cwd))\r\n\r\n // .cursor/rules\r\n const cursorRulesDir = join(dir, '.cursor', 'rules')\r\n rules.push(...getRulesFromDir(cursorRulesDir, root, cwd))\r\n\r\n // .pyb/rules\r\n const pybRulesDir = join(dir, '.pyb', 'rules')\r\n rules.push(...getRulesFromDir(pybRulesDir, root, cwd))\r\n }\r\n\r\n return rules\r\n}\r\n"],
4
+ "sourcesContent": ["import { readFileSync } from 'fs'\nimport { memoize } from 'lodash-es'\nimport { getCwd } from '@utils/state'\nimport { getProjectInstructionFiles } from './projectInstructions'\n\nconst STYLE_PROMPT =\n 'The codebase follows strict style guidelines shown below. All code changes must strictly adhere to these guidelines to maintain consistency and quality.'\n\nexport const getCodeStyle = memoize((): string => {\n const styles: string[] = []\n\n const instructionFiles = getProjectInstructionFiles(getCwd())\n for (const file of instructionFiles) {\n try {\n styles.push(\n `Contents of ${file.absolutePath}:\\n\\n${readFileSync(file.absolutePath, 'utf-8')}`,\n )\n } catch {\n }\n }\n\n if (styles.length === 0) {\n return ''\n }\n\n return `${STYLE_PROMPT}\\n\\n${styles.join('\\n\\n')}`\n})\n", "import {\n getCurrentProjectConfig,\n saveCurrentProjectConfig,\n} from '@utils/config'\nimport { logError } from '@utils/log'\nimport { getCodeStyle } from '@utils/config/style'\nimport { isContextScanDisabled } from '@utils/config/env'\nimport { getCwd } from '@utils/state'\nimport { memoize, omit } from 'lodash-es'\nimport { getIsGit } from '@utils/system/git'\nimport { execFileNoThrow } from '@utils/system/execFileNoThrow'\nimport { isAbsolute, join, relative, resolve, sep } from 'path'\nimport { readFile } from 'fs/promises'\nimport { existsSync, readdirSync } from 'fs'\nimport { getModelManager } from '@utils/model'\nimport { lastX } from '@utils/text/generators'\nimport { getGitEmail } from '@utils/identity/user'\nimport {\n getProjectInstructionFiles,\n readAndConcatProjectInstructionFiles,\n} from '@utils/config/projectInstructions'\nimport { getProjectRules } from '@utils/config/rules'\nimport { ripGrepWithStatus } from '@utils/system/ripgrep'\nimport { minimatch } from 'minimatch'\n\nexport async function getInstructionFilesNote(): Promise<string | null> {\n try {\n if (isContextScanDisabled()) {\n return null\n }\n const cwd = getCwd()\n const instructionFiles = getProjectInstructionFiles(cwd)\n const legacyPath = join(cwd, 'CLAUDE.md')\n const hasLegacy = existsSync(legacyPath)\n\n if (instructionFiles.length === 0 && !hasLegacy) {\n return null\n }\n\n const fileTypes = new Set<string>()\n for (const f of instructionFiles) fileTypes.add(f.filename)\n if (hasLegacy) fileTypes.add('CLAUDE.md (legacy)')\n\n const allFiles = [\n ...instructionFiles.map(f => f.absolutePath),\n ...(hasLegacy ? [legacyPath] : []),\n ]\n\n return `NOTE: Additional project instruction files (${Array.from(fileTypes).join(', ')}) were found. When working in these directories, make sure to read and follow the instructions in the corresponding files:\\n${allFiles\n .map(_ => `- ${_}`)\n .join('\\n')}`\n } catch (error) {\n logError(error)\n return null\n }\n}\n\nexport function setContext(key: string, value: string): void {\n const projectConfig = getCurrentProjectConfig()\n const context = omit(\n { ...projectConfig.context, [key]: value },\n 'codeStyle',\n 'directoryStructure',\n )\n saveCurrentProjectConfig({ ...projectConfig, context })\n}\n\nexport function removeContext(key: string): void {\n const projectConfig = getCurrentProjectConfig()\n const context = omit(\n projectConfig.context,\n key,\n 'codeStyle',\n 'directoryStructure',\n )\n saveCurrentProjectConfig({ ...projectConfig, context })\n}\n\nexport const getReadme = memoize(async (): Promise<string | null> => {\n try {\n const readmePath = join(getCwd(), 'README.md')\n if (!existsSync(readmePath)) {\n return null\n }\n const content = await readFile(readmePath, 'utf-8')\n return content\n } catch (e) {\n logError(e)\n return null\n }\n})\n\nexport async function getProjectDocsForCwd(\n cwd: string,\n): Promise<string | null> {\n try {\n const instructionFiles = getProjectInstructionFiles(cwd)\n const legacyPath = join(cwd, 'CLAUDE.md')\n\n const docs = []\n\n if (instructionFiles.length > 0) {\n const { content } = readAndConcatProjectInstructionFiles(\n instructionFiles,\n { includeHeadings: true },\n )\n if (content.trim().length > 0) docs.push(content)\n }\n\n const rules = getProjectRules(cwd)\n if (rules.length > 0) {\n const formattedRules = `\n# Project Rules (MANDATORY)\nThe following content represents the immutable rules for this project.\n<project_rules>\n${rules.join('\\n\\n')}\n</project_rules>\n`.trim()\n docs.unshift(formattedRules)\n }\n\n if (existsSync(legacyPath)) {\n try {\n const content = await readFile(legacyPath, 'utf-8')\n docs.push(\n `# Legacy instructions (CLAUDE.md)\\n\\n${content}`,\n )\n } catch (e) {\n logError(e)\n }\n }\n\n return docs.length > 0 ? docs.join('\\n\\n---\\n\\n') : null\n } catch (e) {\n logError(e)\n return null\n }\n}\n\nexport const getProjectDocs = memoize(async (): Promise<string | null> => {\n return getProjectDocsForCwd(getCwd())\n})\n\nexport const getGitStatus = memoize(async (): Promise<string | null> => {\n if (process.env.NODE_ENV === 'test') {\n return null\n }\n if (!(await getIsGit())) {\n return null\n }\n\n try {\n const [branch, mainBranch, status, log, authorLog] = await Promise.all([\n execFileNoThrow(\n 'git',\n ['branch', '--show-current'],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.trim()),\n execFileNoThrow(\n 'git',\n ['rev-parse', '--abbrev-ref', 'origin/HEAD'],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.replace('origin/', '').trim()),\n execFileNoThrow(\n 'git',\n ['status', '--short'],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.trim()),\n execFileNoThrow(\n 'git',\n ['log', '--oneline', '-n', '5'],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.trim()),\n execFileNoThrow(\n 'git',\n [\n 'log',\n '--oneline',\n '-n',\n '5',\n '--author',\n (await getGitEmail()) || '',\n ],\n undefined,\n undefined,\n false,\n ).then(({ stdout }) => stdout.trim()),\n ])\n const statusLines = status.split('\\n').length\n const truncatedStatus =\n statusLines > 200\n ? status.split('\\n').slice(0, 200).join('\\n') +\n '\\n... (truncated because there are more than 200 lines. If you need more information, run \"git status\" using BashTool)'\n : status\n\n return `This is the git status at the start of the conversation. Note that this status is a snapshot in time, and will not update during the conversation.\\nCurrent branch: ${branch}\\n\\nMain branch (you will usually use this for PRs): ${mainBranch}\\n\\nStatus:\\n${truncatedStatus || '(clean)'}\\n\\nRecent commits:\\n${log}\\n\\nYour recent commits:\\n${authorLog || '(no recent commits)'}`\n } catch (error) {\n logError(error)\n return null\n }\n})\n\nexport const getContext = memoize(\n async (): Promise<{\n [k: string]: string\n }> => {\n const codeStyle = getCodeStyle()\n const projectConfig = getCurrentProjectConfig()\n const dontCrawl = projectConfig.dontCrawlDirectory || isContextScanDisabled()\n const [\n gitStatus,\n directoryStructure,\n instructionFilesNote,\n readme,\n projectDocs,\n ] = await Promise.all([\n getGitStatus(),\n dontCrawl ? Promise.resolve('') : getDirectoryStructure(),\n dontCrawl ? Promise.resolve('') : getInstructionFilesNote(),\n getReadme(),\n getProjectDocs(),\n ])\n return {\n ...projectConfig.context,\n ...(directoryStructure ? { directoryStructure } : {}),\n ...(gitStatus ? { gitStatus } : {}),\n ...(codeStyle ? { codeStyle } : {}),\n ...(instructionFilesNote ? { instructionFilesNote } : {}),\n ...(readme ? { readme } : {}),\n ...(projectDocs ? { projectDocs } : {}),\n }\n },\n)\n\nexport const getDirectoryStructure = memoize(\n async function (): Promise<string> {\n if (isContextScanDisabled()) {\n return ''\n }\n let lines: string\n try {\n lines = buildDirectoryStructure()\n } catch (error) {\n logError(error)\n return ''\n }\n\n return `Below is a snapshot of this project's file tree structure at the start of the conversation. This snapshot will NOT update during the conversation.\n\n${lines}`\n },\n)\n\nconst buildDirectoryStructure = (): string => {\n const entries = readdirSync(getCwd(), { withFileTypes: true })\n const directories = entries\n .filter(entry => entry.isDirectory())\n .map(entry => entry.name)\n .sort((a, b) => a.localeCompare(b))\n const files = entries\n .filter(entry => !entry.isDirectory())\n .map(entry => entry.name)\n .sort((a, b) => a.localeCompare(b))\n const root = getCwd()\n const rootLabel = root.endsWith(sep) ? root : `${root}${sep}`\n return renderTopLevelTree(rootLabel, directories, files)\n}\n\ntype WorkingDirectoryStructureStats = {\n topLevelDirectoryCount: number\n topLevelFileCount: number\n totalDirectoryCount: number\n totalFileCount: number\n directoryFileRatio: string\n maxDepth: number\n}\n\nconst ENV_STATS_IGNORE_PATTERNS = [\n 'node_modules/',\n '__pycache__/',\n '.git/',\n 'dist/',\n 'build/',\n 'target/',\n 'bin/',\n 'obj/',\n '.idea/',\n '.vscode/',\n '.zig-cache/',\n 'zig-out',\n '.coverage',\n 'coverage/',\n 'vendor/',\n 'tmp/',\n 'temp/',\n '.cache/',\n 'cache/',\n 'logs/',\n '.venv/',\n 'venv/',\n 'env/',\n]\n\nconst PROJECT_STRUCTURE_STATS_GUIDANCE =\n 'Based on current project structure statistics, preliminary complexity analysis: 1 High directory/file ratio \u2192 more fragmented structure, potentially finer hierarchy, higher complexity. 2 Deep max depth \u2192 obvious deep nesting, higher navigation and positioning cost. 3 Many top-level directories \u2192 scattered module entries, need stricter layer confirmation. 4 Large total files \u2192 more likely to trigger output truncation. Processing: Low complexity \u2192 read target directory paths for one-level structure clues, then proceed to locate; High complexity \u2192 read top-level directory paths first, then use Glob for layered path confirmation.'\n\nconst getWorkingDirectoryStructureStatsSnapshot = memoize(\n async (): Promise<WorkingDirectoryStructureStats | null> =>\n computeWorkingDirectoryStructureStats(),\n)\n\nexport function resetWorkingDirectoryStatsCacheForTests(): void {\n ;(getWorkingDirectoryStructureStatsSnapshot as any).cache?.clear?.()\n}\n\nexport async function getWorkingDirectoryStructureStats(): Promise<WorkingDirectoryStructureStats | null> {\n const mode = String(process.env.PYB_ENV_STATS_MODE || 'realtime')\n .trim()\n .toLowerCase()\n if (mode === 'snapshot') {\n return getWorkingDirectoryStructureStatsSnapshot()\n }\n return computeWorkingDirectoryStructureStats()\n}\n\nexport async function getProjectStructureStatisticsBlock(): Promise<string> {\n if (isContextScanDisabled()) return ''\n const stats = await getWorkingDirectoryStructureStats()\n if (!stats) return ''\n const statsLine = `\u5F53\u524D\u9879\u76EE\u7EDF\u8BA1\u4FE1\u606F: \u9876\u5C42\u76EE\u5F55\u6570\uFF1A${stats.topLevelDirectoryCount}\u4E2A\uFF0C\u9876\u5C42\u6587\u4EF6\u6570\uFF1A${stats.topLevelFileCount}\u4E2A\uFF0C\u603B\u76EE\u5F55\u6570\uFF1A${stats.totalDirectoryCount}\u4E2A\uFF0C\u603B\u6587\u4EF6\u6570\uFF1A${stats.totalFileCount}\u4E2A\uFF0C\u603B\u76EE\u5F55/\u603B\u6587\u4EF6\u6BD4\u4F8B=${stats.directoryFileRatio}\uFF0C\u6700\u6DF1\u76EE\u5F55\u5C42\u7EA7=${stats.maxDepth}\u3002\uFF08\u7EDF\u8BA1\u6570\u636E\u4E0D\u5305\u542B\u7A7A\u76EE\u5F55\u4EE5\u53CA\u5E38\u89C1\u975E\u6838\u5FC3\u76EE\u5F55/\u6784\u5EFA\u4EA7\u7269/\u4F9D\u8D56\u7F13\u5B58\u7B49\u6587\u4EF6\u6216\u76EE\u5F55\uFF09`\n return `<context name=\"Project Structure Statistics\">\\n${PROJECT_STRUCTURE_STATS_GUIDANCE}\\n\\n${statsLine}</context>`\n}\n\nconst computeWorkingDirectoryStructureStats = async (): Promise<WorkingDirectoryStructureStats | null> => {\n const cwd = getCwd()\n const abortController = new AbortController()\n const rgIgnoreGlobs = ENV_STATS_IGNORE_PATTERNS.map(pattern => `!${pattern}*`)\n const rgArgs = [\n '--files',\n ...rgIgnoreGlobs.flatMap(pattern => ['--glob', pattern]),\n ]\n const result = await ripGrepWithStatus(rgArgs, cwd, abortController.signal)\n if (result.status !== 'ok') return null\n const matchIgnorePatterns = ENV_STATS_IGNORE_PATTERNS.map(pattern =>\n pattern.endsWith('/') ? `${pattern}**` : pattern,\n )\n const files = result.files\n .filter(Boolean)\n .map(file => {\n const absolutePath = isAbsolute(file) ? file : resolve(cwd, file)\n const relativePath = relative(cwd, absolutePath)\n const normalized = relativePath.split(sep).join('/')\n return { normalized }\n })\n .filter(entry => {\n if (matchIgnorePatterns.length === 0) return true\n return !matchIgnorePatterns.some(pattern =>\n minimatch(entry.normalized, pattern, { dot: true, nocase: false }),\n )\n })\n const totalFileCount = files.length\n const directorySet = getDirectorySet(files.map(entry => entry.normalized))\n let maxDepth = 0\n for (const entry of files) {\n const parts = entry.normalized.split('/').filter(Boolean)\n const depth = Math.max(0, parts.length - 1)\n if (depth > maxDepth) maxDepth = depth\n }\n const ratio =\n totalFileCount === 0\n ? '0.00'\n : (directorySet.size / totalFileCount).toFixed(2)\n const topLevelEntries = readdirSync(cwd, { withFileTypes: true })\n const visibleTopLevel = topLevelEntries.filter(entry => {\n const normalized = entry.isDirectory() ? `${entry.name}/` : entry.name\n if (matchIgnorePatterns.length === 0) return true\n return !matchIgnorePatterns.some(pattern =>\n minimatch(normalized, pattern, { dot: true, nocase: false }),\n )\n })\n const topLevelDirectoryCount = visibleTopLevel.filter(entry =>\n entry.isDirectory(),\n ).length\n const topLevelFileCount = visibleTopLevel.filter(\n entry => !entry.isDirectory(),\n ).length\n return {\n topLevelDirectoryCount,\n topLevelFileCount,\n totalDirectoryCount: directorySet.size,\n totalFileCount,\n directoryFileRatio: ratio,\n maxDepth,\n }\n}\n\nconst getDirectorySet = (paths: string[]) => {\n const directories = new Set<string>()\n for (const entry of paths) {\n const parts = entry.split('/').filter(Boolean)\n if (parts.length <= 1) continue\n for (let i = 0; i < parts.length - 1; i++) {\n directories.add(parts.slice(0, i + 1).join('/'))\n }\n }\n return directories\n}\n\nconst renderTopLevelTree = (\n rootLabel: string,\n directories: string[],\n files: string[],\n): string => {\n const items = [\n ...directories.map(name => ({ name: `${name}${sep}`, isDir: true })),\n ...files.map(name => ({ name, isDir: false })),\n ]\n const lines: string[] = []\n lines.push(rootLabel)\n for (let i = 0; i < items.length; i++) {\n const connector = i === items.length - 1 ? '\u2514\u2500\u2500 ' : '\u251C\u2500\u2500 '\n lines.push(`${connector}${items[i].name}`)\n }\n return lines.join('\\n')\n}\n", "import { memoize } from 'lodash-es'\nimport { execFileNoThrow } from './execFileNoThrow'\n\nexport const getIsGit = memoize(async (): Promise<boolean> => {\n const { code } = await execFileNoThrow('git', [\n 'rev-parse',\n '--is-inside-work-tree',\n ])\n return code === 0\n})\n\nexport const getHead = async (): Promise<string> => {\n const { stdout } = await execFileNoThrow('git', ['rev-parse', 'HEAD'])\n return stdout.trim()\n}\n\nexport const getBranch = async (): Promise<string> => {\n const { stdout } = await execFileNoThrow(\n 'git',\n ['rev-parse', '--abbrev-ref', 'HEAD'],\n undefined,\n undefined,\n false,\n )\n return stdout.trim()\n}\n\nexport const getRemoteUrl = async (): Promise<string | null> => {\n const { stdout, code } = await execFileNoThrow(\n 'git',\n ['remote', 'get-url', 'origin'],\n undefined,\n undefined,\n false,\n )\n return code === 0 ? stdout.trim() : null\n}\n\nexport const getIsHeadOnRemote = async (): Promise<boolean> => {\n const { code } = await execFileNoThrow(\n 'git',\n ['rev-parse', '@{u}'],\n undefined,\n undefined,\n false,\n )\n return code === 0\n}\n\nexport const getIsClean = async (): Promise<boolean> => {\n const { stdout } = await execFileNoThrow(\n 'git',\n ['status', '--porcelain'],\n undefined,\n undefined,\n false,\n )\n return stdout.trim().length === 0\n}\n\nexport interface GitRepoState {\n commitHash: string\n branchName: string\n remoteUrl: string | null\n isHeadOnRemote: boolean\n isClean: boolean\n}\n\nexport async function getGitState(): Promise<GitRepoState | null> {\n try {\n const [commitHash, branchName, remoteUrl, isHeadOnRemote, isClean] =\n await Promise.all([\n getHead(),\n getBranch(),\n getRemoteUrl(),\n getIsHeadOnRemote(),\n getIsClean(),\n ])\n\n return {\n commitHash,\n branchName,\n remoteUrl,\n isHeadOnRemote,\n isClean,\n }\n } catch (_) {\n return null\n }\n}\n", "import { getGlobalConfig, getOrCreateUserID } from '@utils/config'\nimport { memoize } from 'lodash-es'\nimport { env } from '@utils/config/env'\nimport { execFileNoThrow } from '@utils/system/execFileNoThrow'\nimport { logError, SESSION_ID } from '@utils/log'\nimport { MACRO } from '@constants/macros'\nexport const getGitEmail = memoize(async (): Promise<string | undefined> => {\n const result = await execFileNoThrow('git', ['config', 'user.email'])\n if (result.code !== 0) {\n logError(`Failed to get git email: ${result.stdout} ${result.stderr}`)\n return undefined\n }\n return result.stdout.trim() || undefined\n})\n\ntype SimpleUser = {\n customIDs?: Record<string, string>\n userID: string\n appVersion?: string\n userAgent?: string\n email?: string\n custom?: Record<string, unknown>\n}\n\nexport const getUser = memoize(async (): Promise<SimpleUser> => {\n const userID = getOrCreateUserID()\n const config = getGlobalConfig()\n const email = undefined\n return {\n customIDs: {\n sessionId: SESSION_ID,\n },\n userID,\n appVersion: MACRO.VERSION,\n userAgent: env.platform,\n email,\n custom: {\n nodeVersion: env.nodeVersion,\n userType: process.env.USER_TYPE,\n organizationUuid: config.oauthAccount?.organizationUuid,\n accountUuid: config.oauthAccount?.accountUuid,\n },\n }\n})\n", "import { existsSync, readdirSync, readFileSync, statSync } from 'fs'\r\nimport { join, relative, resolve } from 'path'\r\nimport matter from 'gray-matter'\r\nimport { minimatch } from 'minimatch'\r\nimport { findGitRoot, getDirsFromGitRootToCwd } from './projectInstructions'\r\nimport { logError } from '@utils/log'\r\n\r\nexport interface RuleFile {\r\n filename: string\r\n content: string\r\n paths?: string[]\r\n}\r\n\r\nfunction getRulesFromDir(dir: string, root: string, cwd: string): string[] {\r\n if (!existsSync(dir)) return []\r\n\r\n const rules: string[] = []\r\n const files = readdirSync(dir)\r\n\r\n for (const file of files) {\r\n if (!file.endsWith('.md')) continue\r\n\r\n const filePath = join(dir, file)\r\n if (!statSync(filePath).isFile()) continue\r\n\r\n try {\r\n const fileContent = readFileSync(filePath, 'utf-8')\r\n // gray-matter by default uses js-yaml.safeLoad which is removed in js-yaml v4.\r\n // We need to provide a custom parser if we want to be safe, or rely on gray-matter's auto-detection if updated.\r\n // However, looking at the error \"Function yaml.safeLoad is removed\", it seems gray-matter 4.0.3 (in package.json)\r\n // might not be fully compatible with js-yaml 4.x out of the box without options?\r\n // Actually, checking gray-matter docs/issues, v4.0.3 should work.\r\n // But the error comes from gray-matter calling yaml.safeLoad.\r\n \r\n // Solution: Pass a custom parser engine to gray-matter\r\n const yaml = require('js-yaml')\r\n const matterOptions = {\r\n engines: {\r\n yaml: {\r\n parse: yaml.load.bind(yaml),\r\n stringify: yaml.dump.bind(yaml)\r\n }\r\n }\r\n }\r\n \r\n const { content, data } = matter(fileContent, matterOptions)\r\n \r\n // User rule: If no paths (YAML frontmatter), it applies globally.\r\n if (!data.paths || !Array.isArray(data.paths) || data.paths.length === 0) {\r\n rules.push(content.trim())\r\n continue\r\n }\r\n\r\n // If paths are specified, check if current context (cwd) matches\r\n // This is a simplification. Ideally we'd check active files, but cwd is a good proxy.\r\n const relCwd = relative(root, cwd)\r\n // On Windows, relative paths might use backslashes, but glob patterns usually expect forward slashes.\r\n // Also ensure we don't have a leading slash unless absolute, but relative returns without leading slash usually.\r\n // However, if relCwd is empty (cwd == root), we want it to match \"**\" but maybe not \"src/**\".\r\n // If relCwd is \"src\", it matches \"src/**\".\r\n \r\n const normalizedRelCwd = relCwd.split('\\\\').join('/')\r\n\r\n // Let's iterate over paths patterns\r\n const hasMatch = data.paths.some((pattern: string) => {\r\n // minimatch(path, pattern)\r\n // If pattern is \"src/**\", and path is \"src\", minimatch(\"src\", \"src/**\") is FALSE.\r\n // We need to check if the path is INSIDE the pattern.\r\n // But the rules say: \"Rules are included when the file being edited matches the path\".\r\n // Since we are approximating by CWD, we should check:\r\n // 1. Is CWD inside the pattern? (e.g. pattern=\"src/**\", cwd=\"src/utils\" -> YES)\r\n // 2. Is CWD the pattern itself? (e.g. pattern=\"src\", cwd=\"src\" -> YES)\r\n // 3. Is the pattern inside CWD? (e.g. pattern=\"src/utils/**\", cwd=\"src\" -> Maybe? If I edit src/index.ts, no. If I edit src/utils/foo.ts, yes.)\r\n \r\n // Let's stick to: CWD must match the pattern OR be a child of the pattern.\r\n // minimatch(\"src/utils\", \"src/**\") -> true\r\n \r\n // Debugging logs in test might help, but let's try to be more robust.\r\n // Maybe \"src\" does NOT match \"src/**\" in minimatch?\r\n // \"src/\" matches \"src/**\"?\r\n \r\n if (minimatch(normalizedRelCwd, pattern)) return true\r\n \r\n // Try appending slash if not empty\r\n if (normalizedRelCwd && minimatch(normalizedRelCwd + '/', pattern)) return true\r\n \r\n return false\r\n })\r\n\r\n if (hasMatch) {\r\n rules.push(content.trim())\r\n }\r\n } catch (e) {\r\n logError(e)\r\n }\r\n }\r\n\r\n return rules\r\n}\r\n\r\nexport function getProjectRules(cwd: string): string[] {\r\n const gitRoot = findGitRoot(cwd)\r\n const root = gitRoot ?? resolve(cwd)\r\n const dirs = getDirsFromGitRootToCwd(root, cwd)\r\n\r\n const rules: string[] = []\r\n\r\n // Iterate from root down to cwd to collect rules from .claude/rules, .cursor/rules and .pyb/rules\r\n for (const dir of dirs) {\r\n // .claude/rules\r\n const claudeRulesDir = join(dir, '.claude', 'rules')\r\n rules.push(...getRulesFromDir(claudeRulesDir, root, cwd))\r\n\r\n // .cursor/rules\r\n const cursorRulesDir = join(dir, '.cursor', 'rules')\r\n rules.push(...getRulesFromDir(cursorRulesDir, root, cwd))\r\n\r\n // .pyb/rules\r\n const pybRulesDir = join(dir, '.pyb', 'rules')\r\n rules.push(...getRulesFromDir(pybRulesDir, root, cwd))\r\n }\r\n\r\n return rules\r\n}\r\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AAIxB,IAAM,eACJ;AAEK,IAAM,eAAe,QAAQ,MAAc;AAChD,QAAM,SAAmB,CAAC;AAE1B,QAAM,mBAAmB,2BAA2B,OAAO,CAAC;AAC5D,aAAW,QAAQ,kBAAkB;AACnC,QAAI;AACF,aAAO;AAAA,QACL,eAAe,KAAK,YAAY;AAAA;AAAA,EAAQ,aAAa,KAAK,cAAc,OAAO,CAAC;AAAA,MAClF;AAAA,IACF,QAAQ;AAAA,IACR;AAAA,EACF;AAEA,MAAI,OAAO,WAAW,GAAG;AACvB,WAAO;AAAA,EACT;AAEA,SAAO,GAAG,YAAY;AAAA;AAAA,EAAO,OAAO,KAAK,MAAM,CAAC;AAClD,CAAC;;;AClBD,SAAS,WAAAA,UAAS,YAAY;;;ACR9B,SAAS,WAAAC,gBAAe;AAGjB,IAAM,WAAWC,SAAQ,YAA8B;AAC5D,QAAM,EAAE,KAAK,IAAI,MAAM,gBAAgB,OAAO;AAAA,IAC5C;AAAA,IACA;AAAA,EACF,CAAC;AACD,SAAO,SAAS;AAClB,CAAC;AAEM,IAAM,UAAU,YAA6B;AAClD,QAAM,EAAE,OAAO,IAAI,MAAM,gBAAgB,OAAO,CAAC,aAAa,MAAM,CAAC;AACrE,SAAO,OAAO,KAAK;AACrB;AAEO,IAAM,YAAY,YAA6B;AACpD,QAAM,EAAE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CACzB,WACA,aACA,UACW;AACX,QAAM,QAAQ;AAAA,IACZ,GAAG,YAAY,IAAI,WAAS,EAAE,MAAM,GAAG,IAAI,GAAG,GAAG,IAAI,OAAO,KAAK,EAAE;AAAA,IACnE,GAAG,MAAM,IAAI,WAAS,EAAE,MAAM,OAAO,MAAM,EAAE;AAAA,EAC/C;AACA,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,SAAS;AACpB,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,YAAY,MAAM,MAAM,SAAS,IAAI,wBAAS;AACpD,UAAM,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE;AAAA,EAC3C;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;",
6
6
  "names": ["memoize", "memoize", "memoize", "join", "relative", "resolve", "existsSync", "readdirSync", "memoize", "memoize", "readFileSync", "readFileSync", "minimatch", "join", "existsSync", "memoize", "readdirSync", "resolve", "relative"]
7
7
  }
@@ -2,7 +2,7 @@ import { createRequire as __pybCreateRequire } from "node:module";
2
2
  const require = __pybCreateRequire(import.meta.url);
3
3
  import {
4
4
  logError
5
- } from "./chunk-GBRPRP4C.js";
5
+ } from "./chunk-6ZXSYUC4.js";
6
6
 
7
7
  // src/utils/session/conversationPersistence.ts
8
8
  import {
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/tools/tool.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\nimport type * as React from 'react'\nimport type { PermissionMode } from '@pyb-types/permissionMode'\nimport type { ToolPermissionContext } from '@pyb-types/toolPermissionContext'\n\nexport type SetToolJSXFn = (\n jsx: {\n jsx: React.ReactNode | null\n shouldHidePromptInput: boolean\n } | null,\n) => void\n\nexport interface ToolUseContext {\n messageId: string | undefined\n toolUseId?: string\n sessionId?: string\n parentSessionId?: string\n childSessionId?: string\n agentId?: string\n agentType?: string\n safeMode?: boolean\n abortController: AbortController\n readFileTimestamps: { [filePath: string]: number }\n options?: {\n commands?: any[]\n tools?: any[]\n verbose?: boolean\n slowAndCapableModel?: string\n safeMode?: boolean\n permissionMode?: PermissionMode\n toolPermissionContext?: ToolPermissionContext\n lastUserPrompt?: string\n forkNumber?: number\n messageLogName?: string\n maxThinkingTokens?: any\n model?: string\n commandAllowedTools?: string[]\n isPybRequest?: boolean\n pybContext?: string\n isCustomCommand?: boolean\n contentInputPath?: 'blocks' | 'string_adapted'\n mcpClients?: any[]\n disableSlashCommands?: boolean\n persistSession?: boolean\n shouldAvoidPermissionPrompts?: boolean\n }\n responseState?: {\n previousResponseId?: string\n conversationId?: string\n responseChainDepth?: number\n }\n}\n\nexport interface ExtendedToolUseContext extends ToolUseContext {\n setToolJSX: SetToolJSXFn\n}\n\nexport interface ValidationResult {\n result: boolean\n message?: string\n errorCode?: number\n meta?: any\n}\n\nexport interface Tool<\n TInput extends z.ZodTypeAny = z.ZodTypeAny,\n TOutput = any,\n> {\n name: string\n description?: string | ((input?: z.infer<TInput>) => Promise<string>)\n inputSchema: TInput\n inputJSONSchema?: Record<string, unknown>\n prompt: (options?: { safeMode?: boolean }) => Promise<string>\n userFacingName?: (input?: z.infer<TInput>) => string\n cachedDescription?: string\n isEnabled: () => Promise<boolean>\n isReadOnly: (input?: z.infer<TInput>) => boolean\n isConcurrencySafe: (input?: z.infer<TInput>) => boolean\n needsPermissions: (input?: z.infer<TInput>) => boolean\n requiresUserInteraction?: (input?: z.infer<TInput>) => boolean\n validateInput?: (\n input: z.infer<TInput>,\n context?: ToolUseContext,\n ) => Promise<ValidationResult>\n renderResultForAssistant: (output: TOutput) => string | any[]\n renderToolUseMessage: (\n input: z.infer<TInput>,\n options: { verbose: boolean },\n ) => string | React.ReactElement | null\n renderToolUseRejectedMessage?: (...args: any[]) => React.ReactElement\n renderToolResultMessage?: (\n output: TOutput,\n options: { verbose: boolean },\n ) => React.ReactNode\n call: (\n input: z.infer<TInput>,\n context: ToolUseContext,\n ) => AsyncGenerator<\n | {\n type: 'result'\n data: TOutput\n resultForAssistant?: string | any[]\n newMessages?: unknown[]\n contextModifier?: {\n modifyContext: (ctx: ToolUseContext) => ToolUseContext\n }\n }\n | {\n type: 'progress'\n content: any\n normalizedMessages?: any[]\n tools?: any[]\n },\n void,\n unknown\n >\n}\n\nexport function getToolDescription(tool: Tool): string {\n if (tool.cachedDescription) {\n return tool.cachedDescription\n }\n\n if (typeof tool.description === 'string') {\n return tool.description\n }\n\n return `Tool: ${tool.name}`\n}\n"],
5
+ "mappings": ";;;;AAsHO,SAAS,mBAAmB,MAAoB;AACrD,MAAI,KAAK,mBAAmB;AAC1B,WAAO,KAAK;AAAA,EACd;AAEA,MAAI,OAAO,KAAK,gBAAgB,UAAU;AACxC,WAAO,KAAK;AAAA,EACd;AAEA,SAAO,SAAS,KAAK,IAAI;AAC3B;",
6
+ "names": []
7
+ }
@@ -7,14 +7,14 @@ import {
7
7
  getSettingsFileCandidates,
8
8
  loadSettingsWithLegacyFallback,
9
9
  saveSettingsToPrimaryAndSyncLegacy
10
- } from "./chunk-66IQQBOM.js";
10
+ } from "./chunk-25DI6YMP.js";
11
11
  import {
12
12
  getSessionPlugins
13
13
  } from "./chunk-BJSWTHRM.js";
14
14
  import {
15
15
  getCwd,
16
16
  getXdgConfigDir
17
- } from "./chunk-GBRPRP4C.js";
17
+ } from "./chunk-6ZXSYUC4.js";
18
18
 
19
19
  // src/services/ui/outputStyles.ts
20
20
  import figures from "figures";
@@ -60,7 +60,7 @@ function updateLocalSettings(patch, options) {
60
60
  }
61
61
 
62
62
  // src/services/ui/outputStyles.ts
63
- var DEFAULT_OUTPUT_STYLE = "Explanatory";
63
+ var DEFAULT_OUTPUT_STYLE = "default";
64
64
  var getRuntimeDirname = () => {
65
65
  try {
66
66
  return __dirname;
@@ -268,7 +268,8 @@ In order to encourage learning, before and after writing code, always provide br
268
268
  These insights should be included in the conversation, not in the codebase. You should generally focus on interesting insights that are specific to the codebase or the code you just wrote, rather than general programming concepts.`;
269
269
  function getBuiltInOutputStyles() {
270
270
  const builtIn = {
271
- [DEFAULT_OUTPUT_STYLE]: {
271
+ [DEFAULT_OUTPUT_STYLE]: null,
272
+ Explanatory: {
272
273
  name: "Explanatory",
273
274
  source: "built-in",
274
275
  description: "Claude explains its implementation choices and codebase patterns",
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/services/ui/outputStyles.ts", "../src/utils/config/localSettings.ts"],
4
+ "sourcesContent": ["import figures from 'figures'\nimport { memoize } from 'lodash-es'\nimport { existsSync, readdirSync, readFileSync, statSync } from 'fs'\nimport { basename, dirname, join, resolve } from 'path'\nimport { homedir } from 'os'\nimport { fileURLToPath } from 'url'\nimport matter from 'gray-matter'\nimport yaml from 'js-yaml'\nimport { getSessionPlugins } from '@utils/session/sessionPlugins'\nimport { readLocalSettings, updateLocalSettings } from '@utils/config/localSettings'\nimport { getCwd } from '@utils/state'\nimport { isSettingSourceEnabled } from '@utils/config/settingSources'\nimport { getXdgConfigDir } from '@utils/config/env'\n\nexport type OutputStyleSource =\n | 'built-in'\n | 'plugin'\n | 'userSettings'\n | 'projectSettings'\n | 'policySettings'\n\nexport type OutputStyleDefinition = {\n name: string\n description: string\n prompt: string\n source: OutputStyleSource\n keepCodingInstructions?: boolean\n}\n\nexport type OutputStyleMap = Record<string, OutputStyleDefinition | null>\n\nexport const DEFAULT_OUTPUT_STYLE = 'default'\n\nconst getRuntimeDirname = () => {\n try {\n return __dirname\n } catch {\n return dirname(fileURLToPath(import.meta.url))\n }\n}\n\nconst runtimeDirname = getRuntimeDirname()\n\nfunction normalizeString(value: unknown): string | null {\n if (typeof value !== 'string') return null\n const trimmed = value.trim()\n return trimmed ? trimmed : null\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 getUserConfigBaseDirs(): { claude: string; pyb: string }[] {\n const out: { claude: string; pyb: string }[] = []\n\n const hasAnyOverride =\n typeof process.env.CLAUDE_CONFIG_DIR === 'string' ||\n typeof process.env.PYB_CONFIG_DIR === 'string'\n\n const claudeBase = normalizeString(process.env.CLAUDE_CONFIG_DIR)\n const pybBase = normalizeString(process.env.PYB_CONFIG_DIR)\n\n if (claudeBase) out.push({ claude: resolve(claudeBase), pyb: resolve(claudeBase) })\n if (pybBase) out.push({ claude: resolve(pybBase), pyb: resolve(pybBase) })\n\n if (hasAnyOverride) {\n return dedupeConfigBases(out)\n }\n\n return dedupeConfigBases([\n { claude: getXdgConfigDir(), pyb: getXdgConfigDir() },\n { claude: join(homedir(), '.claude'), pyb: join(homedir(), '.claude') },\n { claude: join(homedir(), '.pyb'), pyb: join(homedir(), '.pyb') },\n ])\n}\n\nfunction dedupeConfigBases(\n bases: Array<{ claude: string; pyb: string }>,\n): Array<{ claude: string; pyb: string }> {\n const seen = new Set<string>()\n const out: Array<{ claude: string; pyb: string }> = []\n for (const base of bases) {\n const key = `${base.claude}::${base.pyb}`\n if (seen.has(key)) continue\n seen.add(key)\n out.push(base)\n }\n return out\n}\n\nfunction findProjectSubdirs(subdir: string, 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', subdir)\n if (existsSync(claudeDir)) result.push(claudeDir)\n\n const pybDir = join(current, '.pyb', subdir)\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 markdownFirstLineOrHeading(content: string, fallback: string): string {\n const lines = content.split('\\n')\n for (const line of lines) {\n const trimmed = line.trim()\n if (!trimmed) continue\n const heading = trimmed.match(/^#+\\s+(.+)$/)?.[1] ?? trimmed\n return heading.length > 100 ? `${heading.substring(0, 97)}...` : heading\n }\n return fallback\n}\n\nfunction resolveBuiltInOutputStyleDirs(): string[] {\n const dirs: string[] = []\n const envDir = normalizeString(process.env.PYB_OUTPUT_STYLE_DIR)\n if (envDir) dirs.push(resolve(envDir))\n\n if (runtimeDirname.includes('dist') || runtimeDirname.includes('node_modules')) {\n dirs.push(resolve(runtimeDirname, '../resources/output-styles'))\n } else {\n dirs.push(resolve(runtimeDirname, '../../../resources/output-styles'))\n }\n\n return Array.from(new Set(dirs))\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<{ name: string; isDirectory(): boolean; isFile(): boolean; isSymbolicLink(): boolean }>\n try {\n entries = readdirSync(dirPath, { withFileTypes: true, encoding: 'utf8' }) 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 { frontmatter: (parsed.data as any) ?? {}, content: String(parsed.content ?? '') }\n } catch {\n return null\n }\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 parseBuiltInOutputStyleFile(options: {\n filePath: string\n}): OutputStyleDefinition | null {\n const parsed = readMarkdownFile(options.filePath)\n if (!parsed) return null\n\n const base = basename(options.filePath, '.md')\n const name = normalizeString(parsed.frontmatter?.name) ?? base\n const description =\n normalizeString(parsed.frontmatter?.description) ??\n markdownFirstLineOrHeading(parsed.content, `Built-in ${base} output style`)\n const keepCodingInstructions = parseKeepCodingInstructions(\n parsed.frontmatter?.['keep-coding-instructions'],\n )\n const prompt = parsed.content.trim()\n if (!prompt) return null\n\n return {\n name,\n description,\n prompt,\n source: 'built-in',\n ...(keepCodingInstructions !== undefined ? { keepCodingInstructions } : {}),\n }\n}\n\nfunction loadBundledOutputStyles(): OutputStyleDefinition[] {\n const out: OutputStyleDefinition[] = []\n const seen = new Set<string>()\n for (const dirPath of resolveBuiltInOutputStyleDirs()) {\n for (const filePath of listMarkdownFilesRecursively(dirPath)) {\n const inodeKey = inodeKeyForPath(filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${filePath}`\n if (seen.has(dedupeKey)) continue\n seen.add(dedupeKey)\n const style = parseBuiltInOutputStyleFile({ filePath })\n if (style && style.name !== DEFAULT_OUTPUT_STYLE) out.push(style)\n }\n }\n return out\n}\n\nconst INSIGHTS_SECTION = `\n## Insights\nIn order to encourage learning, before and after writing code, always provide brief educational explanations about implementation choices using (with backticks):\n\"\\`${figures.star} Insight \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\\`\n[2-3 key educational points]\n\\`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\\`\"\n\nThese insights should be included in the conversation, not in the codebase. You should generally focus on interesting insights that are specific to the codebase or the code you just wrote, rather than general programming concepts.`\n\nfunction getBuiltInOutputStyles(): OutputStyleMap {\n const builtIn: OutputStyleMap = {\n [DEFAULT_OUTPUT_STYLE]: null,\n Explanatory: {\n name: 'Explanatory',\n source: 'built-in',\n description: 'Claude explains its implementation choices and codebase patterns',\n keepCodingInstructions: true,\n prompt: `You are an interactive CLI tool that helps users with software engineering tasks. In addition to software engineering tasks, you should provide educational insights about the codebase along the way.\n\nYou should be clear and educational, providing helpful explanations while remaining focused on the task. Balance educational content with task completion. When providing insights, you may exceed typical length constraints, but remain focused and relevant.\n\n# Explanatory Style Active\n${INSIGHTS_SECTION}`,\n },\n Learning: {\n name: 'Learning',\n source: 'built-in',\n description:\n 'Claude pauses and asks you to write small pieces of code for hands-on practice',\n keepCodingInstructions: true,\n prompt: `You are an interactive CLI tool that helps users with software engineering tasks. In addition to software engineering tasks, you should help users learn more about the codebase through hands-on practice and educational insights.\n\nYou should be collaborative and encouraging. Balance task completion with learning by requesting user input for meaningful design decisions while handling routine implementation yourself. \n\n# Learning Style Active\n## Requesting Human Contributions\nIn order to encourage learning, ask the human to contribute 2-10 line code pieces when generating 20+ lines involving:\n- Design decisions (error handling, data structures)\n- Business logic with multiple valid approaches \n- Key algorithms or interface definitions\n\n**TodoList Integration**: If using a TodoList for the overall task, include a specific todo item like \"Request human input on [specific decision]\" when planning to request human input. This ensures proper task tracking. Note: TodoList is not required for all tasks.\n\nExample TodoList flow:\n \u2713 \"Set up component structure with placeholder for logic\"\n \u2713 \"Request human collaboration on decision logic implementation\"\n \u2713 \"Integrate contribution and complete feature\"\n\n### Request Format\n\\`\\`\\`\n${figures.bullet} **Learn by Doing**\n**Context:** [what's built and why this decision matters]\n**Your Task:** [specific function/section in file, mention file and TODO(human) but do not include line numbers]\n**Guidance:** [trade-offs and constraints to consider]\n\\`\\`\\`\n\n### Key Guidelines\n- Frame contributions as valuable design decisions, not busy work\n- You must first add a TODO(human) section into the codebase with your editing tools before making the Learn by Doing request \n- Make sure there is one and only one TODO(human) section in the code\n- Don't take any action or output anything after the Learn by Doing request. Wait for human implementation before proceeding.\n\n### Example Requests\n\n**Whole Function Example:**\n\\`\\`\\`\n${figures.bullet} **Learn by Doing**\n\n**Context:** I've set up the hint feature UI with a button that triggers the hint system. The infrastructure is ready: when clicked, it calls selectHintCell() to determine which cell to hint, then highlights that cell with a yellow background and shows possible values. The hint system needs to decide which empty cell would be most helpful to reveal to the user.\n\n**Your Task:** In sudoku.js, implement the selectHintCell(board) function. Look for TODO(human). This function should analyze the board and return {row, col} for the best cell to hint, or null if the puzzle is complete.\n\n**Guidance:** Consider multiple strategies: prioritize cells with only one possible value (naked singles), or cells that appear in rows/columns/boxes with many filled cells. You could also consider a balanced approach that helps without making it too easy. The board parameter is a 9x9 array where 0 represents empty cells.\n\\`\\`\\`\n\n**Partial Function Example:**\n\\`\\`\\`\n${figures.bullet} **Learn by Doing**\n\n**Context:** I've built a file upload component that validates files before accepting them. The main validation logic is complete, but it needs specific handling for different file type categories in the switch statement.\n\n**Your Task:** In upload.js, inside the validateFile() function's switch statement, implement the 'case \"document\":' branch. Look for TODO(human). This should validate document files (pdf, doc, docx).\n\n**Guidance:** Consider checking file size limits (maybe 10MB for documents?), validating the file extension matches the MIME type, and returning {valid: boolean, error?: string}. The file object has properties: name, size, type.\n\\`\\`\\`\n\n**Debugging Example:**\n\\`\\`\\`\n${figures.bullet} **Learn by Doing**\n\n**Context:** The user reported that number inputs aren't working correctly in the calculator. I've identified the handleInput() function as the likely source, but need to understand what values are being processed.\n\n**Your Task:** In calculator.js, inside the handleInput() function, add 2-3 console.log statements after the TODO(human) comment to help debug why number inputs fail.\n\n**Guidance:** Consider logging: the raw input value, the parsed result, and any validation state. This will help us understand where the conversion breaks.\n\\`\\`\\`\n\n### After Contributions\nShare one insight connecting their code to broader patterns or system effects. Avoid praise or repetition.\n\n## Insights\n${INSIGHTS_SECTION}`,\n },\n }\n for (const style of loadBundledOutputStyles()) {\n builtIn[style.name] = style\n }\n return builtIn\n}\n\nfunction parseKeepCodingInstructions(value: unknown): boolean | undefined {\n if (value === 'true') return true\n if (value === 'false') return false\n return undefined\n}\n\nfunction parseCustomOutputStyleFile(options: {\n filePath: string\n source: Exclude<OutputStyleSource, 'built-in' | 'plugin'>\n}): OutputStyleDefinition | null {\n const parsed = readMarkdownFile(options.filePath)\n if (!parsed) return null\n\n const base = basename(options.filePath, '.md')\n const name = normalizeString(parsed.frontmatter?.name) ?? base\n const description =\n normalizeString(parsed.frontmatter?.description) ??\n markdownFirstLineOrHeading(parsed.content, `Custom ${base} output style`)\n const keepCodingInstructions = parseKeepCodingInstructions(\n parsed.frontmatter?.['keep-coding-instructions'],\n )\n const prompt = parsed.content.trim()\n\n return {\n name,\n description,\n prompt,\n source: options.source,\n ...(keepCodingInstructions !== undefined ? { keepCodingInstructions } : {}),\n }\n}\n\nfunction parsePluginOutputStyleFile(options: {\n filePath: string\n pluginName: string\n seen: Set<string>\n}): OutputStyleDefinition | null {\n const inodeKey = inodeKeyForPath(options.filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${options.filePath}`\n if (options.seen.has(dedupeKey)) return null\n options.seen.add(dedupeKey)\n\n const parsed = readMarkdownFile(options.filePath)\n if (!parsed) return null\n\n const base = basename(options.filePath, '.md')\n const styleName = normalizeString(parsed.frontmatter?.name) ?? base\n const fullName = `${options.pluginName}:${styleName}`\n const description =\n normalizeString(parsed.frontmatter?.description) ??\n markdownFirstLineOrHeading(\n parsed.content,\n `Output style from ${options.pluginName} plugin`,\n )\n const prompt = parsed.content.trim()\n\n return {\n name: fullName,\n description,\n prompt,\n source: 'plugin',\n }\n}\n\nfunction loadPluginOutputStyles(): OutputStyleDefinition[] {\n const out: OutputStyleDefinition[] = []\n const plugins = getSessionPlugins()\n for (const plugin of plugins) {\n const pluginName = plugin.name\n const seen = new Set<string>()\n for (const dir of plugin.outputStylesDirs ?? []) {\n let st: ReturnType<typeof statSync>\n try {\n st = statSync(dir)\n } catch {\n continue\n }\n if (st.isFile()) {\n if (!dir.endsWith('.md')) continue\n const style = parsePluginOutputStyleFile({\n filePath: dir,\n pluginName,\n seen,\n })\n if (style) out.push(style)\n continue\n }\n\n if (st.isDirectory()) {\n const files = listMarkdownFilesRecursively(dir)\n for (const filePath of files) {\n const style = parsePluginOutputStyleFile({\n filePath,\n pluginName,\n seen,\n })\n if (style) out.push(style)\n }\n }\n }\n }\n return out\n}\n\nfunction loadCustomOutputStyles(options: { cwd: string }): OutputStyleDefinition[] {\n const out: OutputStyleDefinition[] = []\n const seen = new Set<string>()\n\n const policyDir = join(\n getClaudePolicyBaseDir(),\n '.claude',\n 'output-styles',\n )\n for (const filePath of listMarkdownFilesRecursively(policyDir)) {\n const inodeKey = inodeKeyForPath(filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${filePath}`\n if (seen.has(dedupeKey)) continue\n seen.add(dedupeKey)\n const style = parseCustomOutputStyleFile({\n filePath,\n source: 'policySettings',\n })\n if (style) out.push(style)\n }\n\n if (isSettingSourceEnabled('userSettings')) {\n const userBases = getUserConfigBaseDirs()\n for (const base of userBases) {\n for (const userBaseDir of new Set([base.claude, base.pyb])) {\n const dirPath = join(userBaseDir, 'output-styles')\n for (const filePath of listMarkdownFilesRecursively(dirPath)) {\n const inodeKey = inodeKeyForPath(filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${filePath}`\n if (seen.has(dedupeKey)) continue\n seen.add(dedupeKey)\n const style = parseCustomOutputStyleFile({\n filePath,\n source: 'userSettings',\n })\n if (style) out.push(style)\n }\n }\n }\n }\n\n if (isSettingSourceEnabled('projectSettings')) {\n for (const dirPath of findProjectSubdirs('output-styles', options.cwd)) {\n for (const filePath of listMarkdownFilesRecursively(dirPath)) {\n const inodeKey = inodeKeyForPath(filePath)\n const dedupeKey = inodeKey ? `inode:${inodeKey}` : `path:${filePath}`\n if (seen.has(dedupeKey)) continue\n seen.add(dedupeKey)\n const style = parseCustomOutputStyleFile({\n filePath,\n source: 'projectSettings',\n })\n if (style) out.push(style)\n }\n }\n }\n\n return out\n}\n\nexport const getAvailableOutputStyles = memoize((): OutputStyleMap => {\n const cwd = getCwd()\n const builtIn = getBuiltInOutputStyles()\n const merged: OutputStyleMap = { ...builtIn }\n\n for (const style of loadPluginOutputStyles()) {\n merged[style.name] = style\n }\n\n const custom = loadCustomOutputStyles({ cwd })\n const user = custom.filter(s => s.source === 'userSettings')\n const project = custom.filter(s => s.source === 'projectSettings')\n const policy = custom.filter(s => s.source === 'policySettings')\n\n for (const style of user) merged[style.name] = style\n for (const style of project) merged[style.name] = style\n for (const style of policy) merged[style.name] = style\n\n return merged\n})\n\nexport function clearOutputStyleCache(): void {\n ;(getAvailableOutputStyles as any).cache?.clear?.()\n}\n\nexport function getCurrentOutputStyle(): string {\n if (!isSettingSourceEnabled('localSettings')) return DEFAULT_OUTPUT_STYLE\n\n const settings = readLocalSettings()\n const candidate = normalizeString(settings.outputStyle)\n return candidate ?? DEFAULT_OUTPUT_STYLE\n}\n\nexport function setCurrentOutputStyle(styleName: string): void {\n updateLocalSettings({ outputStyle: styleName })\n}\n\nexport function resolveOutputStyleName(input: string): string | null {\n const raw = normalizeString(input)\n if (!raw) return null\n const styles = getAvailableOutputStyles()\n if (raw in styles) return raw\n const lower = raw.toLowerCase()\n for (const name of Object.keys(styles)) {\n if (name.toLowerCase() === lower) return name\n }\n return null\n}\n\nexport function getCurrentOutputStyleDefinition(): OutputStyleDefinition | null {\n const current = getCurrentOutputStyle()\n const styles = getAvailableOutputStyles()\n return styles[current] ?? null\n}\n\nexport function getOutputStyleSystemPromptAdditions(): string[] {\n const style = getCurrentOutputStyleDefinition()\n if (!style) return []\n const prompt = style.prompt.trim()\n if (!prompt) return []\n return [`\\n# Output Style: ${style.name}\\n${prompt}\\n`]\n}\n", "import { join } from 'path'\nimport { getCwd } from '@utils/state'\nimport {\n getSettingsFileCandidates,\n loadSettingsWithLegacyFallback,\n saveSettingsToPrimaryAndSyncLegacy,\n} from '@utils/config/settingsFiles'\n\nexport type LocalSettings = {\n outputStyle?: unknown\n [key: string]: unknown\n}\n\nexport function getLocalSettingsPath(options?: {\n projectDir?: string\n}): string {\n const projectDir = options?.projectDir ?? getCwd()\n return join(projectDir, '.pyb', 'settings.local.json')\n}\n\nexport function readLocalSettings(options?: {\n projectDir?: string\n}): LocalSettings {\n const projectDir = options?.projectDir ?? getCwd()\n const loaded = loadSettingsWithLegacyFallback({\n destination: 'localSettings',\n projectDir,\n migrateToPrimary: true,\n })\n return (loaded.settings as LocalSettings | null) ?? {}\n}\n\nexport function updateLocalSettings(\n patch: Record<string, unknown>,\n options?: {\n projectDir?: string\n },\n): LocalSettings {\n const projectDir = options?.projectDir ?? getCwd()\n const candidates = getSettingsFileCandidates({\n destination: 'localSettings',\n projectDir,\n })\n const existing =\n (candidates\n ? loadSettingsWithLegacyFallback({\n destination: 'localSettings',\n projectDir,\n migrateToPrimary: true,\n }).settings\n : null) ?? {}\n\n const next = { ...(existing as Record<string, unknown>), ...patch }\n\n if (candidates) {\n saveSettingsToPrimaryAndSyncLegacy({\n destination: 'localSettings',\n projectDir,\n settings: next,\n syncLegacyIfExists: true,\n })\n }\n\n return next as LocalSettings\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA,OAAO,aAAa;AACpB,SAAS,eAAe;AACxB,SAAS,YAAY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CAAC;AACrB,SAAO,CAAC;AAAA,kBAAqB,MAAM,IAAI;AAAA,EAAK,MAAM;AAAA,CAAI;AACxD;",
6
+ "names": []
7
+ }
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-RQVLBMP7.js";
6
6
  import {
7
7
  debug
8
- } from "./chunk-6UJ2IX6O.js";
8
+ } from "./chunk-UXJEDV2F.js";
9
9
  import {
10
10
  getCwd,
11
11
  getGlobalConfigFilePath,
12
12
  getLegacyGlobalConfigFilePath,
13
13
  logError
14
- } from "./chunk-GBRPRP4C.js";
14
+ } from "./chunk-6ZXSYUC4.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-URPSX5FV.js").then(({ reloadModelManager }) => {
691
+ import("./model-NJI57V4I.js").then(({ reloadModelManager }) => {
692
692
  reloadModelManager();
693
693
  });
694
694
  }
@@ -2,7 +2,7 @@ import { createRequire as __pybCreateRequire } from "node:module";
2
2
  const require = __pybCreateRequire(import.meta.url);
3
3
  import {
4
4
  createSessionSqlStore
5
- } from "./chunk-A4MELTXR.js";
5
+ } from "./chunk-XEZ4I2EW.js";
6
6
 
7
7
  // src/utils/protocol/pybAgentSessionLoad.ts
8
8
  function loadPybAgentSessionLogData(args) {
@@ -4,7 +4,7 @@ import {
4
4
  BunShell,
5
5
  execFileNoThrow,
6
6
  logError
7
- } from "./chunk-GBRPRP4C.js";
7
+ } from "./chunk-6ZXSYUC4.js";
8
8
 
9
9
  // src/utils/system/ripgrep.ts
10
10
  import { findActualExecutable } from "spawn-rx";
@@ -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.37",
7
+ version: "1.5.39",
8
8
  bin: {
9
9
  pyb: "cli.js",
10
10
  "pyb-acp": "cli-acp.js"
@@ -60,8 +60,6 @@ var package_default = {
60
60
  "build:sdk": "npm --prefix ./packages/sdk run build",
61
61
  "generate:sdk": "node scripts/sdk-generate.mjs",
62
62
  "check:sdk-generated": "node scripts/sdk-check-generated.mjs",
63
- "generate:sdk-client": "node scripts/sdk-generate-client.mjs",
64
- "check:sdk-client-generated": "node scripts/sdk-check-client-generated.mjs",
65
63
  "check:compat-window": "node scripts/sdk-compat-window-gate.mjs",
66
64
  "generate:legacy-mapping": "node scripts/sdk-legacy-mapping-report.mjs",
67
65
  "check:legacy-usage": "node scripts/sdk-legacy-usage-gate.mjs",
@@ -72,21 +70,7 @@ var package_default = {
72
70
  "check:facade-closeout": "node scripts/sdk-facade-closeout-gate.mjs",
73
71
  "check:sdk-consistency": "node scripts/sdk-consistency-gate.mjs",
74
72
  "check:sdk-contract-consistency": "node scripts/sdk-contract-consistency-gate.mjs",
75
- "check:sdk-tool-contract": "node scripts/sdk-tool-contract-gate.mjs",
76
- "check:sdk-runtime-publish": "node scripts/sdk-runtime-publish-gate.mjs",
77
- "check:runtime-mcp-control": "node scripts/runtime-mcp-control-gate.mjs",
78
- "check:runtime-mcp-contract-freeze": "node scripts/runtime-mcp-contract-freeze-gate.mjs",
79
- "check:runtime-mcp-management": "node scripts/runtime-mcp-management-gate.mjs",
80
- "check:runtime-mcp-events": "node scripts/runtime-mcp-events-gate.mjs",
81
- "check:sdk-session-contract": "node scripts/sdk-session-contract-gate.mjs",
82
- "check:openapi-diff-budget": "node scripts/sdk-openapi-diff-gate.mjs",
83
- "check:sdk-events-source": "node scripts/sdk-events-source-gate.mjs",
84
- "check:sdk-bridge-consistency": "node scripts/sdk-bridge-consistency-gate.mjs",
85
- "check:sdk-dual-track-retirement": "node scripts/sdk-dual-track-retirement-gate.mjs",
86
73
  "check:sdk-legacy-semantics": "node scripts/sdk-legacy-semantics-gate.mjs",
87
- "check:sdk-generated-transport-only": "node scripts/sdk-generated-transport-only-gate.mjs --hard",
88
- "check:sdk-generated-transport-only:soft": "node scripts/sdk-generated-transport-only-gate.mjs --soft",
89
- "check:runtime-query-consistency": "node scripts/runtime-query-consistency-gate.mjs",
90
74
  "build:binary": "node scripts/build-binary.mjs",
91
75
  "build:native-lock": "node scripts/build-native-lock.mjs",
92
76
  clean: "node scripts/clean.mjs",
@@ -99,9 +83,8 @@ var package_default = {
99
83
  test: "bun test",
100
84
  "test:unit": "bun test --preload ./tests/setup/native-lock-test-setup.ts tests/unit",
101
85
  "test:integration": "bun test tests/integration",
102
- "test:sdk-integration": "bun test tests/integration/server/sdk-client.test.ts",
103
86
  "test:e2e": "bun test tests/e2e",
104
- "test:server": "bun test tests/unit/sdk-batch-a-closure.test.ts tests/unit/sdk-batch-aa-single-source.test.ts tests/unit/sdk-batch-b-queryrunner.test.ts tests/unit/sdk-batch-c-sse.test.ts tests/unit/sdk-batch-c1-mcp-runtime.test.ts tests/unit/sdk-batch-d-openapi.test.ts tests/unit/sdk-batch-e-capability.test.ts tests/unit/sdk-batch-f-release.test.ts tests/unit/sdk-batch-g-generation.test.ts tests/unit/sdk-batch-h-facade.test.ts tests/unit/sdk-batch-i-lifecycle.test.ts tests/unit/sdk-batch-j-sse-first-class.test.ts tests/unit/sdk-batch-k-release-gate.test.ts tests/unit/sdk-batch-l-mapping-baseline.test.ts tests/unit/sdk-batch-m-docs-deprecate.test.ts tests/unit/sdk-batch-m0-mcp-contract-freeze.test.ts tests/unit/sdk-batch-m1-mcp-state-closure.test.ts tests/unit/sdk-batch-m2-mcp-management.test.ts tests/unit/sdk-batch-m3-mcp-events.test.ts tests/unit/sdk-batch-n-window-block.test.ts tests/unit/sdk-batch-o-major-cutover.test.ts tests/unit/sdk-batch-p-governance-closeout.test.ts tests/unit/sdk-batch-q1-runtime-guard.test.ts tests/unit/sdk-batch-q2-contract-capability.test.ts tests/unit/sdk-batch-q3-legacy-semantics.test.ts tests/unit/sdk-batch-r0-blockers.test.ts tests/unit/sdk-batch-r0-runtime-query-consistency.test.ts tests/unit/sdk-batch-r1-runtime-minimal.test.ts tests/unit/sdk-batch-r3-runtime-publish.test.ts tests/unit/sdk-batch-r-generation-layer.test.ts tests/unit/sdk-batch-s-diff-budget.test.ts tests/unit/sdk-batch-t-bridge-consistency.test.ts tests/unit/sdk-batch-u0-precheck.test.ts tests/unit/sdk-batch-u-contract-coverage.test.ts tests/unit/sdk-batch-u1-type-context.test.ts tests/unit/sdk-batch-u2-tool-contract.test.ts tests/unit/sdk-batch-v-transport-unification.test.ts tests/unit/sdk-batch-w-governance-hard-gate.test.ts tests/unit/sdk-batch-z-retirement-closeout.test.ts",
87
+ "test:server": "bun test tests/unit/sdk-batch-a-closure.test.ts tests/unit/sdk-batch-b-queryrunner.test.ts tests/unit/sdk-batch-c-sse.test.ts tests/unit/sdk-batch-d-openapi.test.ts tests/unit/sdk-batch-e-capability.test.ts tests/unit/sdk-batch-f-release.test.ts tests/unit/sdk-batch-g-generation.test.ts tests/unit/sdk-batch-h-facade.test.ts tests/unit/sdk-batch-i-lifecycle.test.ts tests/unit/sdk-batch-j-sse-first-class.test.ts tests/unit/sdk-batch-k-release-gate.test.ts tests/unit/sdk-batch-l-mapping-baseline.test.ts tests/unit/sdk-batch-m-docs-deprecate.test.ts tests/unit/sdk-batch-n-window-block.test.ts tests/unit/sdk-batch-o-major-cutover.test.ts tests/unit/sdk-batch-p-governance-closeout.test.ts tests/unit/sdk-batch-q1-runtime-guard.test.ts tests/unit/sdk-batch-q2-contract-capability.test.ts tests/unit/sdk-batch-q3-legacy-semantics.test.ts",
105
88
  "gate:runtime-assets": "bun run scripts/runtime-assets-gate-check.mjs",
106
89
  "preflight:runtime-assets": "node scripts/runtime-assets-preflight.mjs",
107
90
  "verify:runtime-assets": "node scripts/runtime-assets-verify.mjs",
@@ -125,7 +108,7 @@ var package_default = {
125
108
  "benchmark:typed-part-baseline": "bun scripts/typed-part-baseline-benchmark.mjs",
126
109
  "gate:typed-part-performance": "node scripts/typed-part-performance-gate.mjs",
127
110
  typecheck: "tsc --noEmit",
128
- "release:gate": "npm run generate:sdk && npm run check:sdk-generated && npm run generate:sdk-client && npm run check:sdk-client-generated && npm run check:openapi-diff-budget && npm run check:sdk-events-source && npm run check:sdk-bridge-consistency && npm run check:sdk-dual-track-retirement && npm run check:sdk-generated-transport-only && npm run generate:legacy-mapping && npm run check:legacy-usage && npm run report:legacy-usage-trend && npm run check:legacy-window && npm run check:docs-consistency && npm run check:major-cutover && npm run check:facade-closeout && npm run check:sdk-consistency && npm run check:sdk-contract-consistency && npm run check:sdk-runtime-publish && npm run check:runtime-mcp-control && npm run check:runtime-mcp-contract-freeze && npm run check:runtime-mcp-management && npm run check:runtime-mcp-events && npm run check:sdk-tool-contract && npm run check:sdk-session-contract && npm run check:sdk-legacy-semantics && npm run check:compat-window && npm run build:sdk && npm run test:server && npm run test:sdk-integration && npm run lint && npm run typecheck",
111
+ "release:gate": "npm run generate:sdk && npm run check:sdk-generated && npm run generate:legacy-mapping && npm run check:legacy-usage && npm run report:legacy-usage-trend && npm run check:legacy-window && npm run check:docs-consistency && npm run check:major-cutover && npm run check:facade-closeout && npm run check:sdk-consistency && npm run check:sdk-contract-consistency && npm run check:sdk-legacy-semantics && npm run check:compat-window && npm run build:sdk && npm run test:server && npm run lint && npm run typecheck",
129
112
  prepare: "bun run scripts/install-hooks.mjs",
130
113
  "sync:native-lock": "node scripts/sync-native-lock-versions.mjs",
131
114
  "publish:native-lock": "node scripts/publish-native-lock.mjs",
@@ -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.39\",\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 \"scripts/session-contract-gate.mjs\",\n \"scripts/session-behavior-invariant-gate.mjs\",\n \"scripts/session-project-gate.mjs\",\n \"scripts/protected-tool-names-gate.mjs\",\n \".npmrc\",\n \"resources/**/*\"\n ],\n \"scripts\": {\n \"dev\": \"bun run ./src/entrypoints/cli.tsx --verbose\",\n \"dev:server\": \"bun run ./src/entrypoints/cli.tsx serve --port 4096\",\n \"build:npm\": \"bun scripts/build.mjs\",\n \"build\": \"npm run build:npm\",\n \"build:sdk\": \"npm --prefix ./packages/sdk run build\",\n \"generate:sdk\": \"node scripts/sdk-generate.mjs\",\n \"check:sdk-generated\": \"node scripts/sdk-check-generated.mjs\",\n \"check:compat-window\": \"node scripts/sdk-compat-window-gate.mjs\",\n \"generate:legacy-mapping\": \"node scripts/sdk-legacy-mapping-report.mjs\",\n \"check:legacy-usage\": \"node scripts/sdk-legacy-usage-gate.mjs\",\n \"report:legacy-usage-trend\": \"node scripts/sdk-legacy-usage-trend-report.mjs\",\n \"check:legacy-window\": \"node scripts/sdk-legacy-window-gate.mjs\",\n \"check:docs-consistency\": \"node scripts/sdk-docs-consistency-gate.mjs\",\n \"check:major-cutover\": \"node scripts/sdk-major-cutover-gate.mjs\",\n \"check:facade-closeout\": \"node scripts/sdk-facade-closeout-gate.mjs\",\n \"check:sdk-consistency\": \"node scripts/sdk-consistency-gate.mjs\",\n \"check:sdk-contract-consistency\": \"node scripts/sdk-contract-consistency-gate.mjs\",\n \"check:sdk-legacy-semantics\": \"node scripts/sdk-legacy-semantics-gate.mjs\",\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 \"test:server\": \"bun test tests/unit/sdk-batch-a-closure.test.ts tests/unit/sdk-batch-b-queryrunner.test.ts tests/unit/sdk-batch-c-sse.test.ts tests/unit/sdk-batch-d-openapi.test.ts tests/unit/sdk-batch-e-capability.test.ts tests/unit/sdk-batch-f-release.test.ts tests/unit/sdk-batch-g-generation.test.ts tests/unit/sdk-batch-h-facade.test.ts tests/unit/sdk-batch-i-lifecycle.test.ts tests/unit/sdk-batch-j-sse-first-class.test.ts tests/unit/sdk-batch-k-release-gate.test.ts tests/unit/sdk-batch-l-mapping-baseline.test.ts tests/unit/sdk-batch-m-docs-deprecate.test.ts tests/unit/sdk-batch-n-window-block.test.ts tests/unit/sdk-batch-o-major-cutover.test.ts tests/unit/sdk-batch-p-governance-closeout.test.ts tests/unit/sdk-batch-q1-runtime-guard.test.ts tests/unit/sdk-batch-q2-contract-capability.test.ts tests/unit/sdk-batch-q3-legacy-semantics.test.ts\",\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 \"gate:query-adapter-boundary\": \"node scripts/query-adapter-boundary-gate.mjs\",\n \"gate:session-contract\": \"node scripts/session-contract-gate.mjs\",\n \"gate:session-behavior-invariant\": \"node scripts/session-behavior-invariant-gate.mjs\",\n \"gate:session-project\": \"node scripts/session-project-gate.mjs\",\n \"gate:protected-tool-names\": \"node scripts/protected-tool-names-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 \"release:gate\": \"npm run generate:sdk && npm run check:sdk-generated && npm run generate:legacy-mapping && npm run check:legacy-usage && npm run report:legacy-usage-trend && npm run check:legacy-window && npm run check:docs-consistency && npm run check:major-cutover && npm run check:facade-closeout && npm run check:sdk-consistency && npm run check:sdk-contract-consistency && npm run check:sdk-legacy-semantics && npm run check:compat-window && npm run build:sdk && npm run test:server && npm run lint && npm run typecheck\",\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,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW;AAAA,IACT,KAAO;AAAA,IACP,cAAc;AAAA,IACd,aAAa;AAAA,IACb,OAAS;AAAA,IACT,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,IACvB,2BAA2B;AAAA,IAC3B,sBAAsB;AAAA,IACtB,6BAA6B;AAAA,IAC7B,uBAAuB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A,IACV,6BAA6B;AAAA,IAC7B,uBAAuB;AAAA,IACvB,cAAc;AAAA,IACd,UAAY;AAAA,IACZ,uBAAuB;AAAA,IACvB,oBAAoB;AAAA,IACpB,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,IACvB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,uBAAuB;AAAA,IACvB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,IACrB,0BAA0B;AAAA,IAC1B,UAAY;AAAA,IACZ,YAAc;AAAA,EAChB;AAAA,EACA,WAAa;AAAA,IACX,mCAAmC;AAAA,IACnC,yBAAyB;AAAA,IACzB,mCAAmC;AAAA,EACrC;AAAA,EACA,sBAAwB;AAAA,IACtB,kCAAkC;AAAA,IAClC,oCAAoC;AAAA,IACpC,iCAAiC;AAAA,IACjC,kCAAkC;AAAA,IAClC,mCAAmC;AAAA,IACnC,yCAAyC;AAAA,IACzC,8BAA8B;AAAA,IAC9B,gCAAgC;AAAA,EAClC;AAAA,EACA,wBAA0B;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;AC9OO,IAAM,QAAQ;AAAA,EACnB,SAAS,gBAAI;AAAA,EACb,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,kBACE;AACJ;",
6
+ "names": []
7
+ }
@@ -2,7 +2,7 @@ import { createRequire as __pybCreateRequire } from "node:module";
2
2
  const require = __pybCreateRequire(import.meta.url);
3
3
  import {
4
4
  PERSISTENCE_VERSION
5
- } from "./chunk-HS72NWQM.js";
5
+ } from "./chunk-B6KK6QP2.js";
6
6
 
7
7
  // src/utils/session/conversationMessageState.ts
8
8
  function mapFinishReason(rawReason) {
@@ -5,7 +5,7 @@ import {
5
5
  getCwd,
6
6
  resolveXdgCachePath,
7
7
  resolveXdgDataPath
8
- } from "./chunk-GBRPRP4C.js";
8
+ } from "./chunk-6ZXSYUC4.js";
9
9
 
10
10
  // src/services/plugins/skillMarketplace.ts
11
11
  import {