@didim365/agent-cli-core 0.1.1 → 0.1.3

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 (1081) hide show
  1. package/dist/src/core/apiKeyCredentialStorage.d.ts +23 -3
  2. package/dist/src/core/apiKeyCredentialStorage.js +56 -16
  3. package/dist/src/core/apiKeyCredentialStorage.js.map +1 -1
  4. package/dist/src/generated/git-commit.d.ts +1 -1
  5. package/dist/src/generated/git-commit.js +1 -1
  6. package/package.json +6 -2
  7. package/dist/docs/00_project/ai_adapter/01-overview.md +0 -172
  8. package/dist/docs/00_project/ai_adapter/02-architecture.md +0 -448
  9. package/dist/docs/00_project/ai_adapter/03-technical-design.md +0 -1470
  10. package/dist/docs/00_project/ai_adapter/04-integration-design.md +0 -1934
  11. package/dist/docs/00_project/ai_adapter/05-implementation-plan.md +0 -336
  12. package/dist/docs/00_project/ai_adapter/06-didiaistudio-plan.md +0 -559
  13. package/dist/docs/00_project/ai_adapter/README.md +0 -145
  14. package/dist/docs/00_project/ai_adapter/agent_service_openapi.json +0 -1
  15. package/dist/docs/00_project/ai_adapter/didimStudi-AISTUDIO /341/204/213/341/205/254/341/204/207/341/205/256 /341/204/211/341/205/245/341/204/207/341/205/265/341/204/211/341/205/263 /341/204/221/341/205/263/341/206/257/341/204/205/341/205/251/341/204/213/341/205/256 /341/204/213/341/205/247/341/206/253/341/204/200/341/205/247/341/206/257 /341/204/207/341/205/241/341/206/274/341/204/211/341/205/265/341/206/250-100226-093925.pdf +0 -0
  16. package/dist/docs/00_project/ai_adapter/event-mapping-matrix.md +0 -148
  17. package/dist/docs/00_project/ai_adapter/migration-plan.md +0 -205
  18. package/dist/docs/00_project/ai_adapter/template/00_vibecoding_workflow.md +0 -627
  19. package/dist/docs/00_project/ai_adapter/template/01_todolist_performance_template.md +0 -436
  20. package/dist/docs/00_project/ai_adapter/template/02_code_review_template.md +0 -248
  21. package/dist/docs/00_project/ai_adapter/template/03_work_result_report_template.md +0 -133
  22. package/dist/docs/00_project/ai_adapter/template/100_Python_Performance_Guide.md +0 -472
  23. package/dist/docs/00_project/ai_adapter/template/99_TDD_plan.md +0 -123
  24. package/dist/docs/00_project/ai_adapter/todolist/00_master_implementation_plan.md +0 -433
  25. package/dist/docs/00_project/ai_adapter/todolist/phase1_foundation_todolist.md +0 -726
  26. package/dist/docs/00_project/ai_adapter/todolist/phase2_core_refactoring_todolist.md +0 -974
  27. package/dist/docs/00_project/ai_adapter/todolist/phase3_handoff.md +0 -203
  28. package/dist/docs/00_project/ai_adapter/todolist/phase3_provider_extension_todolist.md +0 -1382
  29. package/dist/docs/00_project/ai_adapter/utility-migration.md +0 -237
  30. package/dist/docs/00_project/ai_adapter/working_history/.gitkeep +0 -0
  31. package/dist/docs/00_project/ai_adapter/working_history/Phase1_M1.0_/354/275/224/353/223/234/354/235/270/353/262/244/355/206/240/353/246/254_20260201.md +0 -197
  32. package/dist/docs/00_project/ai_adapter/working_history/Phase1_M1.1_/355/203/200/354/236/205/354/204/244/352/263/204_20260201.md +0 -185
  33. package/dist/docs/00_project/ai_adapter/working_history/Phase1_M1.2_Adapter/354/235/270/355/224/204/353/235/274_20260203.md +0 -378
  34. package/dist/docs/00_project/ai_adapter/working_history/Phase1_M1.3_Provider/354/204/240/355/203/235_20260206.md +0 -269
  35. package/dist/docs/00_project/ai_adapter/working_history/Phase1_M1.4_/354/234/240/355/213/270/353/246/254/355/213/260/353/247/210/354/235/264/352/267/270/353/240/210/354/235/264/354/205/230_20260206.md +0 -86
  36. package/dist/docs/00_project/ai_adapter/working_history/Phase2_ETC_/354/227/260/352/270/260/354/236/221/354/227/205/354/240/225/353/246/254_20260208.md +0 -157
  37. package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.0_/353/224/224/353/240/211/355/206/240/353/246/254/354/236/254/352/265/254/354/204/261_20260207.md +0 -107
  38. package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.1_ContentGenerator/354/235/270/355/204/260/355/216/230/354/235/264/354/212/244/354/236/254/354/240/225/354/235/230_20260207.md +0 -630
  39. package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.2_EventMapper/352/265/254/355/230/204_20260207.md +0 -372
  40. package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.3_GeminiAdapter/352/265/254/355/230/204_20260208.md +0 -205
  41. package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.4_ModelConfigService/355/230/270/355/231/230/353/240/210/354/235/264/354/226/264_20260208.md +0 -275
  42. package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.5_/354/234/240/355/213/270/353/246/254/355/213/260/353/240/210/354/235/264/354/226/264/353/246/254/355/214/251/355/206/240/353/247/201_20260208.md +0 -239
  43. package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.6_/353/235/274/354/232/260/355/214/205/353/240/210/354/235/264/354/226/264/355/203/200/354/236/205/353/217/205/353/246/275/355/231/224_20260208.md +0 -228
  44. package/dist/docs/00_project/ai_adapter/working_history/Phase3_ETC_/352/270/260/353/263/270/354/273/250/355/205/215/354/212/244/355/212/270/355/214/214/354/235/274/353/252/205AGENTS/354/240/204/355/231/230_20260211.md +0 -470
  45. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.0.1_Gemini/354/240/204/354/232/251/355/214/214/354/235/274/353/254/274/353/246/254/354/240/201/354/235/264/353/217/231_20260209.md +0 -271
  46. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.0.2_messageInspectors/353/247/210/354/235/264/352/267/270/353/240/210/354/235/264/354/205/230_20260209.md +0 -330
  47. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.0.3_/355/205/224/353/240/210/353/251/224/355/212/270/353/246/254Agent/353/217/205/353/246/275/355/231/224_20260209.md +0 -251
  48. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.0.4_/353/263/200/355/231/230/353/270/214/353/246/277/354/247/200/354/240/225/353/246/254_20260209.md +0 -136
  49. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.0.5_/353/237/260/355/203/200/354/236/204/354/213/244/355/226/211/352/262/275/353/241/234/354/227/260/352/262/260_20260209.md +0 -232
  50. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.1.0_Claude/354/202/254/354/240/204/354/244/200/353/271/204_20260209.md +0 -191
  51. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.1.1_ClaudeAdapter/352/265/254/355/230/204_20260209.md +0 -225
  52. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.1.2_ClaudeConverter/352/263/240/353/217/204/355/231/224_20260209.md +0 -171
  53. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.1.3_ClaudeStreamError/352/263/240/353/217/204/355/231/224_20260209.md +0 -198
  54. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.1.4_ClaudeErrorMapping_20260209.md +0 -98
  55. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.2.A_OpenAIAdapterCore_20260210.md +0 -264
  56. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.2.B_OpenAIStreamConverter_20260210.md +0 -204
  57. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.3.2_/353/252/250/353/215/270/355/205/234/355/224/214/353/246/277/355/233/205/353/263/264/354/231/204_20260211.md +0 -106
  58. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.3_OpenAICompatibleAdapter_20260211.md +0 -251
  59. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.4.2_E2E/355/205/214/354/212/244/355/212/270/354/213/234/353/202/230/353/246/254/354/230/244_20260210.md +0 -264
  60. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.4.3_/354/204/261/353/212/245/355/232/214/352/267/200/355/205/214/354/212/244/355/212/270_20260211.md +0 -176
  61. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.4.5_/354/225/210/354/240/225/355/231/224/354/236/221/354/227/205_20260211.md +0 -204
  62. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.4.A_CLI/355/206/265/355/225/251_3Provider/355/206/265/355/225/251/355/205/214/354/212/244/355/212/270_20260210.md +0 -316
  63. package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.4.A_UI/354/203/201/355/203/234/353/260/224/354/210/230/354/240/225_20260210.md +0 -262
  64. package/dist/docs/00_project/ai_adapter/working_history/phase2_tradeoff_EventType/354/240/204/355/231/230_20260208.md +0 -286
  65. package/dist/docs/00_project/white_labeling/template/00_vibecoding_workflow.md +0 -627
  66. package/dist/docs/00_project/white_labeling/template/01_todolist_performance_template.md +0 -400
  67. package/dist/docs/00_project/white_labeling/template/02_code_review_template.md +0 -248
  68. package/dist/docs/00_project/white_labeling/template/03_work_result_report_template.md +0 -133
  69. package/dist/docs/00_project/white_labeling/template/100_Python_Performance_Guide.md +0 -472
  70. package/dist/docs/00_project/white_labeling/template/99_TDD_plan.md +0 -123
  71. package/dist/docs/00_project/white_labeling/todolist/Phase_CLI/355/214/250/355/202/244/354/247/200/353/252/205/353/263/200/352/262/275_todolist.md +0 -431
  72. package/dist/docs/00_project/white_labeling/working_history/Phase_CLI/355/214/250/355/202/244/354/247/200/353/252/205/353/263/200/352/262/275_20260214.md +0 -238
  73. package/dist/docs/00_project/white_labeling//354/225/261/352/265/254/354/241/260.md +0 -310
  74. package/dist/docs/CONTRIBUTING.md +0 -554
  75. package/dist/docs/ai_adapter/01-overview.md +0 -155
  76. package/dist/docs/ai_adapter/02-architecture.md +0 -452
  77. package/dist/docs/ai_adapter/03-technical-design.md +0 -1470
  78. package/dist/docs/ai_adapter/04-integration-design.md +0 -1904
  79. package/dist/docs/ai_adapter/05-implementation-plan.md +0 -312
  80. package/dist/docs/ai_adapter/06-didiaistudio-plan.md +0 -559
  81. package/dist/docs/ai_adapter/README.md +0 -118
  82. package/dist/docs/ai_adapter/agent_service_openapi.json +0 -1
  83. package/dist/docs/ai_adapter/didimStudi-AISTUDIO /341/204/213/341/205/254/341/204/207/341/205/256 /341/204/211/341/205/245/341/204/207/341/205/265/341/204/211/341/205/263 /341/204/221/341/205/263/341/206/257/341/204/205/341/205/251/341/204/213/341/205/256 /341/204/213/341/205/247/341/206/253/341/204/200/341/205/247/341/206/257 /341/204/207/341/205/241/341/206/274/341/204/211/341/205/265/341/206/250-100226-093925.pdf +0 -0
  84. package/dist/docs/ai_adapter/event-mapping-matrix.md +0 -140
  85. package/dist/docs/ai_adapter/migration-plan.md +0 -205
  86. package/dist/docs/ai_adapter/template/00_vibecoding_workflow.md +0 -636
  87. package/dist/docs/ai_adapter/template/01_todolist_performance_template.md +0 -372
  88. package/dist/docs/ai_adapter/template/02_code_review_template.md +0 -220
  89. package/dist/docs/ai_adapter/template/03_work_result_report_template.md +0 -120
  90. package/dist/docs/ai_adapter/template/100_Python_Performance_Guide.md +0 -453
  91. package/dist/docs/ai_adapter/template/99_TDD_plan.md +0 -111
  92. package/dist/docs/ai_adapter/todolist/00_master_implementation_plan.md +0 -433
  93. package/dist/docs/ai_adapter/todolist/phase1_foundation_todolist.md +0 -726
  94. package/dist/docs/ai_adapter/todolist/phase2_core_refactoring_todolist.md +0 -974
  95. package/dist/docs/ai_adapter/todolist/phase3_handoff.md +0 -203
  96. package/dist/docs/ai_adapter/todolist/phase3_provider_extension_todolist.md +0 -1382
  97. package/dist/docs/ai_adapter/utility-migration.md +0 -237
  98. package/dist/docs/ai_adapter/working_history/.gitkeep +0 -0
  99. package/dist/docs/ai_adapter/working_history/Phase1_M1.0_/354/275/224/353/223/234/354/235/270/353/262/244/355/206/240/353/246/254_20260201.md +0 -185
  100. package/dist/docs/ai_adapter/working_history/Phase1_M1.1_/355/203/200/354/236/205/354/204/244/352/263/204_20260201.md +0 -185
  101. package/dist/docs/ai_adapter/working_history/Phase1_M1.2_Adapter/354/235/270/355/224/204/353/235/274_20260203.md +0 -378
  102. package/dist/docs/ai_adapter/working_history/Phase1_M1.3_Provider/354/204/240/355/203/235_20260206.md +0 -269
  103. package/dist/docs/ai_adapter/working_history/Phase1_M1.4_/354/234/240/355/213/270/353/246/254/355/213/260/353/247/210/354/235/264/352/267/270/353/240/210/354/235/264/354/205/230_20260206.md +0 -86
  104. package/dist/docs/ai_adapter/working_history/Phase2_ETC_/354/227/260/352/270/260/354/236/221/354/227/205/354/240/225/353/246/254_20260208.md +0 -157
  105. package/dist/docs/ai_adapter/working_history/Phase2_M2.0_/353/224/224/353/240/211/355/206/240/353/246/254/354/236/254/352/265/254/354/204/261_20260207.md +0 -107
  106. package/dist/docs/ai_adapter/working_history/Phase2_M2.1_ContentGenerator/354/235/270/355/204/260/355/216/230/354/235/264/354/212/244/354/236/254/354/240/225/354/235/230_20260207.md +0 -630
  107. package/dist/docs/ai_adapter/working_history/Phase2_M2.2_EventMapper/352/265/254/355/230/204_20260207.md +0 -372
  108. package/dist/docs/ai_adapter/working_history/Phase2_M2.3_GeminiAdapter/352/265/254/355/230/204_20260208.md +0 -205
  109. package/dist/docs/ai_adapter/working_history/Phase2_M2.4_ModelConfigService/355/230/270/355/231/230/353/240/210/354/235/264/354/226/264_20260208.md +0 -275
  110. package/dist/docs/ai_adapter/working_history/Phase2_M2.5_/354/234/240/355/213/270/353/246/254/355/213/260/353/240/210/354/235/264/354/226/264/353/246/254/355/214/251/355/206/240/353/247/201_20260208.md +0 -239
  111. package/dist/docs/ai_adapter/working_history/Phase2_M2.6_/353/235/274/354/232/260/355/214/205/353/240/210/354/235/264/354/226/264/355/203/200/354/236/205/353/217/205/353/246/275/355/231/224_20260208.md +0 -228
  112. package/dist/docs/ai_adapter/working_history/Phase3_ETC_/352/270/260/353/263/270/354/273/250/355/205/215/354/212/244/355/212/270/355/214/214/354/235/274/353/252/205AGENTS/354/240/204/355/231/230_20260211.md +0 -367
  113. package/dist/docs/ai_adapter/working_history/Phase3_M3.0.1_Gemini/354/240/204/354/232/251/355/214/214/354/235/274/353/254/274/353/246/254/354/240/201/354/235/264/353/217/231_20260209.md +0 -271
  114. package/dist/docs/ai_adapter/working_history/Phase3_M3.0.2_messageInspectors/353/247/210/354/235/264/352/267/270/353/240/210/354/235/264/354/205/230_20260209.md +0 -330
  115. package/dist/docs/ai_adapter/working_history/Phase3_M3.0.3_/355/205/224/353/240/210/353/251/224/355/212/270/353/246/254Agent/353/217/205/353/246/275/355/231/224_20260209.md +0 -251
  116. package/dist/docs/ai_adapter/working_history/Phase3_M3.0.4_/353/263/200/355/231/230/353/270/214/353/246/277/354/247/200/354/240/225/353/246/254_20260209.md +0 -136
  117. package/dist/docs/ai_adapter/working_history/Phase3_M3.0.5_/353/237/260/355/203/200/354/236/204/354/213/244/355/226/211/352/262/275/353/241/234/354/227/260/352/262/260_20260209.md +0 -232
  118. package/dist/docs/ai_adapter/working_history/Phase3_M3.1.0_Claude/354/202/254/354/240/204/354/244/200/353/271/204_20260209.md +0 -191
  119. package/dist/docs/ai_adapter/working_history/Phase3_M3.1.1_ClaudeAdapter/352/265/254/355/230/204_20260209.md +0 -225
  120. package/dist/docs/ai_adapter/working_history/Phase3_M3.1.2_ClaudeConverter/352/263/240/353/217/204/355/231/224_20260209.md +0 -171
  121. package/dist/docs/ai_adapter/working_history/Phase3_M3.1.3_ClaudeStreamError/352/263/240/353/217/204/355/231/224_20260209.md +0 -198
  122. package/dist/docs/ai_adapter/working_history/Phase3_M3.1.4_ClaudeErrorMapping_20260209.md +0 -98
  123. package/dist/docs/ai_adapter/working_history/Phase3_M3.2.A_OpenAIAdapterCore_20260210.md +0 -264
  124. package/dist/docs/ai_adapter/working_history/Phase3_M3.2.B_OpenAIStreamConverter_20260210.md +0 -204
  125. package/dist/docs/ai_adapter/working_history/Phase3_M3.3.2_/353/252/250/353/215/270/355/205/234/355/224/214/353/246/277/355/233/205/353/263/264/354/231/204_20260211.md +0 -106
  126. package/dist/docs/ai_adapter/working_history/Phase3_M3.3_OpenAICompatibleAdapter_20260211.md +0 -251
  127. package/dist/docs/ai_adapter/working_history/Phase3_M3.4.2_E2E/355/205/214/354/212/244/355/212/270/354/213/234/353/202/230/353/246/254/354/230/244_20260210.md +0 -264
  128. package/dist/docs/ai_adapter/working_history/Phase3_M3.4.3_/354/204/261/353/212/245/355/232/214/352/267/200/355/205/214/354/212/244/355/212/270_20260211.md +0 -176
  129. package/dist/docs/ai_adapter/working_history/Phase3_M3.4.5_/354/225/210/354/240/225/355/231/224/354/236/221/354/227/205_20260211.md +0 -204
  130. package/dist/docs/ai_adapter/working_history/Phase3_M3.4.A_CLI/355/206/265/355/225/251_3Provider/355/206/265/355/225/251/355/205/214/354/212/244/355/212/270_20260210.md +0 -316
  131. package/dist/docs/ai_adapter/working_history/Phase3_M3.4.A_UI/354/203/201/355/203/234/353/260/224/354/210/230/354/240/225_20260210.md +0 -262
  132. package/dist/docs/ai_adapter/working_history/phase2_tradeoff_EventType/354/240/204/355/231/230_20260208.md +0 -286
  133. package/dist/docs/api/index.md +0 -5
  134. package/dist/docs/api/providers.md +0 -56
  135. package/dist/docs/architecture.md +0 -80
  136. package/dist/docs/assets/connected_devtools.png +0 -0
  137. package/dist/docs/assets/gemini-screenshot.png +0 -0
  138. package/dist/docs/assets/monitoring-dashboard-logs.png +0 -0
  139. package/dist/docs/assets/monitoring-dashboard-metrics.png +0 -0
  140. package/dist/docs/assets/monitoring-dashboard-overview.png +0 -0
  141. package/dist/docs/assets/release_patch.png +0 -0
  142. package/dist/docs/assets/theme-ansi-light.png +0 -0
  143. package/dist/docs/assets/theme-ansi.png +0 -0
  144. package/dist/docs/assets/theme-atom-one.png +0 -0
  145. package/dist/docs/assets/theme-ayu-light.png +0 -0
  146. package/dist/docs/assets/theme-ayu.png +0 -0
  147. package/dist/docs/assets/theme-custom.png +0 -0
  148. package/dist/docs/assets/theme-default-light.png +0 -0
  149. package/dist/docs/assets/theme-default.png +0 -0
  150. package/dist/docs/assets/theme-dracula.png +0 -0
  151. package/dist/docs/assets/theme-github-light.png +0 -0
  152. package/dist/docs/assets/theme-github.png +0 -0
  153. package/dist/docs/assets/theme-google-light.png +0 -0
  154. package/dist/docs/assets/theme-xcode-light.png +0 -0
  155. package/dist/docs/change_model/model_command_multi_provider_plan.md +0 -221
  156. package/dist/docs/change_model/model_command_multi_provider_todolist.md +0 -206
  157. package/dist/docs/changelogs/index.md +0 -726
  158. package/dist/docs/changelogs/latest.md +0 -370
  159. package/dist/docs/changelogs/preview.md +0 -332
  160. package/dist/docs/cli/authentication.md +0 -3
  161. package/dist/docs/cli/checkpointing.md +0 -94
  162. package/dist/docs/cli/commands.md +0 -375
  163. package/dist/docs/cli/custom-commands.md +0 -315
  164. package/dist/docs/cli/enterprise.md +0 -565
  165. package/dist/docs/cli/gemini-ignore.md +0 -71
  166. package/dist/docs/cli/gemini-md.md +0 -108
  167. package/dist/docs/cli/generation-settings.md +0 -210
  168. package/dist/docs/cli/headless.md +0 -388
  169. package/dist/docs/cli/index.md +0 -65
  170. package/dist/docs/cli/keyboard-shortcuts.md +0 -129
  171. package/dist/docs/cli/model-routing.md +0 -42
  172. package/dist/docs/cli/model.md +0 -62
  173. package/dist/docs/cli/sandbox.md +0 -171
  174. package/dist/docs/cli/session-management.md +0 -158
  175. package/dist/docs/cli/settings.md +0 -130
  176. package/dist/docs/cli/skills.md +0 -188
  177. package/dist/docs/cli/system-prompt.md +0 -125
  178. package/dist/docs/cli/telemetry.md +0 -826
  179. package/dist/docs/cli/themes.md +0 -235
  180. package/dist/docs/cli/token-caching.md +0 -20
  181. package/dist/docs/cli/trusted-folders.md +0 -95
  182. package/dist/docs/cli/tutorials/skills-getting-started.md +0 -124
  183. package/dist/docs/cli/tutorials.md +0 -87
  184. package/dist/docs/cli/uninstall.md +0 -65
  185. package/dist/docs/configuration.md +0 -108
  186. package/dist/docs/core/index.md +0 -105
  187. package/dist/docs/core/long-term-memory-design.md +0 -254
  188. package/dist/docs/core/long-term-memory-proposal.md +0 -112
  189. package/dist/docs/core/memport.md +0 -246
  190. package/dist/docs/core/policy-engine.md +0 -300
  191. package/dist/docs/core/tools-api.md +0 -131
  192. package/dist/docs/examples/proxy-script.md +0 -83
  193. package/dist/docs/extensions/best-practices.md +0 -139
  194. package/dist/docs/extensions/index.md +0 -44
  195. package/dist/docs/extensions/reference.md +0 -312
  196. package/dist/docs/extensions/releasing.md +0 -183
  197. package/dist/docs/extensions/writing-extensions.md +0 -283
  198. package/dist/docs/faq.md +0 -154
  199. package/dist/docs/get-started/authentication.md +0 -321
  200. package/dist/docs/get-started/configuration-v1.md +0 -888
  201. package/dist/docs/get-started/configuration.md +0 -1567
  202. package/dist/docs/get-started/examples.md +0 -219
  203. package/dist/docs/get-started/gemini-3.md +0 -101
  204. package/dist/docs/get-started/index.md +0 -71
  205. package/dist/docs/get-started/installation.md +0 -141
  206. package/dist/docs/hooks/best-practices.md +0 -677
  207. package/dist/docs/hooks/index.md +0 -178
  208. package/dist/docs/hooks/reference.md +0 -322
  209. package/dist/docs/hooks/writing-hooks.md +0 -450
  210. package/dist/docs/ide-integration/ide-companion-spec.md +0 -267
  211. package/dist/docs/ide-integration/index.md +0 -202
  212. package/dist/docs/index.md +0 -153
  213. package/dist/docs/integration-tests.md +0 -211
  214. package/dist/docs/issue-and-pr-automation.md +0 -134
  215. package/dist/docs/local-development.md +0 -128
  216. package/dist/docs/mermaid/context.mmd +0 -103
  217. package/dist/docs/mermaid/render-path.mmd +0 -64
  218. package/dist/docs/migration.md +0 -78
  219. package/dist/docs/npm.md +0 -62
  220. package/dist/docs/providers.md +0 -136
  221. package/dist/docs/quota-and-pricing.md +0 -158
  222. package/dist/docs/release-confidence.md +0 -164
  223. package/dist/docs/releases.md +0 -539
  224. package/dist/docs/sidebar.json +0 -140
  225. package/dist/docs/tools/file-system.md +0 -217
  226. package/dist/docs/tools/index.md +0 -98
  227. package/dist/docs/tools/mcp-server.md +0 -1068
  228. package/dist/docs/tools/memory.md +0 -54
  229. package/dist/docs/tools/shell.md +0 -260
  230. package/dist/docs/tools/todos.md +0 -57
  231. package/dist/docs/tools/web-fetch.md +0 -59
  232. package/dist/docs/tools/web-search.md +0 -42
  233. package/dist/docs/tos-privacy.md +0 -96
  234. package/dist/docs/troubleshooting.md +0 -173
  235. package/dist/src/agents/a2a-client-manager.test.d.ts +0 -6
  236. package/dist/src/agents/a2a-client-manager.test.js +0 -220
  237. package/dist/src/agents/a2a-client-manager.test.js.map +0 -1
  238. package/dist/src/agents/a2aUtils.test.d.ts +0 -6
  239. package/dist/src/agents/a2aUtils.test.js +0 -147
  240. package/dist/src/agents/a2aUtils.test.js.map +0 -1
  241. package/dist/src/agents/acknowledgedAgents.test.d.ts +0 -6
  242. package/dist/src/agents/acknowledgedAgents.test.js +0 -70
  243. package/dist/src/agents/acknowledgedAgents.test.js.map +0 -1
  244. package/dist/src/agents/agent-scheduler.test.d.ts +0 -6
  245. package/dist/src/agents/agent-scheduler.test.js +0 -56
  246. package/dist/src/agents/agent-scheduler.test.js.map +0 -1
  247. package/dist/src/agents/agentLoader.test.d.ts +0 -6
  248. package/dist/src/agents/agentLoader.test.js +0 -304
  249. package/dist/src/agents/agentLoader.test.js.map +0 -1
  250. package/dist/src/agents/cli-help-agent.test.d.ts +0 -6
  251. package/dist/src/agents/cli-help-agent.test.js +0 -67
  252. package/dist/src/agents/cli-help-agent.test.js.map +0 -1
  253. package/dist/src/agents/codebase-investigator.test.d.ts +0 -6
  254. package/dist/src/agents/codebase-investigator.test.js +0 -42
  255. package/dist/src/agents/codebase-investigator.test.js.map +0 -1
  256. package/dist/src/agents/generalist-agent.test.d.ts +0 -6
  257. package/dist/src/agents/generalist-agent.test.js +0 -31
  258. package/dist/src/agents/generalist-agent.test.js.map +0 -1
  259. package/dist/src/agents/local-executor.test.d.ts +0 -6
  260. package/dist/src/agents/local-executor.test.js +0 -1577
  261. package/dist/src/agents/local-executor.test.js.map +0 -1
  262. package/dist/src/agents/local-invocation.test.d.ts +0 -6
  263. package/dist/src/agents/local-invocation.test.js +0 -228
  264. package/dist/src/agents/local-invocation.test.js.map +0 -1
  265. package/dist/src/agents/registry.test.d.ts +0 -6
  266. package/dist/src/agents/registry.test.js +0 -773
  267. package/dist/src/agents/registry.test.js.map +0 -1
  268. package/dist/src/agents/registry_acknowledgement.test.d.ts +0 -6
  269. package/dist/src/agents/registry_acknowledgement.test.js +0 -130
  270. package/dist/src/agents/registry_acknowledgement.test.js.map +0 -1
  271. package/dist/src/agents/remote-invocation.test.d.ts +0 -6
  272. package/dist/src/agents/remote-invocation.test.js +0 -213
  273. package/dist/src/agents/remote-invocation.test.js.map +0 -1
  274. package/dist/src/agents/subagent-tool-wrapper.test.d.ts +0 -6
  275. package/dist/src/agents/subagent-tool-wrapper.test.js +0 -109
  276. package/dist/src/agents/subagent-tool-wrapper.test.js.map +0 -1
  277. package/dist/src/agents/utils.test.d.ts +0 -6
  278. package/dist/src/agents/utils.test.js +0 -87
  279. package/dist/src/agents/utils.test.js.map +0 -1
  280. package/dist/src/availability/fallbackIntegration.test.d.ts +0 -6
  281. package/dist/src/availability/fallbackIntegration.test.js +0 -58
  282. package/dist/src/availability/fallbackIntegration.test.js.map +0 -1
  283. package/dist/src/availability/modelAvailabilityService.test.d.ts +0 -6
  284. package/dist/src/availability/modelAvailabilityService.test.js +0 -140
  285. package/dist/src/availability/modelAvailabilityService.test.js.map +0 -1
  286. package/dist/src/availability/policyCatalog.test.d.ts +0 -6
  287. package/dist/src/availability/policyCatalog.test.js +0 -70
  288. package/dist/src/availability/policyCatalog.test.js.map +0 -1
  289. package/dist/src/availability/policyHelpers.test.d.ts +0 -6
  290. package/dist/src/availability/policyHelpers.test.js +0 -220
  291. package/dist/src/availability/policyHelpers.test.js.map +0 -1
  292. package/dist/src/code_assist/admin/admin_controls.test.d.ts +0 -6
  293. package/dist/src/code_assist/admin/admin_controls.test.js +0 -200
  294. package/dist/src/code_assist/admin/admin_controls.test.js.map +0 -1
  295. package/dist/src/code_assist/codeAssist.test.d.ts +0 -6
  296. package/dist/src/code_assist/codeAssist.test.js +0 -102
  297. package/dist/src/code_assist/codeAssist.test.js.map +0 -1
  298. package/dist/src/code_assist/converter.test.d.ts +0 -6
  299. package/dist/src/code_assist/converter.test.js +0 -391
  300. package/dist/src/code_assist/converter.test.js.map +0 -1
  301. package/dist/src/code_assist/experiments/client_metadata.test.d.ts +0 -6
  302. package/dist/src/code_assist/experiments/client_metadata.test.js +0 -96
  303. package/dist/src/code_assist/experiments/client_metadata.test.js.map +0 -1
  304. package/dist/src/code_assist/experiments/experiments.test.d.ts +0 -6
  305. package/dist/src/code_assist/experiments/experiments.test.js +0 -93
  306. package/dist/src/code_assist/experiments/experiments.test.js.map +0 -1
  307. package/dist/src/code_assist/experiments/experiments_local.test.d.ts +0 -6
  308. package/dist/src/code_assist/experiments/experiments_local.test.js +0 -115
  309. package/dist/src/code_assist/experiments/experiments_local.test.js.map +0 -1
  310. package/dist/src/code_assist/oauth-credential-storage.test.d.ts +0 -6
  311. package/dist/src/code_assist/oauth-credential-storage.test.js +0 -198
  312. package/dist/src/code_assist/oauth-credential-storage.test.js.map +0 -1
  313. package/dist/src/code_assist/oauth2.test.d.ts +0 -6
  314. package/dist/src/code_assist/oauth2.test.js +0 -1065
  315. package/dist/src/code_assist/oauth2.test.js.map +0 -1
  316. package/dist/src/code_assist/server.test.d.ts +0 -6
  317. package/dist/src/code_assist/server.test.js +0 -453
  318. package/dist/src/code_assist/server.test.js.map +0 -1
  319. package/dist/src/code_assist/setup.test.d.ts +0 -6
  320. package/dist/src/code_assist/setup.test.js +0 -517
  321. package/dist/src/code_assist/setup.test.js.map +0 -1
  322. package/dist/src/code_assist/telemetry.test.d.ts +0 -6
  323. package/dist/src/code_assist/telemetry.test.js +0 -301
  324. package/dist/src/code_assist/telemetry.test.js.map +0 -1
  325. package/dist/src/commands/extensions.test.d.ts +0 -6
  326. package/dist/src/commands/extensions.test.js +0 -19
  327. package/dist/src/commands/extensions.test.js.map +0 -1
  328. package/dist/src/commands/init.test.d.ts +0 -6
  329. package/dist/src/commands/init.test.js +0 -25
  330. package/dist/src/commands/init.test.js.map +0 -1
  331. package/dist/src/commands/memory.test.d.ts +0 -6
  332. package/dist/src/commands/memory.test.js +0 -182
  333. package/dist/src/commands/memory.test.js.map +0 -1
  334. package/dist/src/commands/restore.test.d.ts +0 -6
  335. package/dist/src/commands/restore.test.js +0 -137
  336. package/dist/src/commands/restore.test.js.map +0 -1
  337. package/dist/src/config/config.test.d.ts +0 -6
  338. package/dist/src/config/config.test.js +0 -1811
  339. package/dist/src/config/config.test.js.map +0 -1
  340. package/dist/src/config/flashFallback.test.d.ts +0 -6
  341. package/dist/src/config/flashFallback.test.js +0 -63
  342. package/dist/src/config/flashFallback.test.js.map +0 -1
  343. package/dist/src/config/models.test.d.ts +0 -6
  344. package/dist/src/config/models.test.js +0 -146
  345. package/dist/src/config/models.test.js.map +0 -1
  346. package/dist/src/config/storage.test.d.ts +0 -6
  347. package/dist/src/config/storage.test.js +0 -115
  348. package/dist/src/config/storage.test.js.map +0 -1
  349. package/dist/src/confirmation-bus/message-bus.test.d.ts +0 -6
  350. package/dist/src/confirmation-bus/message-bus.test.js +0 -170
  351. package/dist/src/confirmation-bus/message-bus.test.js.map +0 -1
  352. package/dist/src/core/apiKeyCredentialStorage.test.d.ts +0 -6
  353. package/dist/src/core/apiKeyCredentialStorage.test.js +0 -71
  354. package/dist/src/core/apiKeyCredentialStorage.test.js.map +0 -1
  355. package/dist/src/core/baseLlmClient.test.d.ts +0 -6
  356. package/dist/src/core/baseLlmClient.test.js +0 -569
  357. package/dist/src/core/baseLlmClient.test.js.map +0 -1
  358. package/dist/src/core/baseLlmClient_new_types.test.d.ts +0 -1
  359. package/dist/src/core/baseLlmClient_new_types.test.js +0 -387
  360. package/dist/src/core/baseLlmClient_new_types.test.js.map +0 -1
  361. package/dist/src/core/client.test.d.ts +0 -6
  362. package/dist/src/core/client.test.js +0 -2654
  363. package/dist/src/core/client.test.js.map +0 -1
  364. package/dist/src/core/contentGenerator.multiProvider.test.d.ts +0 -6
  365. package/dist/src/core/contentGenerator.multiProvider.test.js +0 -314
  366. package/dist/src/core/contentGenerator.multiProvider.test.js.map +0 -1
  367. package/dist/src/core/contentGenerator.test.d.ts +0 -6
  368. package/dist/src/core/contentGenerator.test.js +0 -299
  369. package/dist/src/core/contentGenerator.test.js.map +0 -1
  370. package/dist/src/core/contentGenerator_new_types.test.d.ts +0 -6
  371. package/dist/src/core/contentGenerator_new_types.test.js +0 -292
  372. package/dist/src/core/contentGenerator_new_types.test.js.map +0 -1
  373. package/dist/src/core/coreToolHookTriggers.test.d.ts +0 -6
  374. package/dist/src/core/coreToolHookTriggers.test.js +0 -159
  375. package/dist/src/core/coreToolHookTriggers.test.js.map +0 -1
  376. package/dist/src/core/coreToolScheduler.test.d.ts +0 -6
  377. package/dist/src/core/coreToolScheduler.test.js +0 -1684
  378. package/dist/src/core/coreToolScheduler.test.js.map +0 -1
  379. package/dist/src/core/fakeContentGenerator.test.d.ts +0 -6
  380. package/dist/src/core/fakeContentGenerator.test.js +0 -127
  381. package/dist/src/core/fakeContentGenerator.test.js.map +0 -1
  382. package/dist/src/core/geminiChat.test.d.ts +0 -6
  383. package/dist/src/core/geminiChat.test.js +0 -1773
  384. package/dist/src/core/geminiChat.test.js.map +0 -1
  385. package/dist/src/core/geminiChat_network_retry.test.d.ts +0 -6
  386. package/dist/src/core/geminiChat_network_retry.test.js +0 -201
  387. package/dist/src/core/geminiChat_network_retry.test.js.map +0 -1
  388. package/dist/src/core/logger.test.d.ts +0 -6
  389. package/dist/src/core/logger.test.js +0 -550
  390. package/dist/src/core/logger.test.js.map +0 -1
  391. package/dist/src/core/loggingContentGenerator.test.d.ts +0 -6
  392. package/dist/src/core/loggingContentGenerator.test.js +0 -221
  393. package/dist/src/core/loggingContentGenerator.test.js.map +0 -1
  394. package/dist/src/core/prompts-substitution.test.d.ts +0 -6
  395. package/dist/src/core/prompts-substitution.test.js +0 -101
  396. package/dist/src/core/prompts-substitution.test.js.map +0 -1
  397. package/dist/src/core/prompts.test.d.ts +0 -6
  398. package/dist/src/core/prompts.test.js +0 -391
  399. package/dist/src/core/prompts.test.js.map +0 -1
  400. package/dist/src/core/recordingContentGenerator.test.d.ts +0 -6
  401. package/dist/src/core/recordingContentGenerator.test.js +0 -101
  402. package/dist/src/core/recordingContentGenerator.test.js.map +0 -1
  403. package/dist/src/core/tokenLimits.test.d.ts +0 -6
  404. package/dist/src/core/tokenLimits.test.js +0 -30
  405. package/dist/src/core/tokenLimits.test.js.map +0 -1
  406. package/dist/src/core/turn.test.d.ts +0 -6
  407. package/dist/src/core/turn.test.js +0 -739
  408. package/dist/src/core/turn.test.js.map +0 -1
  409. package/dist/src/fallback/handler.test.d.ts +0 -6
  410. package/dist/src/fallback/handler.test.js +0 -242
  411. package/dist/src/fallback/handler.test.js.map +0 -1
  412. package/dist/src/hooks/hookAggregator.test.d.ts +0 -6
  413. package/dist/src/hooks/hookAggregator.test.js +0 -387
  414. package/dist/src/hooks/hookAggregator.test.js.map +0 -1
  415. package/dist/src/hooks/hookEventHandler.test.d.ts +0 -6
  416. package/dist/src/hooks/hookEventHandler.test.js +0 -603
  417. package/dist/src/hooks/hookEventHandler.test.js.map +0 -1
  418. package/dist/src/hooks/hookPlanner.test.d.ts +0 -6
  419. package/dist/src/hooks/hookPlanner.test.js +0 -315
  420. package/dist/src/hooks/hookPlanner.test.js.map +0 -1
  421. package/dist/src/hooks/hookRegistry.test.d.ts +0 -6
  422. package/dist/src/hooks/hookRegistry.test.js +0 -529
  423. package/dist/src/hooks/hookRegistry.test.js.map +0 -1
  424. package/dist/src/hooks/hookRunner.test.d.ts +0 -6
  425. package/dist/src/hooks/hookRunner.test.js +0 -606
  426. package/dist/src/hooks/hookRunner.test.js.map +0 -1
  427. package/dist/src/hooks/hookSystem.test.d.ts +0 -6
  428. package/dist/src/hooks/hookSystem.test.js +0 -330
  429. package/dist/src/hooks/hookSystem.test.js.map +0 -1
  430. package/dist/src/hooks/hookSystem_new_types.test.d.ts +0 -6
  431. package/dist/src/hooks/hookSystem_new_types.test.js +0 -243
  432. package/dist/src/hooks/hookSystem_new_types.test.js.map +0 -1
  433. package/dist/src/hooks/hookTranslator.test.d.ts +0 -6
  434. package/dist/src/hooks/hookTranslator.test.js +0 -192
  435. package/dist/src/hooks/hookTranslator.test.js.map +0 -1
  436. package/dist/src/hooks/trustedHooks.test.d.ts +0 -6
  437. package/dist/src/hooks/trustedHooks.test.js +0 -154
  438. package/dist/src/hooks/trustedHooks.test.js.map +0 -1
  439. package/dist/src/hooks/types.test.d.ts +0 -6
  440. package/dist/src/hooks/types.test.js +0 -278
  441. package/dist/src/hooks/types.test.js.map +0 -1
  442. package/dist/src/ide/detect-ide.test.d.ts +0 -6
  443. package/dist/src/ide/detect-ide.test.js +0 -195
  444. package/dist/src/ide/detect-ide.test.js.map +0 -1
  445. package/dist/src/ide/ide-client.test.d.ts +0 -6
  446. package/dist/src/ide/ide-client.test.js +0 -753
  447. package/dist/src/ide/ide-client.test.js.map +0 -1
  448. package/dist/src/ide/ide-installer.test.d.ts +0 -6
  449. package/dist/src/ide/ide-installer.test.js +0 -193
  450. package/dist/src/ide/ide-installer.test.js.map +0 -1
  451. package/dist/src/ide/ideContext.test.d.ts +0 -6
  452. package/dist/src/ide/ideContext.test.js +0 -393
  453. package/dist/src/ide/ideContext.test.js.map +0 -1
  454. package/dist/src/ide/process-utils.test.d.ts +0 -6
  455. package/dist/src/ide/process-utils.test.js +0 -151
  456. package/dist/src/ide/process-utils.test.js.map +0 -1
  457. package/dist/src/index.test.d.ts +0 -6
  458. package/dist/src/index.test.js +0 -53
  459. package/dist/src/index.test.js.map +0 -1
  460. package/dist/src/mcp/google-auth-provider.test.d.ts +0 -6
  461. package/dist/src/mcp/google-auth-provider.test.js +0 -167
  462. package/dist/src/mcp/google-auth-provider.test.js.map +0 -1
  463. package/dist/src/mcp/oauth-provider.test.d.ts +0 -6
  464. package/dist/src/mcp/oauth-provider.test.js +0 -1355
  465. package/dist/src/mcp/oauth-provider.test.js.map +0 -1
  466. package/dist/src/mcp/oauth-token-storage.test.d.ts +0 -6
  467. package/dist/src/mcp/oauth-token-storage.test.js +0 -305
  468. package/dist/src/mcp/oauth-token-storage.test.js.map +0 -1
  469. package/dist/src/mcp/oauth-utils.test.d.ts +0 -6
  470. package/dist/src/mcp/oauth-utils.test.js +0 -289
  471. package/dist/src/mcp/oauth-utils.test.js.map +0 -1
  472. package/dist/src/mcp/sa-impersonation-provider.test.d.ts +0 -6
  473. package/dist/src/mcp/sa-impersonation-provider.test.js +0 -117
  474. package/dist/src/mcp/sa-impersonation-provider.test.js.map +0 -1
  475. package/dist/src/mcp/token-storage/base-token-storage.test.d.ts +0 -6
  476. package/dist/src/mcp/token-storage/base-token-storage.test.js +0 -151
  477. package/dist/src/mcp/token-storage/base-token-storage.test.js.map +0 -1
  478. package/dist/src/mcp/token-storage/file-token-storage.test.d.ts +0 -6
  479. package/dist/src/mcp/token-storage/file-token-storage.test.js +0 -238
  480. package/dist/src/mcp/token-storage/file-token-storage.test.js.map +0 -1
  481. package/dist/src/mcp/token-storage/hybrid-token-storage.test.d.ts +0 -6
  482. package/dist/src/mcp/token-storage/hybrid-token-storage.test.js +0 -193
  483. package/dist/src/mcp/token-storage/hybrid-token-storage.test.js.map +0 -1
  484. package/dist/src/mcp/token-storage/keychain-token-storage.test.d.ts +0 -6
  485. package/dist/src/mcp/token-storage/keychain-token-storage.test.js +0 -305
  486. package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +0 -1
  487. package/dist/src/output/json-formatter.test.d.ts +0 -6
  488. package/dist/src/output/json-formatter.test.js +0 -294
  489. package/dist/src/output/json-formatter.test.js.map +0 -1
  490. package/dist/src/output/stream-json-formatter.test.d.ts +0 -6
  491. package/dist/src/output/stream-json-formatter.test.js +0 -477
  492. package/dist/src/output/stream-json-formatter.test.js.map +0 -1
  493. package/dist/src/policy/config.test.d.ts +0 -6
  494. package/dist/src/policy/config.test.js +0 -598
  495. package/dist/src/policy/config.test.js.map +0 -1
  496. package/dist/src/policy/persistence.test.d.ts +0 -6
  497. package/dist/src/policy/persistence.test.js +0 -154
  498. package/dist/src/policy/persistence.test.js.map +0 -1
  499. package/dist/src/policy/policy-engine.test.d.ts +0 -6
  500. package/dist/src/policy/policy-engine.test.js +0 -1299
  501. package/dist/src/policy/policy-engine.test.js.map +0 -1
  502. package/dist/src/policy/policy-updater.test.d.ts +0 -6
  503. package/dist/src/policy/policy-updater.test.js +0 -116
  504. package/dist/src/policy/policy-updater.test.js.map +0 -1
  505. package/dist/src/policy/shell-safety.test.d.ts +0 -6
  506. package/dist/src/policy/shell-safety.test.js +0 -438
  507. package/dist/src/policy/shell-safety.test.js.map +0 -1
  508. package/dist/src/policy/toml-loader.test.d.ts +0 -6
  509. package/dist/src/policy/toml-loader.test.js +0 -409
  510. package/dist/src/policy/toml-loader.test.js.map +0 -1
  511. package/dist/src/policy/utils.test.d.ts +0 -6
  512. package/dist/src/policy/utils.test.js +0 -92
  513. package/dist/src/policy/utils.test.js.map +0 -1
  514. package/dist/src/prompts/mcp-prompts.test.d.ts +0 -6
  515. package/dist/src/prompts/mcp-prompts.test.js +0 -39
  516. package/dist/src/prompts/mcp-prompts.test.js.map +0 -1
  517. package/dist/src/prompts/prompt-registry.test.d.ts +0 -6
  518. package/dist/src/prompts/prompt-registry.test.js +0 -96
  519. package/dist/src/prompts/prompt-registry.test.js.map +0 -1
  520. package/dist/src/providers/__tests__/bundleSize.test.d.ts +0 -6
  521. package/dist/src/providers/__tests__/bundleSize.test.js +0 -75
  522. package/dist/src/providers/__tests__/bundleSize.test.js.map +0 -1
  523. package/dist/src/providers/__tests__/errorHandling.integration.test.d.ts +0 -6
  524. package/dist/src/providers/__tests__/errorHandling.integration.test.js +0 -339
  525. package/dist/src/providers/__tests__/errorHandling.integration.test.js.map +0 -1
  526. package/dist/src/providers/__tests__/multiProvider.integration.test.d.ts +0 -6
  527. package/dist/src/providers/__tests__/multiProvider.integration.test.js +0 -419
  528. package/dist/src/providers/__tests__/multiProvider.integration.test.js.map +0 -1
  529. package/dist/src/providers/__tests__/performance.test.d.ts +0 -6
  530. package/dist/src/providers/__tests__/performance.test.js +0 -270
  531. package/dist/src/providers/__tests__/performance.test.js.map +0 -1
  532. package/dist/src/providers/__tests__/providerConfigIntegration.test.d.ts +0 -6
  533. package/dist/src/providers/__tests__/providerConfigIntegration.test.js +0 -245
  534. package/dist/src/providers/__tests__/providerConfigIntegration.test.js.map +0 -1
  535. package/dist/src/providers/baseAdapter.test.d.ts +0 -1
  536. package/dist/src/providers/baseAdapter.test.js +0 -142
  537. package/dist/src/providers/baseAdapter.test.js.map +0 -1
  538. package/dist/src/providers/claude/adapter.test.d.ts +0 -6
  539. package/dist/src/providers/claude/adapter.test.js +0 -628
  540. package/dist/src/providers/claude/adapter.test.js.map +0 -1
  541. package/dist/src/providers/claude/bootstrap.test.d.ts +0 -6
  542. package/dist/src/providers/claude/bootstrap.test.js +0 -74
  543. package/dist/src/providers/claude/bootstrap.test.js.map +0 -1
  544. package/dist/src/providers/claude/converter.test.d.ts +0 -6
  545. package/dist/src/providers/claude/converter.test.js +0 -1002
  546. package/dist/src/providers/claude/converter.test.js.map +0 -1
  547. package/dist/src/providers/claude/exports.test.d.ts +0 -6
  548. package/dist/src/providers/claude/exports.test.js +0 -40
  549. package/dist/src/providers/claude/exports.test.js.map +0 -1
  550. package/dist/src/providers/configAdapter.test.d.ts +0 -1
  551. package/dist/src/providers/configAdapter.test.js +0 -150
  552. package/dist/src/providers/configAdapter.test.js.map +0 -1
  553. package/dist/src/providers/contentResolver.test.d.ts +0 -1
  554. package/dist/src/providers/contentResolver.test.js +0 -89
  555. package/dist/src/providers/contentResolver.test.js.map +0 -1
  556. package/dist/src/providers/factory.test.d.ts +0 -1
  557. package/dist/src/providers/factory.test.js +0 -151
  558. package/dist/src/providers/factory.test.js.map +0 -1
  559. package/dist/src/providers/gemini/adapterBridge.test.d.ts +0 -6
  560. package/dist/src/providers/gemini/adapterBridge.test.js +0 -164
  561. package/dist/src/providers/gemini/adapterBridge.test.js.map +0 -1
  562. package/dist/src/providers/gemini/bootstrap.test.d.ts +0 -6
  563. package/dist/src/providers/gemini/bootstrap.test.js +0 -72
  564. package/dist/src/providers/gemini/bootstrap.test.js.map +0 -1
  565. package/dist/src/providers/gemini/configConverter.test.d.ts +0 -6
  566. package/dist/src/providers/gemini/configConverter.test.js +0 -218
  567. package/dist/src/providers/gemini/configConverter.test.js.map +0 -1
  568. package/dist/src/providers/gemini/errorClassifier.test.d.ts +0 -6
  569. package/dist/src/providers/gemini/errorClassifier.test.js +0 -83
  570. package/dist/src/providers/gemini/errorClassifier.test.js.map +0 -1
  571. package/dist/src/providers/gemini/eventMapper.test.d.ts +0 -6
  572. package/dist/src/providers/gemini/eventMapper.test.js +0 -502
  573. package/dist/src/providers/gemini/eventMapper.test.js.map +0 -1
  574. package/dist/src/providers/gemini/exports.test.d.ts +0 -6
  575. package/dist/src/providers/gemini/exports.test.js +0 -90
  576. package/dist/src/providers/gemini/exports.test.js.map +0 -1
  577. package/dist/src/providers/gemini/featureFlag.test.d.ts +0 -6
  578. package/dist/src/providers/gemini/featureFlag.test.js +0 -139
  579. package/dist/src/providers/gemini/featureFlag.test.js.map +0 -1
  580. package/dist/src/providers/gemini/geminiAdapter.test.d.ts +0 -6
  581. package/dist/src/providers/gemini/geminiAdapter.test.js +0 -279
  582. package/dist/src/providers/gemini/geminiAdapter.test.js.map +0 -1
  583. package/dist/src/providers/gemini/geminiConverter.test.d.ts +0 -6
  584. package/dist/src/providers/gemini/geminiConverter.test.js +0 -474
  585. package/dist/src/providers/gemini/geminiConverter.test.js.map +0 -1
  586. package/dist/src/providers/gemini/geminiParity.test.d.ts +0 -6
  587. package/dist/src/providers/gemini/geminiParity.test.js +0 -754
  588. package/dist/src/providers/gemini/geminiParity.test.js.map +0 -1
  589. package/dist/src/providers/gemini/geminiStream.test.d.ts +0 -6
  590. package/dist/src/providers/gemini/geminiStream.test.js +0 -391
  591. package/dist/src/providers/gemini/geminiStream.test.js.map +0 -1
  592. package/dist/src/providers/gemini/historyBuilder.test.d.ts +0 -6
  593. package/dist/src/providers/gemini/historyBuilder.test.js +0 -207
  594. package/dist/src/providers/gemini/historyBuilder.test.js.map +0 -1
  595. package/dist/src/providers/gemini/requestBuilder.test.d.ts +0 -6
  596. package/dist/src/providers/gemini/requestBuilder.test.js +0 -358
  597. package/dist/src/providers/gemini/requestBuilder.test.js.map +0 -1
  598. package/dist/src/providers/gemini/streamConverter.test.d.ts +0 -6
  599. package/dist/src/providers/gemini/streamConverter.test.js +0 -131
  600. package/dist/src/providers/gemini/streamConverter.test.js.map +0 -1
  601. package/dist/src/providers/modelSpec.test.d.ts +0 -1
  602. package/dist/src/providers/modelSpec.test.js +0 -119
  603. package/dist/src/providers/modelSpec.test.js.map +0 -1
  604. package/dist/src/providers/openai/adapter.test.d.ts +0 -6
  605. package/dist/src/providers/openai/adapter.test.js +0 -274
  606. package/dist/src/providers/openai/adapter.test.js.map +0 -1
  607. package/dist/src/providers/openai/bootstrap.test.d.ts +0 -6
  608. package/dist/src/providers/openai/bootstrap.test.js +0 -76
  609. package/dist/src/providers/openai/bootstrap.test.js.map +0 -1
  610. package/dist/src/providers/openai/converter.test.d.ts +0 -6
  611. package/dist/src/providers/openai/converter.test.js +0 -1133
  612. package/dist/src/providers/openai/converter.test.js.map +0 -1
  613. package/dist/src/providers/openai-compatible/__tests__/compatibility.test.d.ts +0 -6
  614. package/dist/src/providers/openai-compatible/__tests__/compatibility.test.js +0 -356
  615. package/dist/src/providers/openai-compatible/__tests__/compatibility.test.js.map +0 -1
  616. package/dist/src/providers/openai-compatible/adapter.test.d.ts +0 -6
  617. package/dist/src/providers/openai-compatible/adapter.test.js +0 -240
  618. package/dist/src/providers/openai-compatible/adapter.test.js.map +0 -1
  619. package/dist/src/providers/openai-compatible/bootstrap.test.d.ts +0 -6
  620. package/dist/src/providers/openai-compatible/bootstrap.test.js +0 -145
  621. package/dist/src/providers/openai-compatible/bootstrap.test.js.map +0 -1
  622. package/dist/src/providers/openai-compatible/promptBuilder.test.d.ts +0 -6
  623. package/dist/src/providers/openai-compatible/promptBuilder.test.js +0 -154
  624. package/dist/src/providers/openai-compatible/promptBuilder.test.js.map +0 -1
  625. package/dist/src/providers/providerConfig.test.d.ts +0 -1
  626. package/dist/src/providers/providerConfig.test.js +0 -145
  627. package/dist/src/providers/providerConfig.test.js.map +0 -1
  628. package/dist/src/providers/providerConfigIntegration.test.d.ts +0 -6
  629. package/dist/src/providers/providerConfigIntegration.test.js +0 -187
  630. package/dist/src/providers/providerConfigIntegration.test.js.map +0 -1
  631. package/dist/src/providers/providerSelector.test.d.ts +0 -1
  632. package/dist/src/providers/providerSelector.test.js +0 -199
  633. package/dist/src/providers/providerSelector.test.js.map +0 -1
  634. package/dist/src/providers/providerTypes.test.d.ts +0 -1
  635. package/dist/src/providers/providerTypes.test.js +0 -95
  636. package/dist/src/providers/providerTypes.test.js.map +0 -1
  637. package/dist/src/providers/registry.test.d.ts +0 -1
  638. package/dist/src/providers/registry.test.js +0 -207
  639. package/dist/src/providers/registry.test.js.map +0 -1
  640. package/dist/src/providers/streamAssembler.test.d.ts +0 -1
  641. package/dist/src/providers/streamAssembler.test.js +0 -247
  642. package/dist/src/providers/streamAssembler.test.js.map +0 -1
  643. package/dist/src/providers/telemetryBridge.test.d.ts +0 -6
  644. package/dist/src/providers/telemetryBridge.test.js +0 -235
  645. package/dist/src/providers/telemetryBridge.test.js.map +0 -1
  646. package/dist/src/providers/types.test.d.ts +0 -6
  647. package/dist/src/providers/types.test.js +0 -253
  648. package/dist/src/providers/types.test.js.map +0 -1
  649. package/dist/src/resources/resource-registry.test.d.ts +0 -6
  650. package/dist/src/resources/resource-registry.test.js +0 -54
  651. package/dist/src/resources/resource-registry.test.js.map +0 -1
  652. package/dist/src/routing/modelRouterService.test.d.ts +0 -6
  653. package/dist/src/routing/modelRouterService.test.js +0 -106
  654. package/dist/src/routing/modelRouterService.test.js.map +0 -1
  655. package/dist/src/routing/strategies/classifierStrategy.test.d.ts +0 -6
  656. package/dist/src/routing/strategies/classifierStrategy.test.js +0 -249
  657. package/dist/src/routing/strategies/classifierStrategy.test.js.map +0 -1
  658. package/dist/src/routing/strategies/compositeStrategy.test.d.ts +0 -6
  659. package/dist/src/routing/strategies/compositeStrategy.test.js +0 -124
  660. package/dist/src/routing/strategies/compositeStrategy.test.js.map +0 -1
  661. package/dist/src/routing/strategies/defaultStrategy.test.d.ts +0 -6
  662. package/dist/src/routing/strategies/defaultStrategy.test.js +0 -102
  663. package/dist/src/routing/strategies/defaultStrategy.test.js.map +0 -1
  664. package/dist/src/routing/strategies/fallbackStrategy.test.d.ts +0 -6
  665. package/dist/src/routing/strategies/fallbackStrategy.test.js +0 -96
  666. package/dist/src/routing/strategies/fallbackStrategy.test.js.map +0 -1
  667. package/dist/src/routing/strategies/numericalClassifierStrategy.test.d.ts +0 -6
  668. package/dist/src/routing/strategies/numericalClassifierStrategy.test.js +0 -367
  669. package/dist/src/routing/strategies/numericalClassifierStrategy.test.js.map +0 -1
  670. package/dist/src/routing/strategies/overrideStrategy.test.d.ts +0 -6
  671. package/dist/src/routing/strategies/overrideStrategy.test.js +0 -59
  672. package/dist/src/routing/strategies/overrideStrategy.test.js.map +0 -1
  673. package/dist/src/safety/built-in.test.d.ts +0 -6
  674. package/dist/src/safety/built-in.test.js +0 -199
  675. package/dist/src/safety/built-in.test.js.map +0 -1
  676. package/dist/src/safety/checker-runner.test.d.ts +0 -6
  677. package/dist/src/safety/checker-runner.test.js +0 -238
  678. package/dist/src/safety/checker-runner.test.js.map +0 -1
  679. package/dist/src/safety/context-builder.test.d.ts +0 -6
  680. package/dist/src/safety/context-builder.test.js +0 -49
  681. package/dist/src/safety/context-builder.test.js.map +0 -1
  682. package/dist/src/safety/registry.test.d.ts +0 -6
  683. package/dist/src/safety/registry.test.js +0 -31
  684. package/dist/src/safety/registry.test.js.map +0 -1
  685. package/dist/src/scheduler/confirmation.test.d.ts +0 -6
  686. package/dist/src/scheduler/confirmation.test.js +0 -325
  687. package/dist/src/scheduler/confirmation.test.js.map +0 -1
  688. package/dist/src/scheduler/policy.test.d.ts +0 -6
  689. package/dist/src/scheduler/policy.test.js +0 -299
  690. package/dist/src/scheduler/policy.test.js.map +0 -1
  691. package/dist/src/scheduler/scheduler.test.d.ts +0 -6
  692. package/dist/src/scheduler/scheduler.test.js +0 -822
  693. package/dist/src/scheduler/scheduler.test.js.map +0 -1
  694. package/dist/src/scheduler/state-manager.test.d.ts +0 -6
  695. package/dist/src/scheduler/state-manager.test.js +0 -429
  696. package/dist/src/scheduler/state-manager.test.js.map +0 -1
  697. package/dist/src/scheduler/tool-executor.test.d.ts +0 -6
  698. package/dist/src/scheduler/tool-executor.test.js +0 -232
  699. package/dist/src/scheduler/tool-executor.test.js.map +0 -1
  700. package/dist/src/scheduler/tool-modifier.test.d.ts +0 -6
  701. package/dist/src/scheduler/tool-modifier.test.js +0 -159
  702. package/dist/src/scheduler/tool-modifier.test.js.map +0 -1
  703. package/dist/src/services/chatCompressionService.test.d.ts +0 -6
  704. package/dist/src/services/chatCompressionService.test.js +0 -573
  705. package/dist/src/services/chatCompressionService.test.js.map +0 -1
  706. package/dist/src/services/chatRecordingService.test.d.ts +0 -6
  707. package/dist/src/services/chatRecordingService.test.js +0 -486
  708. package/dist/src/services/chatRecordingService.test.js.map +0 -1
  709. package/dist/src/services/contextManager.test.d.ts +0 -6
  710. package/dist/src/services/contextManager.test.js +0 -104
  711. package/dist/src/services/contextManager.test.js.map +0 -1
  712. package/dist/src/services/environmentSanitization.test.d.ts +0 -6
  713. package/dist/src/services/environmentSanitization.test.js +0 -284
  714. package/dist/src/services/environmentSanitization.test.js.map +0 -1
  715. package/dist/src/services/fileDiscoveryService.test.d.ts +0 -6
  716. package/dist/src/services/fileDiscoveryService.test.js +0 -223
  717. package/dist/src/services/fileDiscoveryService.test.js.map +0 -1
  718. package/dist/src/services/fileSystemService.test.d.ts +0 -6
  719. package/dist/src/services/fileSystemService.test.js +0 -41
  720. package/dist/src/services/fileSystemService.test.js.map +0 -1
  721. package/dist/src/services/gitService.test.d.ts +0 -6
  722. package/dist/src/services/gitService.test.js +0 -264
  723. package/dist/src/services/gitService.test.js.map +0 -1
  724. package/dist/src/services/loopDetectionService.test.d.ts +0 -6
  725. package/dist/src/services/loopDetectionService.test.js +0 -881
  726. package/dist/src/services/loopDetectionService.test.js.map +0 -1
  727. package/dist/src/services/modelConfig.golden.test.d.ts +0 -6
  728. package/dist/src/services/modelConfig.golden.test.js +0 -74
  729. package/dist/src/services/modelConfig.golden.test.js.map +0 -1
  730. package/dist/src/services/modelConfig.integration.test.d.ts +0 -6
  731. package/dist/src/services/modelConfig.integration.test.js +0 -247
  732. package/dist/src/services/modelConfig.integration.test.js.map +0 -1
  733. package/dist/src/services/modelConfigBridge.test.d.ts +0 -6
  734. package/dist/src/services/modelConfigBridge.test.js +0 -410
  735. package/dist/src/services/modelConfigBridge.test.js.map +0 -1
  736. package/dist/src/services/modelConfigService.test.d.ts +0 -6
  737. package/dist/src/services/modelConfigService.test.js +0 -868
  738. package/dist/src/services/modelConfigService.test.js.map +0 -1
  739. package/dist/src/services/sessionSummaryService.test.d.ts +0 -6
  740. package/dist/src/services/sessionSummaryService.test.js +0 -785
  741. package/dist/src/services/sessionSummaryService.test.js.map +0 -1
  742. package/dist/src/services/sessionSummaryUtils.test.d.ts +0 -6
  743. package/dist/src/services/sessionSummaryUtils.test.js +0 -160
  744. package/dist/src/services/sessionSummaryUtils.test.js.map +0 -1
  745. package/dist/src/services/shellExecutionService.test.d.ts +0 -6
  746. package/dist/src/services/shellExecutionService.test.js +0 -1080
  747. package/dist/src/services/shellExecutionService.test.js.map +0 -1
  748. package/dist/src/skills/skillLoader.test.d.ts +0 -6
  749. package/dist/src/skills/skillLoader.test.js +0 -185
  750. package/dist/src/skills/skillLoader.test.js.map +0 -1
  751. package/dist/src/skills/skillManager.test.d.ts +0 -6
  752. package/dist/src/skills/skillManager.test.js +0 -297
  753. package/dist/src/skills/skillManager.test.js.map +0 -1
  754. package/dist/src/telemetry/activity-detector.test.d.ts +0 -6
  755. package/dist/src/telemetry/activity-detector.test.js +0 -136
  756. package/dist/src/telemetry/activity-detector.test.js.map +0 -1
  757. package/dist/src/telemetry/activity-monitor.test.d.ts +0 -6
  758. package/dist/src/telemetry/activity-monitor.test.js +0 -251
  759. package/dist/src/telemetry/activity-monitor.test.js.map +0 -1
  760. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +0 -19
  761. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +0 -964
  762. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +0 -1
  763. package/dist/src/telemetry/config.test.d.ts +0 -6
  764. package/dist/src/telemetry/config.test.js +0 -149
  765. package/dist/src/telemetry/config.test.js.map +0 -1
  766. package/dist/src/telemetry/gcp-exporters.test.d.ts +0 -6
  767. package/dist/src/telemetry/gcp-exporters.test.js +0 -318
  768. package/dist/src/telemetry/gcp-exporters.test.js.map +0 -1
  769. package/dist/src/telemetry/high-water-mark-tracker.test.d.ts +0 -6
  770. package/dist/src/telemetry/high-water-mark-tracker.test.js +0 -152
  771. package/dist/src/telemetry/high-water-mark-tracker.test.js.map +0 -1
  772. package/dist/src/telemetry/integration.test.circular.d.ts +0 -6
  773. package/dist/src/telemetry/integration.test.circular.js +0 -54
  774. package/dist/src/telemetry/integration.test.circular.js.map +0 -1
  775. package/dist/src/telemetry/loggers.test.circular.d.ts +0 -6
  776. package/dist/src/telemetry/loggers.test.circular.js +0 -107
  777. package/dist/src/telemetry/loggers.test.circular.js.map +0 -1
  778. package/dist/src/telemetry/loggers.test.d.ts +0 -6
  779. package/dist/src/telemetry/loggers.test.js +0 -1618
  780. package/dist/src/telemetry/loggers.test.js.map +0 -1
  781. package/dist/src/telemetry/memory-monitor.test.d.ts +0 -6
  782. package/dist/src/telemetry/memory-monitor.test.js +0 -472
  783. package/dist/src/telemetry/memory-monitor.test.js.map +0 -1
  784. package/dist/src/telemetry/metrics.test.d.ts +0 -6
  785. package/dist/src/telemetry/metrics.test.js +0 -1176
  786. package/dist/src/telemetry/metrics.test.js.map +0 -1
  787. package/dist/src/telemetry/rate-limiter.test.d.ts +0 -6
  788. package/dist/src/telemetry/rate-limiter.test.js +0 -207
  789. package/dist/src/telemetry/rate-limiter.test.js.map +0 -1
  790. package/dist/src/telemetry/sanitize.test.d.ts +0 -6
  791. package/dist/src/telemetry/sanitize.test.js +0 -279
  792. package/dist/src/telemetry/sanitize.test.js.map +0 -1
  793. package/dist/src/telemetry/sdk.test.d.ts +0 -6
  794. package/dist/src/telemetry/sdk.test.js +0 -360
  795. package/dist/src/telemetry/sdk.test.js.map +0 -1
  796. package/dist/src/telemetry/semantic.test.d.ts +0 -6
  797. package/dist/src/telemetry/semantic.test.js +0 -387
  798. package/dist/src/telemetry/semantic.test.js.map +0 -1
  799. package/dist/src/telemetry/semantic.truncation.test.d.ts +0 -1
  800. package/dist/src/telemetry/semantic.truncation.test.js +0 -92
  801. package/dist/src/telemetry/semantic.truncation.test.js.map +0 -1
  802. package/dist/src/telemetry/startupProfiler.test.d.ts +0 -6
  803. package/dist/src/telemetry/startupProfiler.test.js +0 -285
  804. package/dist/src/telemetry/startupProfiler.test.js.map +0 -1
  805. package/dist/src/telemetry/telemetry-utils.test.d.ts +0 -6
  806. package/dist/src/telemetry/telemetry-utils.test.js +0 -41
  807. package/dist/src/telemetry/telemetry-utils.test.js.map +0 -1
  808. package/dist/src/telemetry/telemetry.test.d.ts +0 -6
  809. package/dist/src/telemetry/telemetry.test.js +0 -57
  810. package/dist/src/telemetry/telemetry.test.js.map +0 -1
  811. package/dist/src/telemetry/uiTelemetry.test.d.ts +0 -6
  812. package/dist/src/telemetry/uiTelemetry.test.js +0 -584
  813. package/dist/src/telemetry/uiTelemetry.test.js.map +0 -1
  814. package/dist/src/tools/activate-skill.test.d.ts +0 -6
  815. package/dist/src/tools/activate-skill.test.js +0 -113
  816. package/dist/src/tools/activate-skill.test.js.map +0 -1
  817. package/dist/src/tools/ask-user.test.d.ts +0 -6
  818. package/dist/src/tools/ask-user.test.js +0 -187
  819. package/dist/src/tools/ask-user.test.js.map +0 -1
  820. package/dist/src/tools/base-tool-invocation.test.d.ts +0 -6
  821. package/dist/src/tools/base-tool-invocation.test.js +0 -85
  822. package/dist/src/tools/base-tool-invocation.test.js.map +0 -1
  823. package/dist/src/tools/confirmation-policy.test.d.ts +0 -6
  824. package/dist/src/tools/confirmation-policy.test.js +0 -143
  825. package/dist/src/tools/confirmation-policy.test.js.map +0 -1
  826. package/dist/src/tools/diffOptions.test.d.ts +0 -6
  827. package/dist/src/tools/diffOptions.test.js +0 -172
  828. package/dist/src/tools/diffOptions.test.js.map +0 -1
  829. package/dist/src/tools/edit.test.d.ts +0 -6
  830. package/dist/src/tools/edit.test.js +0 -729
  831. package/dist/src/tools/edit.test.js.map +0 -1
  832. package/dist/src/tools/get-internal-docs.test.d.ts +0 -6
  833. package/dist/src/tools/get-internal-docs.test.js +0 -57
  834. package/dist/src/tools/get-internal-docs.test.js.map +0 -1
  835. package/dist/src/tools/glob.test.d.ts +0 -6
  836. package/dist/src/tools/glob.test.js +0 -433
  837. package/dist/src/tools/glob.test.js.map +0 -1
  838. package/dist/src/tools/grep.test.d.ts +0 -6
  839. package/dist/src/tools/grep.test.js +0 -328
  840. package/dist/src/tools/grep.test.js.map +0 -1
  841. package/dist/src/tools/ls.test.d.ts +0 -6
  842. package/dist/src/tools/ls.test.js +0 -242
  843. package/dist/src/tools/ls.test.js.map +0 -1
  844. package/dist/src/tools/mcp-client-manager.test.d.ts +0 -6
  845. package/dist/src/tools/mcp-client-manager.test.js +0 -251
  846. package/dist/src/tools/mcp-client-manager.test.js.map +0 -1
  847. package/dist/src/tools/mcp-client.test.d.ts +0 -6
  848. package/dist/src/tools/mcp-client.test.js +0 -1346
  849. package/dist/src/tools/mcp-client.test.js.map +0 -1
  850. package/dist/src/tools/mcp-tool.test.d.ts +0 -6
  851. package/dist/src/tools/mcp-tool.test.js +0 -657
  852. package/dist/src/tools/mcp-tool.test.js.map +0 -1
  853. package/dist/src/tools/memoryTool.test.d.ts +0 -6
  854. package/dist/src/tools/memoryTool.test.js +0 -302
  855. package/dist/src/tools/memoryTool.test.js.map +0 -1
  856. package/dist/src/tools/message-bus-integration.test.d.ts +0 -6
  857. package/dist/src/tools/message-bus-integration.test.js +0 -169
  858. package/dist/src/tools/message-bus-integration.test.js.map +0 -1
  859. package/dist/src/tools/modifiable-tool.test.d.ts +0 -6
  860. package/dist/src/tools/modifiable-tool.test.js +0 -237
  861. package/dist/src/tools/modifiable-tool.test.js.map +0 -1
  862. package/dist/src/tools/read-file.test.d.ts +0 -6
  863. package/dist/src/tools/read-file.test.js +0 -376
  864. package/dist/src/tools/read-file.test.js.map +0 -1
  865. package/dist/src/tools/read-many-files.test.d.ts +0 -6
  866. package/dist/src/tools/read-many-files.test.js +0 -567
  867. package/dist/src/tools/read-many-files.test.js.map +0 -1
  868. package/dist/src/tools/ripGrep.test.d.ts +0 -6
  869. package/dist/src/tools/ripGrep.test.js +0 -1139
  870. package/dist/src/tools/ripGrep.test.js.map +0 -1
  871. package/dist/src/tools/shell.test.d.ts +0 -6
  872. package/dist/src/tools/shell.test.js +0 -526
  873. package/dist/src/tools/shell.test.js.map +0 -1
  874. package/dist/src/tools/tool-names.test.d.ts +0 -6
  875. package/dist/src/tools/tool-names.test.js +0 -43
  876. package/dist/src/tools/tool-names.test.js.map +0 -1
  877. package/dist/src/tools/tool-registry.test.d.ts +0 -6
  878. package/dist/src/tools/tool-registry.test.js +0 -461
  879. package/dist/src/tools/tool-registry.test.js.map +0 -1
  880. package/dist/src/tools/tools.test.d.ts +0 -6
  881. package/dist/src/tools/tools.test.js +0 -207
  882. package/dist/src/tools/tools.test.js.map +0 -1
  883. package/dist/src/tools/web-fetch.test.d.ts +0 -6
  884. package/dist/src/tools/web-fetch.test.js +0 -442
  885. package/dist/src/tools/web-fetch.test.js.map +0 -1
  886. package/dist/src/tools/web-search.test.d.ts +0 -6
  887. package/dist/src/tools/web-search.test.js +0 -214
  888. package/dist/src/tools/web-search.test.js.map +0 -1
  889. package/dist/src/tools/write-file.test.d.ts +0 -6
  890. package/dist/src/tools/write-file.test.js +0 -681
  891. package/dist/src/tools/write-file.test.js.map +0 -1
  892. package/dist/src/tools/write-todos.test.d.ts +0 -6
  893. package/dist/src/tools/write-todos.test.js +0 -90
  894. package/dist/src/tools/write-todos.test.js.map +0 -1
  895. package/dist/src/utils/apiConversionUtils.test.d.ts +0 -6
  896. package/dist/src/utils/apiConversionUtils.test.js +0 -150
  897. package/dist/src/utils/apiConversionUtils.test.js.map +0 -1
  898. package/dist/src/utils/bfsFileSearch.test.d.ts +0 -6
  899. package/dist/src/utils/bfsFileSearch.test.js +0 -227
  900. package/dist/src/utils/bfsFileSearch.test.js.map +0 -1
  901. package/dist/src/utils/channel.test.d.ts +0 -6
  902. package/dist/src/utils/channel.test.js +0 -170
  903. package/dist/src/utils/channel.test.js.map +0 -1
  904. package/dist/src/utils/checkpointUtils.test.d.ts +0 -6
  905. package/dist/src/utils/checkpointUtils.test.js +0 -229
  906. package/dist/src/utils/checkpointUtils.test.js.map +0 -1
  907. package/dist/src/utils/customHeaderUtils.test.d.ts +0 -6
  908. package/dist/src/utils/customHeaderUtils.test.js +0 -77
  909. package/dist/src/utils/customHeaderUtils.test.js.map +0 -1
  910. package/dist/src/utils/debugLogger.test.d.ts +0 -6
  911. package/dist/src/utils/debugLogger.test.js +0 -69
  912. package/dist/src/utils/debugLogger.test.js.map +0 -1
  913. package/dist/src/utils/delay.test.d.ts +0 -6
  914. package/dist/src/utils/delay.test.js +0 -88
  915. package/dist/src/utils/delay.test.js.map +0 -1
  916. package/dist/src/utils/editCorrector.test.d.ts +0 -6
  917. package/dist/src/utils/editCorrector.test.js +0 -533
  918. package/dist/src/utils/editCorrector.test.js.map +0 -1
  919. package/dist/src/utils/editor.test.d.ts +0 -6
  920. package/dist/src/utils/editor.test.js +0 -429
  921. package/dist/src/utils/editor.test.js.map +0 -1
  922. package/dist/src/utils/environmentContext.test.d.ts +0 -6
  923. package/dist/src/utils/environmentContext.test.js +0 -114
  924. package/dist/src/utils/environmentContext.test.js.map +0 -1
  925. package/dist/src/utils/errorParsing.test.d.ts +0 -6
  926. package/dist/src/utils/errorParsing.test.js +0 -84
  927. package/dist/src/utils/errorParsing.test.js.map +0 -1
  928. package/dist/src/utils/errorReporting.test.d.ts +0 -6
  929. package/dist/src/utils/errorReporting.test.js +0 -133
  930. package/dist/src/utils/errorReporting.test.js.map +0 -1
  931. package/dist/src/utils/errors.test.d.ts +0 -6
  932. package/dist/src/utils/errors.test.js +0 -155
  933. package/dist/src/utils/errors.test.js.map +0 -1
  934. package/dist/src/utils/events.test.d.ts +0 -6
  935. package/dist/src/utils/events.test.js +0 -237
  936. package/dist/src/utils/events.test.js.map +0 -1
  937. package/dist/src/utils/extensionLoader.test.d.ts +0 -6
  938. package/dist/src/utils/extensionLoader.test.js +0 -176
  939. package/dist/src/utils/extensionLoader.test.js.map +0 -1
  940. package/dist/src/utils/fileDiffUtils.test.d.ts +0 -6
  941. package/dist/src/utils/fileDiffUtils.test.js +0 -84
  942. package/dist/src/utils/fileDiffUtils.test.js.map +0 -1
  943. package/dist/src/utils/fileUtils.test.d.ts +0 -6
  944. package/dist/src/utils/fileUtils.test.js +0 -780
  945. package/dist/src/utils/fileUtils.test.js.map +0 -1
  946. package/dist/src/utils/filesearch/crawlCache.test.d.ts +0 -6
  947. package/dist/src/utils/filesearch/crawlCache.test.js +0 -103
  948. package/dist/src/utils/filesearch/crawlCache.test.js.map +0 -1
  949. package/dist/src/utils/filesearch/crawler.test.d.ts +0 -6
  950. package/dist/src/utils/filesearch/crawler.test.js +0 -495
  951. package/dist/src/utils/filesearch/crawler.test.js.map +0 -1
  952. package/dist/src/utils/filesearch/fileSearch.test.d.ts +0 -6
  953. package/dist/src/utils/filesearch/fileSearch.test.js +0 -663
  954. package/dist/src/utils/filesearch/fileSearch.test.js.map +0 -1
  955. package/dist/src/utils/filesearch/ignore.test.d.ts +0 -6
  956. package/dist/src/utils/filesearch/ignore.test.js +0 -144
  957. package/dist/src/utils/filesearch/ignore.test.js.map +0 -1
  958. package/dist/src/utils/filesearch/result-cache.test.d.ts +0 -6
  959. package/dist/src/utils/filesearch/result-cache.test.js +0 -46
  960. package/dist/src/utils/filesearch/result-cache.test.js.map +0 -1
  961. package/dist/src/utils/flashFallback.test.d.ts +0 -6
  962. package/dist/src/utils/flashFallback.test.js +0 -103
  963. package/dist/src/utils/flashFallback.test.js.map +0 -1
  964. package/dist/src/utils/formatters.test.d.ts +0 -6
  965. package/dist/src/utils/formatters.test.js +0 -26
  966. package/dist/src/utils/formatters.test.js.map +0 -1
  967. package/dist/src/utils/geminiIgnoreParser.test.d.ts +0 -6
  968. package/dist/src/utils/geminiIgnoreParser.test.js +0 -98
  969. package/dist/src/utils/geminiIgnoreParser.test.js.map +0 -1
  970. package/dist/src/utils/geminiTypeConversion.test.d.ts +0 -6
  971. package/dist/src/utils/geminiTypeConversion.test.js +0 -310
  972. package/dist/src/utils/geminiTypeConversion.test.js.map +0 -1
  973. package/dist/src/utils/generateContentResponseUtilities.test.d.ts +0 -6
  974. package/dist/src/utils/generateContentResponseUtilities.test.js +0 -512
  975. package/dist/src/utils/generateContentResponseUtilities.test.js.map +0 -1
  976. package/dist/src/utils/getFolderStructure.test.d.ts +0 -6
  977. package/dist/src/utils/getFolderStructure.test.js +0 -283
  978. package/dist/src/utils/getFolderStructure.test.js.map +0 -1
  979. package/dist/src/utils/gitIgnoreParser.test.d.ts +0 -6
  980. package/dist/src/utils/gitIgnoreParser.test.js +0 -243
  981. package/dist/src/utils/gitIgnoreParser.test.js.map +0 -1
  982. package/dist/src/utils/googleErrors.test.d.ts +0 -6
  983. package/dist/src/utils/googleErrors.test.js +0 -309
  984. package/dist/src/utils/googleErrors.test.js.map +0 -1
  985. package/dist/src/utils/googleQuotaErrors.test.d.ts +0 -6
  986. package/dist/src/utils/googleQuotaErrors.test.js +0 -548
  987. package/dist/src/utils/googleQuotaErrors.test.js.map +0 -1
  988. package/dist/src/utils/ignorePatterns.test.d.ts +0 -6
  989. package/dist/src/utils/ignorePatterns.test.js +0 -246
  990. package/dist/src/utils/ignorePatterns.test.js.map +0 -1
  991. package/dist/src/utils/installationManager.test.d.ts +0 -6
  992. package/dist/src/utils/installationManager.test.js +0 -93
  993. package/dist/src/utils/installationManager.test.js.map +0 -1
  994. package/dist/src/utils/llm-edit-fixer.test.d.ts +0 -6
  995. package/dist/src/utils/llm-edit-fixer.test.js +0 -223
  996. package/dist/src/utils/llm-edit-fixer.test.js.map +0 -1
  997. package/dist/src/utils/llmUtils.test.d.ts +0 -6
  998. package/dist/src/utils/llmUtils.test.js +0 -196
  999. package/dist/src/utils/llmUtils.test.js.map +0 -1
  1000. package/dist/src/utils/memoryDiscovery.test.d.ts +0 -6
  1001. package/dist/src/utils/memoryDiscovery.test.js +0 -542
  1002. package/dist/src/utils/memoryDiscovery.test.js.map +0 -1
  1003. package/dist/src/utils/memoryImportProcessor.test.d.ts +0 -6
  1004. package/dist/src/utils/memoryImportProcessor.test.js +0 -581
  1005. package/dist/src/utils/memoryImportProcessor.test.js.map +0 -1
  1006. package/dist/src/utils/nextSpeakerChecker.test.d.ts +0 -6
  1007. package/dist/src/utils/nextSpeakerChecker.test.js +0 -191
  1008. package/dist/src/utils/nextSpeakerChecker.test.js.map +0 -1
  1009. package/dist/src/utils/partUtils.test.d.ts +0 -6
  1010. package/dist/src/utils/partUtils.test.js +0 -397
  1011. package/dist/src/utils/partUtils.test.js.map +0 -1
  1012. package/dist/src/utils/pathCorrector.test.d.ts +0 -6
  1013. package/dist/src/utils/pathCorrector.test.js +0 -87
  1014. package/dist/src/utils/pathCorrector.test.js.map +0 -1
  1015. package/dist/src/utils/pathReader.test.d.ts +0 -6
  1016. package/dist/src/utils/pathReader.test.js +0 -406
  1017. package/dist/src/utils/pathReader.test.js.map +0 -1
  1018. package/dist/src/utils/paths.test.d.ts +0 -6
  1019. package/dist/src/utils/paths.test.js +0 -402
  1020. package/dist/src/utils/paths.test.js.map +0 -1
  1021. package/dist/src/utils/retry.test.d.ts +0 -6
  1022. package/dist/src/utils/retry.test.js +0 -548
  1023. package/dist/src/utils/retry.test.js.map +0 -1
  1024. package/dist/src/utils/retry_llm_error.test.d.ts +0 -6
  1025. package/dist/src/utils/retry_llm_error.test.js +0 -280
  1026. package/dist/src/utils/retry_llm_error.test.js.map +0 -1
  1027. package/dist/src/utils/safeJsonStringify.test.d.ts +0 -6
  1028. package/dist/src/utils/safeJsonStringify.test.js +0 -61
  1029. package/dist/src/utils/safeJsonStringify.test.js.map +0 -1
  1030. package/dist/src/utils/schemaValidator.test.d.ts +0 -6
  1031. package/dist/src/utils/schemaValidator.test.js +0 -113
  1032. package/dist/src/utils/schemaValidator.test.js.map +0 -1
  1033. package/dist/src/utils/secure-browser-launcher.test.d.ts +0 -6
  1034. package/dist/src/utils/secure-browser-launcher.test.js +0 -149
  1035. package/dist/src/utils/secure-browser-launcher.test.js.map +0 -1
  1036. package/dist/src/utils/security.test.d.ts +0 -1
  1037. package/dist/src/utils/security.test.js +0 -121
  1038. package/dist/src/utils/security.test.js.map +0 -1
  1039. package/dist/src/utils/shell-utils.integration.test.d.ts +0 -1
  1040. package/dist/src/utils/shell-utils.integration.test.js +0 -58
  1041. package/dist/src/utils/shell-utils.integration.test.js.map +0 -1
  1042. package/dist/src/utils/shell-utils.test.d.ts +0 -6
  1043. package/dist/src/utils/shell-utils.test.js +0 -437
  1044. package/dist/src/utils/shell-utils.test.js.map +0 -1
  1045. package/dist/src/utils/stdio.test.d.ts +0 -6
  1046. package/dist/src/utils/stdio.test.js +0 -47
  1047. package/dist/src/utils/stdio.test.js.map +0 -1
  1048. package/dist/src/utils/summarizer.test.d.ts +0 -6
  1049. package/dist/src/utils/summarizer.test.js +0 -152
  1050. package/dist/src/utils/summarizer.test.js.map +0 -1
  1051. package/dist/src/utils/systemEncoding.test.d.ts +0 -6
  1052. package/dist/src/utils/systemEncoding.test.js +0 -369
  1053. package/dist/src/utils/systemEncoding.test.js.map +0 -1
  1054. package/dist/src/utils/terminalSerializer.test.d.ts +0 -6
  1055. package/dist/src/utils/terminalSerializer.test.js +0 -193
  1056. package/dist/src/utils/terminalSerializer.test.js.map +0 -1
  1057. package/dist/src/utils/textUtils.test.d.ts +0 -6
  1058. package/dist/src/utils/textUtils.test.js +0 -76
  1059. package/dist/src/utils/textUtils.test.js.map +0 -1
  1060. package/dist/src/utils/thoughtUtils.test.d.ts +0 -6
  1061. package/dist/src/utils/thoughtUtils.test.js +0 -78
  1062. package/dist/src/utils/thoughtUtils.test.js.map +0 -1
  1063. package/dist/src/utils/tokenCalculation.test.d.ts +0 -6
  1064. package/dist/src/utils/tokenCalculation.test.js +0 -184
  1065. package/dist/src/utils/tokenCalculation.test.js.map +0 -1
  1066. package/dist/src/utils/tool-utils.test.d.ts +0 -6
  1067. package/dist/src/utils/tool-utils.test.js +0 -84
  1068. package/dist/src/utils/tool-utils.test.js.map +0 -1
  1069. package/dist/src/utils/toolCallContext.test.d.ts +0 -6
  1070. package/dist/src/utils/toolCallContext.test.js +0 -68
  1071. package/dist/src/utils/toolCallContext.test.js.map +0 -1
  1072. package/dist/src/utils/userAccountManager.test.d.ts +0 -6
  1073. package/dist/src/utils/userAccountManager.test.js +0 -225
  1074. package/dist/src/utils/userAccountManager.test.js.map +0 -1
  1075. package/dist/src/utils/version.test.d.ts +0 -6
  1076. package/dist/src/utils/version.test.js +0 -39
  1077. package/dist/src/utils/version.test.js.map +0 -1
  1078. package/dist/src/utils/workspaceContext.test.d.ts +0 -6
  1079. package/dist/src/utils/workspaceContext.test.js +0 -374
  1080. package/dist/src/utils/workspaceContext.test.js.map +0 -1
  1081. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,780 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { describe, it, expect, vi, beforeEach, afterEach, } from 'vitest';
7
- import * as actualNodeFs from 'node:fs'; // For setup/teardown
8
- import fs from 'node:fs';
9
- import fsPromises from 'node:fs/promises';
10
- import path from 'node:path';
11
- import os from 'node:os';
12
- import { fileURLToPath } from 'node:url';
13
- // eslint-disable-next-line import/no-internal-modules
14
- import mime from 'mime/lite';
15
- import { isWithinRoot, isBinaryFile, detectFileType, processSingleFileContent, detectBOM, readFileWithEncoding, fileExists, readWasmBinaryFromDisk, saveTruncatedToolOutput, formatTruncatedToolOutput, } from './fileUtils.js';
16
- import { StandardFileSystemService } from '../services/fileSystemService.js';
17
- vi.mock('mime/lite', () => ({
18
- default: { getType: vi.fn() },
19
- getType: vi.fn(),
20
- }));
21
- const mockMimeGetType = mime.getType;
22
- describe('fileUtils', () => {
23
- let tempRootDir;
24
- const originalProcessCwd = process.cwd;
25
- let testTextFilePath;
26
- let testImageFilePath;
27
- let testPdfFilePath;
28
- let testAudioFilePath;
29
- let testBinaryFilePath;
30
- let nonexistentFilePath;
31
- let directoryPath;
32
- beforeEach(() => {
33
- vi.resetAllMocks(); // Reset all mocks, including mime.getType
34
- tempRootDir = actualNodeFs.mkdtempSync(path.join(os.tmpdir(), 'fileUtils-test-'));
35
- process.cwd = vi.fn(() => tempRootDir); // Mock cwd if necessary for relative path logic within tests
36
- testTextFilePath = path.join(tempRootDir, 'test.txt');
37
- testImageFilePath = path.join(tempRootDir, 'image.png');
38
- testPdfFilePath = path.join(tempRootDir, 'document.pdf');
39
- testAudioFilePath = path.join(tempRootDir, 'audio.mp3');
40
- testBinaryFilePath = path.join(tempRootDir, 'app.exe');
41
- nonexistentFilePath = path.join(tempRootDir, 'nonexistent.txt');
42
- directoryPath = path.join(tempRootDir, 'subdir');
43
- actualNodeFs.mkdirSync(directoryPath, { recursive: true }); // Ensure subdir exists
44
- });
45
- afterEach(() => {
46
- if (actualNodeFs.existsSync(tempRootDir)) {
47
- actualNodeFs.rmSync(tempRootDir, { recursive: true, force: true });
48
- }
49
- process.cwd = originalProcessCwd;
50
- vi.restoreAllMocks(); // Restore any spies
51
- });
52
- describe('readWasmBinaryFromDisk', () => {
53
- it('loads a WASM binary from disk as a Uint8Array', async () => {
54
- const wasmFixtureUrl = new URL('./__fixtures__/dummy.wasm', import.meta.url);
55
- const wasmFixturePath = fileURLToPath(wasmFixtureUrl);
56
- const result = await readWasmBinaryFromDisk(wasmFixturePath);
57
- const expectedBytes = new Uint8Array(await fsPromises.readFile(wasmFixturePath));
58
- expect(result).toBeInstanceOf(Uint8Array);
59
- expect(result).toStrictEqual(expectedBytes);
60
- });
61
- });
62
- describe('isWithinRoot', () => {
63
- const defaultRoot = path.resolve('/project/root');
64
- it.each([
65
- {
66
- name: 'a path directly within the root',
67
- path: path.join(defaultRoot, 'file.txt'),
68
- expected: true,
69
- },
70
- {
71
- name: 'a path in a subdirectory within the root',
72
- path: path.join(defaultRoot, 'subdir', 'file.txt'),
73
- expected: true,
74
- },
75
- { name: 'the root path itself', path: defaultRoot, expected: true },
76
- {
77
- name: 'a path with a trailing slash',
78
- path: path.join(defaultRoot, 'file.txt') + path.sep,
79
- expected: true,
80
- },
81
- {
82
- name: 'the root path with a trailing slash',
83
- path: defaultRoot + path.sep,
84
- expected: true,
85
- },
86
- {
87
- name: 'a sub-path of the path to check',
88
- path: path.resolve('/project/root/sub'),
89
- root: path.resolve('/project/root'),
90
- expected: true,
91
- },
92
- {
93
- name: 'a path outside the root',
94
- path: path.resolve('/project/other', 'file.txt'),
95
- expected: false,
96
- },
97
- {
98
- name: 'an unrelated path',
99
- path: path.resolve('/unrelated', 'file.txt'),
100
- expected: false,
101
- },
102
- {
103
- name: 'a path that only partially matches the root prefix',
104
- path: path.resolve('/project/root-but-actually-different'),
105
- expected: false,
106
- },
107
- {
108
- name: 'a root path that is a sub-path of the path to check',
109
- path: path.resolve('/project/root'),
110
- root: path.resolve('/project/root/sub'),
111
- expected: false,
112
- },
113
- {
114
- name: 'a POSIX path inside',
115
- path: '/project/root/file.txt',
116
- root: '/project/root',
117
- expected: true,
118
- },
119
- {
120
- name: 'a POSIX path outside',
121
- path: '/project/other/file.txt',
122
- root: '/project/root',
123
- expected: false,
124
- },
125
- ])('should return $expected for $name', ({ path: testPath, root, expected }) => {
126
- expect(isWithinRoot(testPath, root || defaultRoot)).toBe(expected);
127
- });
128
- });
129
- describe('fileExists', () => {
130
- it('should return true if the file exists', async () => {
131
- const testFile = path.join(tempRootDir, 'exists.txt');
132
- actualNodeFs.writeFileSync(testFile, 'content');
133
- await expect(fileExists(testFile)).resolves.toBe(true);
134
- });
135
- it('should return false if the file does not exist', async () => {
136
- const testFile = path.join(tempRootDir, 'does-not-exist.txt');
137
- await expect(fileExists(testFile)).resolves.toBe(false);
138
- });
139
- it('should return true for a directory that exists', async () => {
140
- const testDir = path.join(tempRootDir, 'exists-dir');
141
- actualNodeFs.mkdirSync(testDir);
142
- await expect(fileExists(testDir)).resolves.toBe(true);
143
- });
144
- });
145
- describe('isBinaryFile', () => {
146
- let filePathForBinaryTest;
147
- beforeEach(() => {
148
- filePathForBinaryTest = path.join(tempRootDir, 'binaryCheck.tmp');
149
- });
150
- afterEach(() => {
151
- if (actualNodeFs.existsSync(filePathForBinaryTest)) {
152
- actualNodeFs.unlinkSync(filePathForBinaryTest);
153
- }
154
- });
155
- it('should return false for an empty file', async () => {
156
- actualNodeFs.writeFileSync(filePathForBinaryTest, '');
157
- expect(await isBinaryFile(filePathForBinaryTest)).toBe(false);
158
- });
159
- it('should return false for a typical text file', async () => {
160
- actualNodeFs.writeFileSync(filePathForBinaryTest, 'Hello, world!\nThis is a test file with normal text content.');
161
- expect(await isBinaryFile(filePathForBinaryTest)).toBe(false);
162
- });
163
- it('should return true for a file with many null bytes', async () => {
164
- const binaryContent = Buffer.from([
165
- 0x48, 0x65, 0x00, 0x6c, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00,
166
- ]); // "He\0llo\0\0\0\0\0"
167
- actualNodeFs.writeFileSync(filePathForBinaryTest, binaryContent);
168
- expect(await isBinaryFile(filePathForBinaryTest)).toBe(true);
169
- });
170
- it('should return true for a file with high percentage of non-printable ASCII', async () => {
171
- const binaryContent = Buffer.from([
172
- 0x41, 0x42, 0x01, 0x02, 0x03, 0x04, 0x05, 0x43, 0x44, 0x06,
173
- ]); // AB\x01\x02\x03\x04\x05CD\x06
174
- actualNodeFs.writeFileSync(filePathForBinaryTest, binaryContent);
175
- expect(await isBinaryFile(filePathForBinaryTest)).toBe(true);
176
- });
177
- it('should return false if file access fails (e.g., ENOENT)', async () => {
178
- // Ensure the file does not exist
179
- if (actualNodeFs.existsSync(filePathForBinaryTest)) {
180
- actualNodeFs.unlinkSync(filePathForBinaryTest);
181
- }
182
- expect(await isBinaryFile(filePathForBinaryTest)).toBe(false);
183
- });
184
- });
185
- describe('BOM detection and encoding', () => {
186
- let testDir;
187
- beforeEach(async () => {
188
- testDir = await fsPromises.mkdtemp(path.join(await fsPromises.realpath(os.tmpdir()), 'fileUtils-bom-test-'));
189
- });
190
- afterEach(async () => {
191
- if (testDir) {
192
- await fsPromises.rm(testDir, { recursive: true, force: true });
193
- }
194
- });
195
- describe('detectBOM', () => {
196
- it('should detect UTF-8 BOM', () => {
197
- const buf = Buffer.from([
198
- 0xef, 0xbb, 0xbf, 0x48, 0x65, 0x6c, 0x6c, 0x6f,
199
- ]);
200
- const result = detectBOM(buf);
201
- expect(result).toEqual({ encoding: 'utf8', bomLength: 3 });
202
- });
203
- it('should detect UTF-16 LE BOM', () => {
204
- const buf = Buffer.from([0xff, 0xfe, 0x48, 0x00, 0x65, 0x00]);
205
- const result = detectBOM(buf);
206
- expect(result).toEqual({ encoding: 'utf16le', bomLength: 2 });
207
- });
208
- it('should detect UTF-16 BE BOM', () => {
209
- const buf = Buffer.from([0xfe, 0xff, 0x00, 0x48, 0x00, 0x65]);
210
- const result = detectBOM(buf);
211
- expect(result).toEqual({ encoding: 'utf16be', bomLength: 2 });
212
- });
213
- it('should detect UTF-32 LE BOM', () => {
214
- const buf = Buffer.from([
215
- 0xff, 0xfe, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
216
- ]);
217
- const result = detectBOM(buf);
218
- expect(result).toEqual({ encoding: 'utf32le', bomLength: 4 });
219
- });
220
- it('should detect UTF-32 BE BOM', () => {
221
- const buf = Buffer.from([
222
- 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x48,
223
- ]);
224
- const result = detectBOM(buf);
225
- expect(result).toEqual({ encoding: 'utf32be', bomLength: 4 });
226
- });
227
- it('should return null for no BOM', () => {
228
- const buf = Buffer.from([0x48, 0x65, 0x6c, 0x6c, 0x6f]);
229
- const result = detectBOM(buf);
230
- expect(result).toBeNull();
231
- });
232
- it('should return null for empty buffer', () => {
233
- const buf = Buffer.alloc(0);
234
- const result = detectBOM(buf);
235
- expect(result).toBeNull();
236
- });
237
- it('should return null for partial BOM', () => {
238
- const buf = Buffer.from([0xef, 0xbb]); // Incomplete UTF-8 BOM
239
- const result = detectBOM(buf);
240
- expect(result).toBeNull();
241
- });
242
- });
243
- describe('readFileWithEncoding', () => {
244
- it('should read UTF-8 BOM file correctly', async () => {
245
- const content = 'Hello, 世界! 🌍';
246
- const utf8Bom = Buffer.from([0xef, 0xbb, 0xbf]);
247
- const utf8Content = Buffer.from(content, 'utf8');
248
- const fullBuffer = Buffer.concat([utf8Bom, utf8Content]);
249
- const filePath = path.join(testDir, 'utf8-bom.txt');
250
- await fsPromises.writeFile(filePath, fullBuffer);
251
- const result = await readFileWithEncoding(filePath);
252
- expect(result).toBe(content);
253
- });
254
- it('should read UTF-16 LE BOM file correctly', async () => {
255
- const content = 'Hello, 世界! 🌍';
256
- const utf16leBom = Buffer.from([0xff, 0xfe]);
257
- const utf16leContent = Buffer.from(content, 'utf16le');
258
- const fullBuffer = Buffer.concat([utf16leBom, utf16leContent]);
259
- const filePath = path.join(testDir, 'utf16le-bom.txt');
260
- await fsPromises.writeFile(filePath, fullBuffer);
261
- const result = await readFileWithEncoding(filePath);
262
- expect(result).toBe(content);
263
- });
264
- it('should read UTF-16 BE BOM file correctly', async () => {
265
- const content = 'Hello, 世界! 🌍';
266
- // Manually encode UTF-16 BE: each char as big-endian 16-bit
267
- const utf16beBom = Buffer.from([0xfe, 0xff]);
268
- const chars = Array.from(content);
269
- const utf16beBytes = [];
270
- for (const char of chars) {
271
- const code = char.codePointAt(0);
272
- if (code > 0xffff) {
273
- // Surrogate pair for emoji
274
- const surrogate1 = 0xd800 + ((code - 0x10000) >> 10);
275
- const surrogate2 = 0xdc00 + ((code - 0x10000) & 0x3ff);
276
- utf16beBytes.push((surrogate1 >> 8) & 0xff, surrogate1 & 0xff);
277
- utf16beBytes.push((surrogate2 >> 8) & 0xff, surrogate2 & 0xff);
278
- }
279
- else {
280
- utf16beBytes.push((code >> 8) & 0xff, code & 0xff);
281
- }
282
- }
283
- const utf16beContent = Buffer.from(utf16beBytes);
284
- const fullBuffer = Buffer.concat([utf16beBom, utf16beContent]);
285
- const filePath = path.join(testDir, 'utf16be-bom.txt');
286
- await fsPromises.writeFile(filePath, fullBuffer);
287
- const result = await readFileWithEncoding(filePath);
288
- expect(result).toBe(content);
289
- });
290
- it('should read UTF-32 LE BOM file correctly', async () => {
291
- const content = 'Hello, 世界! 🌍';
292
- const utf32leBom = Buffer.from([0xff, 0xfe, 0x00, 0x00]);
293
- const utf32leBytes = [];
294
- for (const char of Array.from(content)) {
295
- const code = char.codePointAt(0);
296
- utf32leBytes.push(code & 0xff, (code >> 8) & 0xff, (code >> 16) & 0xff, (code >> 24) & 0xff);
297
- }
298
- const utf32leContent = Buffer.from(utf32leBytes);
299
- const fullBuffer = Buffer.concat([utf32leBom, utf32leContent]);
300
- const filePath = path.join(testDir, 'utf32le-bom.txt');
301
- await fsPromises.writeFile(filePath, fullBuffer);
302
- const result = await readFileWithEncoding(filePath);
303
- expect(result).toBe(content);
304
- });
305
- it('should read UTF-32 BE BOM file correctly', async () => {
306
- const content = 'Hello, 世界! 🌍';
307
- const utf32beBom = Buffer.from([0x00, 0x00, 0xfe, 0xff]);
308
- const utf32beBytes = [];
309
- for (const char of Array.from(content)) {
310
- const code = char.codePointAt(0);
311
- utf32beBytes.push((code >> 24) & 0xff, (code >> 16) & 0xff, (code >> 8) & 0xff, code & 0xff);
312
- }
313
- const utf32beContent = Buffer.from(utf32beBytes);
314
- const fullBuffer = Buffer.concat([utf32beBom, utf32beContent]);
315
- const filePath = path.join(testDir, 'utf32be-bom.txt');
316
- await fsPromises.writeFile(filePath, fullBuffer);
317
- const result = await readFileWithEncoding(filePath);
318
- expect(result).toBe(content);
319
- });
320
- it('should read file without BOM as UTF-8', async () => {
321
- const content = 'Hello, 世界!';
322
- const filePath = path.join(testDir, 'no-bom.txt');
323
- await fsPromises.writeFile(filePath, content, 'utf8');
324
- const result = await readFileWithEncoding(filePath);
325
- expect(result).toBe(content);
326
- });
327
- it('should handle empty file', async () => {
328
- const filePath = path.join(testDir, 'empty.txt');
329
- await fsPromises.writeFile(filePath, '');
330
- const result = await readFileWithEncoding(filePath);
331
- expect(result).toBe('');
332
- });
333
- });
334
- describe('isBinaryFile with BOM awareness', () => {
335
- it('should not treat UTF-8 BOM file as binary', async () => {
336
- const content = 'Hello, world!';
337
- const utf8Bom = Buffer.from([0xef, 0xbb, 0xbf]);
338
- const utf8Content = Buffer.from(content, 'utf8');
339
- const fullBuffer = Buffer.concat([utf8Bom, utf8Content]);
340
- const filePath = path.join(testDir, 'utf8-bom-test.txt');
341
- await fsPromises.writeFile(filePath, fullBuffer);
342
- const result = await isBinaryFile(filePath);
343
- expect(result).toBe(false);
344
- });
345
- it('should not treat UTF-16 LE BOM file as binary', async () => {
346
- const content = 'Hello, world!';
347
- const utf16leBom = Buffer.from([0xff, 0xfe]);
348
- const utf16leContent = Buffer.from(content, 'utf16le');
349
- const fullBuffer = Buffer.concat([utf16leBom, utf16leContent]);
350
- const filePath = path.join(testDir, 'utf16le-bom-test.txt');
351
- await fsPromises.writeFile(filePath, fullBuffer);
352
- const result = await isBinaryFile(filePath);
353
- expect(result).toBe(false);
354
- });
355
- it('should not treat UTF-16 BE BOM file as binary', async () => {
356
- const utf16beBom = Buffer.from([0xfe, 0xff]);
357
- // Simple ASCII in UTF-16 BE
358
- const utf16beContent = Buffer.from([
359
- 0x00,
360
- 0x48, // H
361
- 0x00,
362
- 0x65, // e
363
- 0x00,
364
- 0x6c, // l
365
- 0x00,
366
- 0x6c, // l
367
- 0x00,
368
- 0x6f, // o
369
- 0x00,
370
- 0x2c, // ,
371
- 0x00,
372
- 0x20, // space
373
- 0x00,
374
- 0x77, // w
375
- 0x00,
376
- 0x6f, // o
377
- 0x00,
378
- 0x72, // r
379
- 0x00,
380
- 0x6c, // l
381
- 0x00,
382
- 0x64, // d
383
- 0x00,
384
- 0x21, // !
385
- ]);
386
- const fullBuffer = Buffer.concat([utf16beBom, utf16beContent]);
387
- const filePath = path.join(testDir, 'utf16be-bom-test.txt');
388
- await fsPromises.writeFile(filePath, fullBuffer);
389
- const result = await isBinaryFile(filePath);
390
- expect(result).toBe(false);
391
- });
392
- it('should not treat UTF-32 LE BOM file as binary', async () => {
393
- const utf32leBom = Buffer.from([0xff, 0xfe, 0x00, 0x00]);
394
- const utf32leContent = Buffer.from([
395
- 0x48,
396
- 0x00,
397
- 0x00,
398
- 0x00, // H
399
- 0x65,
400
- 0x00,
401
- 0x00,
402
- 0x00, // e
403
- 0x6c,
404
- 0x00,
405
- 0x00,
406
- 0x00, // l
407
- 0x6c,
408
- 0x00,
409
- 0x00,
410
- 0x00, // l
411
- 0x6f,
412
- 0x00,
413
- 0x00,
414
- 0x00, // o
415
- ]);
416
- const fullBuffer = Buffer.concat([utf32leBom, utf32leContent]);
417
- const filePath = path.join(testDir, 'utf32le-bom-test.txt');
418
- await fsPromises.writeFile(filePath, fullBuffer);
419
- const result = await isBinaryFile(filePath);
420
- expect(result).toBe(false);
421
- });
422
- it('should not treat UTF-32 BE BOM file as binary', async () => {
423
- const utf32beBom = Buffer.from([0x00, 0x00, 0xfe, 0xff]);
424
- const utf32beContent = Buffer.from([
425
- 0x00,
426
- 0x00,
427
- 0x00,
428
- 0x48, // H
429
- 0x00,
430
- 0x00,
431
- 0x00,
432
- 0x65, // e
433
- 0x00,
434
- 0x00,
435
- 0x00,
436
- 0x6c, // l
437
- 0x00,
438
- 0x00,
439
- 0x00,
440
- 0x6c, // l
441
- 0x00,
442
- 0x00,
443
- 0x00,
444
- 0x6f, // o
445
- ]);
446
- const fullBuffer = Buffer.concat([utf32beBom, utf32beContent]);
447
- const filePath = path.join(testDir, 'utf32be-bom-test.txt');
448
- await fsPromises.writeFile(filePath, fullBuffer);
449
- const result = await isBinaryFile(filePath);
450
- expect(result).toBe(false);
451
- });
452
- it('should still treat actual binary file as binary', async () => {
453
- // PNG header + some binary data with null bytes
454
- const pngHeader = Buffer.from([
455
- 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
456
- ]);
457
- const binaryData = Buffer.from([
458
- 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
459
- ]); // IHDR chunk with nulls
460
- const fullContent = Buffer.concat([pngHeader, binaryData]);
461
- const filePath = path.join(testDir, 'test.png');
462
- await fsPromises.writeFile(filePath, fullContent);
463
- const result = await isBinaryFile(filePath);
464
- expect(result).toBe(true);
465
- });
466
- it('should treat file with null bytes (no BOM) as binary', async () => {
467
- const content = Buffer.from([
468
- 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x77, 0x6f, 0x72, 0x6c, 0x64,
469
- ]);
470
- const filePath = path.join(testDir, 'null-bytes.bin');
471
- await fsPromises.writeFile(filePath, content);
472
- const result = await isBinaryFile(filePath);
473
- expect(result).toBe(true);
474
- });
475
- });
476
- });
477
- describe('detectFileType', () => {
478
- let filePathForDetectTest;
479
- beforeEach(() => {
480
- filePathForDetectTest = path.join(tempRootDir, 'detectType.tmp');
481
- // Default: create as a text file for isBinaryFile fallback
482
- actualNodeFs.writeFileSync(filePathForDetectTest, 'Plain text content');
483
- });
484
- afterEach(() => {
485
- if (actualNodeFs.existsSync(filePathForDetectTest)) {
486
- actualNodeFs.unlinkSync(filePathForDetectTest);
487
- }
488
- vi.restoreAllMocks(); // Restore spies on actualNodeFs
489
- });
490
- it('should detect typescript type by extension (ts, mts, cts, tsx)', async () => {
491
- expect(await detectFileType('file.ts')).toBe('text');
492
- expect(await detectFileType('file.test.ts')).toBe('text');
493
- expect(await detectFileType('file.mts')).toBe('text');
494
- expect(await detectFileType('vite.config.mts')).toBe('text');
495
- expect(await detectFileType('file.cts')).toBe('text');
496
- expect(await detectFileType('component.tsx')).toBe('text');
497
- });
498
- it.each([
499
- { type: 'image', file: 'file.png', mime: 'image/png' },
500
- { type: 'image', file: 'file.jpg', mime: 'image/jpeg' },
501
- { type: 'pdf', file: 'file.pdf', mime: 'application/pdf' },
502
- { type: 'audio', file: 'song.mp3', mime: 'audio/mpeg' },
503
- { type: 'video', file: 'movie.mp4', mime: 'video/mp4' },
504
- { type: 'binary', file: 'archive.zip', mime: 'application/zip' },
505
- { type: 'binary', file: 'app.exe', mime: 'application/octet-stream' },
506
- ])('should detect $type type for $file by extension', async ({ file, mime, type }) => {
507
- mockMimeGetType.mockReturnValueOnce(mime);
508
- expect(await detectFileType(file)).toBe(type);
509
- });
510
- it('should detect svg type by extension', async () => {
511
- expect(await detectFileType('image.svg')).toBe('svg');
512
- expect(await detectFileType('image.icon.svg')).toBe('svg');
513
- });
514
- it('should use isBinaryFile for unknown extensions and detect as binary', async () => {
515
- mockMimeGetType.mockReturnValueOnce(false); // Unknown mime type
516
- // Create a file that isBinaryFile will identify as binary
517
- const binaryContent = Buffer.from([
518
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
519
- ]);
520
- actualNodeFs.writeFileSync(filePathForDetectTest, binaryContent);
521
- expect(await detectFileType(filePathForDetectTest)).toBe('binary');
522
- });
523
- it('should default to text if mime type is unknown and content is not binary', async () => {
524
- mockMimeGetType.mockReturnValueOnce(false); // Unknown mime type
525
- // filePathForDetectTest is already a text file by default from beforeEach
526
- expect(await detectFileType(filePathForDetectTest)).toBe('text');
527
- });
528
- });
529
- describe('processSingleFileContent', () => {
530
- beforeEach(() => {
531
- // Ensure files exist for statSync checks before readFile might be mocked
532
- if (actualNodeFs.existsSync(testTextFilePath))
533
- actualNodeFs.unlinkSync(testTextFilePath);
534
- if (actualNodeFs.existsSync(testImageFilePath))
535
- actualNodeFs.unlinkSync(testImageFilePath);
536
- if (actualNodeFs.existsSync(testPdfFilePath))
537
- actualNodeFs.unlinkSync(testPdfFilePath);
538
- if (actualNodeFs.existsSync(testAudioFilePath))
539
- actualNodeFs.unlinkSync(testAudioFilePath);
540
- if (actualNodeFs.existsSync(testBinaryFilePath))
541
- actualNodeFs.unlinkSync(testBinaryFilePath);
542
- });
543
- it('should read a text file successfully', async () => {
544
- const content = 'Line 1\\nLine 2\\nLine 3';
545
- actualNodeFs.writeFileSync(testTextFilePath, content);
546
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService());
547
- expect(result.llmContent).toBe(content);
548
- expect(result.returnDisplay).toBe('');
549
- expect(result.error).toBeUndefined();
550
- });
551
- it('should handle file not found', async () => {
552
- const result = await processSingleFileContent(nonexistentFilePath, tempRootDir, new StandardFileSystemService());
553
- expect(result.error).toContain('File not found');
554
- expect(result.returnDisplay).toContain('File not found');
555
- });
556
- it('should handle read errors for text files', async () => {
557
- actualNodeFs.writeFileSync(testTextFilePath, 'content'); // File must exist for initial statSync
558
- const readError = new Error('Simulated read error');
559
- vi.spyOn(fsPromises, 'readFile').mockRejectedValueOnce(readError);
560
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService());
561
- expect(result.error).toContain('Simulated read error');
562
- expect(result.returnDisplay).toContain('Simulated read error');
563
- });
564
- it('should handle read errors for image/pdf files', async () => {
565
- actualNodeFs.writeFileSync(testImageFilePath, 'content'); // File must exist
566
- mockMimeGetType.mockReturnValue('image/png');
567
- const readError = new Error('Simulated image read error');
568
- vi.spyOn(fsPromises, 'readFile').mockRejectedValueOnce(readError);
569
- const result = await processSingleFileContent(testImageFilePath, tempRootDir, new StandardFileSystemService());
570
- expect(result.error).toContain('Simulated image read error');
571
- expect(result.returnDisplay).toContain('Simulated image read error');
572
- });
573
- it('should process an image file', async () => {
574
- const fakePngData = Buffer.from('fake png data');
575
- actualNodeFs.writeFileSync(testImageFilePath, fakePngData);
576
- mockMimeGetType.mockReturnValue('image/png');
577
- const result = await processSingleFileContent(testImageFilePath, tempRootDir, new StandardFileSystemService());
578
- expect(result.llmContent.inlineData).toBeDefined();
579
- expect(result.llmContent.inlineData
580
- .mimeType).toBe('image/png');
581
- expect(result.llmContent.inlineData.data).toBe(fakePngData.toString('base64'));
582
- expect(result.returnDisplay).toContain('Read image file: image.png');
583
- });
584
- it('should process a PDF file', async () => {
585
- const fakePdfData = Buffer.from('fake pdf data');
586
- actualNodeFs.writeFileSync(testPdfFilePath, fakePdfData);
587
- mockMimeGetType.mockReturnValue('application/pdf');
588
- const result = await processSingleFileContent(testPdfFilePath, tempRootDir, new StandardFileSystemService());
589
- expect(result.llmContent.inlineData).toBeDefined();
590
- expect(result.llmContent.inlineData
591
- .mimeType).toBe('application/pdf');
592
- expect(result.llmContent.inlineData.data).toBe(fakePdfData.toString('base64'));
593
- expect(result.returnDisplay).toContain('Read pdf file: document.pdf');
594
- });
595
- it('should process an audio file', async () => {
596
- const fakeMp3Data = Buffer.from('fake mp3 data');
597
- actualNodeFs.writeFileSync(testAudioFilePath, fakeMp3Data);
598
- mockMimeGetType.mockReturnValue('audio/mpeg');
599
- const result = await processSingleFileContent(testAudioFilePath, tempRootDir, new StandardFileSystemService());
600
- expect(result.llmContent.inlineData).toBeDefined();
601
- expect(result.llmContent.inlineData
602
- .mimeType).toBe('audio/mpeg');
603
- expect(result.llmContent.inlineData.data).toBe(fakeMp3Data.toString('base64'));
604
- expect(result.returnDisplay).toContain('Read audio file: audio.mp3');
605
- });
606
- it('should read an SVG file as text when under 1MB', async () => {
607
- const svgContent = `
608
- <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
609
- <rect width="100" height="100" fill="blue" />
610
- </svg>
611
- `;
612
- const testSvgFilePath = path.join(tempRootDir, 'test.svg');
613
- actualNodeFs.writeFileSync(testSvgFilePath, svgContent, 'utf-8');
614
- mockMimeGetType.mockReturnValue('image/svg+xml');
615
- const result = await processSingleFileContent(testSvgFilePath, tempRootDir, new StandardFileSystemService());
616
- expect(result.llmContent).toBe(svgContent);
617
- expect(result.returnDisplay).toContain('Read SVG as text');
618
- });
619
- it('should skip binary files', async () => {
620
- actualNodeFs.writeFileSync(testBinaryFilePath, Buffer.from([0x00, 0x01, 0x02]));
621
- mockMimeGetType.mockReturnValueOnce('application/octet-stream');
622
- // isBinaryFile will operate on the real file.
623
- const result = await processSingleFileContent(testBinaryFilePath, tempRootDir, new StandardFileSystemService());
624
- expect(result.llmContent).toContain('Cannot display content of binary file');
625
- expect(result.returnDisplay).toContain('Skipped binary file: app.exe');
626
- });
627
- it('should handle path being a directory', async () => {
628
- const result = await processSingleFileContent(directoryPath, tempRootDir, new StandardFileSystemService());
629
- expect(result.error).toContain('Path is a directory');
630
- expect(result.returnDisplay).toContain('Path is a directory');
631
- });
632
- it('should paginate text files correctly (offset and limit)', async () => {
633
- const lines = Array.from({ length: 20 }, (_, i) => `Line ${i + 1}`);
634
- actualNodeFs.writeFileSync(testTextFilePath, lines.join('\n'));
635
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService(), 5, 5); // Read lines 6-10
636
- const expectedContent = lines.slice(5, 10).join('\n');
637
- expect(result.llmContent).toBe(expectedContent);
638
- expect(result.returnDisplay).toBe('Read lines 6-10 of 20 from test.txt');
639
- expect(result.isTruncated).toBe(true);
640
- expect(result.originalLineCount).toBe(20);
641
- expect(result.linesShown).toEqual([6, 10]);
642
- });
643
- it('should identify truncation when reading the end of a file', async () => {
644
- const lines = Array.from({ length: 20 }, (_, i) => `Line ${i + 1}`);
645
- actualNodeFs.writeFileSync(testTextFilePath, lines.join('\n'));
646
- // Read from line 11 to 20. The start is not 0, so it's truncated.
647
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService(), 10, 10);
648
- const expectedContent = lines.slice(10, 20).join('\n');
649
- expect(result.llmContent).toContain(expectedContent);
650
- expect(result.returnDisplay).toBe('Read lines 11-20 of 20 from test.txt');
651
- expect(result.isTruncated).toBe(true); // This is the key check for the bug
652
- expect(result.originalLineCount).toBe(20);
653
- expect(result.linesShown).toEqual([11, 20]);
654
- });
655
- it('should handle limit exceeding file length', async () => {
656
- const lines = ['Line 1', 'Line 2'];
657
- actualNodeFs.writeFileSync(testTextFilePath, lines.join('\n'));
658
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService(), 0, 10);
659
- const expectedContent = lines.join('\n');
660
- expect(result.llmContent).toBe(expectedContent);
661
- expect(result.returnDisplay).toBe('');
662
- expect(result.isTruncated).toBe(false);
663
- expect(result.originalLineCount).toBe(2);
664
- expect(result.linesShown).toEqual([1, 2]);
665
- });
666
- it('should truncate long lines in text files', async () => {
667
- const longLine = 'a'.repeat(2500);
668
- actualNodeFs.writeFileSync(testTextFilePath, `Short line\n${longLine}\nAnother short line`);
669
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService());
670
- expect(result.llmContent).toContain('Short line');
671
- expect(result.llmContent).toContain(longLine.substring(0, 2000) + '... [truncated]');
672
- expect(result.llmContent).toContain('Another short line');
673
- expect(result.returnDisplay).toBe('Read all 3 lines from test.txt (some lines were shortened)');
674
- expect(result.isTruncated).toBe(true);
675
- });
676
- it('should truncate when line count exceeds the limit', async () => {
677
- const lines = Array.from({ length: 11 }, (_, i) => `Line ${i + 1}`);
678
- actualNodeFs.writeFileSync(testTextFilePath, lines.join('\n'));
679
- // Read 5 lines, but there are 11 total
680
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService(), 0, 5);
681
- expect(result.isTruncated).toBe(true);
682
- expect(result.returnDisplay).toBe('Read lines 1-5 of 11 from test.txt');
683
- });
684
- it('should truncate when a line length exceeds the character limit', async () => {
685
- const longLine = 'b'.repeat(2500);
686
- const lines = Array.from({ length: 10 }, (_, i) => `Line ${i + 1}`);
687
- lines.push(longLine); // Total 11 lines
688
- actualNodeFs.writeFileSync(testTextFilePath, lines.join('\n'));
689
- // Read all 11 lines, including the long one
690
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService(), 0, 11);
691
- expect(result.isTruncated).toBe(true);
692
- expect(result.returnDisplay).toBe('Read all 11 lines from test.txt (some lines were shortened)');
693
- });
694
- it('should truncate both line count and line length when both exceed limits', async () => {
695
- const linesWithLongInMiddle = Array.from({ length: 20 }, (_, i) => `Line ${i + 1}`);
696
- linesWithLongInMiddle[4] = 'c'.repeat(2500);
697
- actualNodeFs.writeFileSync(testTextFilePath, linesWithLongInMiddle.join('\n'));
698
- // Read 10 lines out of 20, including the long line
699
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService(), 0, 10);
700
- expect(result.isTruncated).toBe(true);
701
- expect(result.returnDisplay).toBe('Read lines 1-10 of 20 from test.txt (some lines were shortened)');
702
- });
703
- it('should return an error if the file size exceeds 20MB', async () => {
704
- // Create a small test file
705
- actualNodeFs.writeFileSync(testTextFilePath, 'test content');
706
- // Spy on fs.promises.stat to return a large file size
707
- const statSpy = vi.spyOn(fs.promises, 'stat').mockResolvedValueOnce({
708
- size: 21 * 1024 * 1024,
709
- isDirectory: () => false,
710
- });
711
- try {
712
- const result = await processSingleFileContent(testTextFilePath, tempRootDir, new StandardFileSystemService());
713
- expect(result.error).toContain('File size exceeds the 20MB limit');
714
- expect(result.returnDisplay).toContain('File size exceeds the 20MB limit');
715
- expect(result.llmContent).toContain('File size exceeds the 20MB limit');
716
- }
717
- finally {
718
- statSpy.mockRestore();
719
- }
720
- });
721
- });
722
- describe('saveTruncatedToolOutput & formatTruncatedToolOutput', () => {
723
- it('should save content to a file with safe name', async () => {
724
- const content = 'some content';
725
- const toolName = 'shell';
726
- const id = '123';
727
- const result = await saveTruncatedToolOutput(content, toolName, id, tempRootDir);
728
- const expectedOutputFile = path.join(tempRootDir, 'shell_123.txt');
729
- expect(result.outputFile).toBe(expectedOutputFile);
730
- expect(result.totalLines).toBe(1);
731
- const savedContent = await fsPromises.readFile(expectedOutputFile, 'utf-8');
732
- expect(savedContent).toBe(content);
733
- });
734
- it('should sanitize tool name in filename', async () => {
735
- const content = 'content';
736
- const toolName = '../../dangerous/tool';
737
- const id = 1;
738
- const result = await saveTruncatedToolOutput(content, toolName, id, tempRootDir);
739
- // ../../dangerous/tool -> ______dangerous_tool
740
- const expectedOutputFile = path.join(tempRootDir, '______dangerous_tool_1.txt');
741
- expect(result.outputFile).toBe(expectedOutputFile);
742
- });
743
- it('should sanitize id in filename', async () => {
744
- const content = 'content';
745
- const toolName = 'shell';
746
- const id = '../../etc/passwd';
747
- const result = await saveTruncatedToolOutput(content, toolName, id, tempRootDir);
748
- // ../../etc/passwd -> ______etc_passwd
749
- const expectedOutputFile = path.join(tempRootDir, 'shell_______etc_passwd.txt');
750
- expect(result.outputFile).toBe(expectedOutputFile);
751
- });
752
- it('should format multi-line output correctly', () => {
753
- const lines = Array.from({ length: 50 }, (_, i) => `line ${i}`);
754
- const content = lines.join('\n');
755
- const outputFile = '/tmp/out.txt';
756
- const formatted = formatTruncatedToolOutput(content, outputFile, 10);
757
- expect(formatted).toContain('Output too large. Showing the last 10 of 50 lines.');
758
- expect(formatted).toContain('For full output see: /tmp/out.txt');
759
- expect(formatted).toContain('line 49');
760
- expect(formatted).not.toContain('line 0');
761
- });
762
- it('should truncate "elephant lines" (long single line in multi-line output)', () => {
763
- const longLine = 'a'.repeat(2000);
764
- const content = `line 1\n${longLine}\nline 3`;
765
- const outputFile = '/tmp/out.txt';
766
- const formatted = formatTruncatedToolOutput(content, outputFile, 3);
767
- expect(formatted).toContain('(some long lines truncated)');
768
- expect(formatted).toContain('... [LINE WIDTH TRUNCATED]');
769
- expect(formatted.length).toBeLessThan(longLine.length);
770
- });
771
- it('should handle massive single-line string with character-based truncation', () => {
772
- const content = 'a'.repeat(50000);
773
- const outputFile = '/tmp/out.txt';
774
- const formatted = formatTruncatedToolOutput(content, outputFile);
775
- expect(formatted).toContain('Output too large. Showing the last 4,000 characters');
776
- expect(formatted.endsWith(content.slice(-4000))).toBe(true);
777
- });
778
- });
779
- });
780
- //# sourceMappingURL=fileUtils.test.js.map