@didim365/agent-cli-core 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -2
- package/dist/docs/00_project/ai_adapter/01-overview.md +0 -172
- package/dist/docs/00_project/ai_adapter/02-architecture.md +0 -448
- package/dist/docs/00_project/ai_adapter/03-technical-design.md +0 -1470
- package/dist/docs/00_project/ai_adapter/04-integration-design.md +0 -1934
- package/dist/docs/00_project/ai_adapter/05-implementation-plan.md +0 -336
- package/dist/docs/00_project/ai_adapter/06-didiaistudio-plan.md +0 -559
- package/dist/docs/00_project/ai_adapter/README.md +0 -145
- package/dist/docs/00_project/ai_adapter/agent_service_openapi.json +0 -1
- 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
- package/dist/docs/00_project/ai_adapter/event-mapping-matrix.md +0 -148
- package/dist/docs/00_project/ai_adapter/migration-plan.md +0 -205
- package/dist/docs/00_project/ai_adapter/template/00_vibecoding_workflow.md +0 -627
- package/dist/docs/00_project/ai_adapter/template/01_todolist_performance_template.md +0 -436
- package/dist/docs/00_project/ai_adapter/template/02_code_review_template.md +0 -248
- package/dist/docs/00_project/ai_adapter/template/03_work_result_report_template.md +0 -133
- package/dist/docs/00_project/ai_adapter/template/100_Python_Performance_Guide.md +0 -472
- package/dist/docs/00_project/ai_adapter/template/99_TDD_plan.md +0 -123
- package/dist/docs/00_project/ai_adapter/todolist/00_master_implementation_plan.md +0 -433
- package/dist/docs/00_project/ai_adapter/todolist/phase1_foundation_todolist.md +0 -726
- package/dist/docs/00_project/ai_adapter/todolist/phase2_core_refactoring_todolist.md +0 -974
- package/dist/docs/00_project/ai_adapter/todolist/phase3_handoff.md +0 -203
- package/dist/docs/00_project/ai_adapter/todolist/phase3_provider_extension_todolist.md +0 -1382
- package/dist/docs/00_project/ai_adapter/utility-migration.md +0 -237
- package/dist/docs/00_project/ai_adapter/working_history/.gitkeep +0 -0
- 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
- 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
- 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
- package/dist/docs/00_project/ai_adapter/working_history/Phase1_M1.3_Provider/354/204/240/355/203/235_20260206.md +0 -269
- 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
- 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
- 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
- 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
- package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.2_EventMapper/352/265/254/355/230/204_20260207.md +0 -372
- package/dist/docs/00_project/ai_adapter/working_history/Phase2_M2.3_GeminiAdapter/352/265/254/355/230/204_20260208.md +0 -205
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.1.1_ClaudeAdapter/352/265/254/355/230/204_20260209.md +0 -225
- 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
- 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
- package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.1.4_ClaudeErrorMapping_20260209.md +0 -98
- package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.2.A_OpenAIAdapterCore_20260210.md +0 -264
- package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.2.B_OpenAIStreamConverter_20260210.md +0 -204
- 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
- package/dist/docs/00_project/ai_adapter/working_history/Phase3_M3.3_OpenAICompatibleAdapter_20260211.md +0 -251
- 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
- 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
- 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
- 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
- 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
- package/dist/docs/00_project/ai_adapter/working_history/phase2_tradeoff_EventType/354/240/204/355/231/230_20260208.md +0 -286
- package/dist/docs/00_project/white_labeling/template/00_vibecoding_workflow.md +0 -627
- package/dist/docs/00_project/white_labeling/template/01_todolist_performance_template.md +0 -400
- package/dist/docs/00_project/white_labeling/template/02_code_review_template.md +0 -248
- package/dist/docs/00_project/white_labeling/template/03_work_result_report_template.md +0 -133
- package/dist/docs/00_project/white_labeling/template/100_Python_Performance_Guide.md +0 -472
- package/dist/docs/00_project/white_labeling/template/99_TDD_plan.md +0 -123
- 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
- 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
- package/dist/docs/00_project/white_labeling//354/225/261/352/265/254/354/241/260.md +0 -310
- package/dist/docs/CONTRIBUTING.md +0 -554
- package/dist/docs/ai_adapter/01-overview.md +0 -155
- package/dist/docs/ai_adapter/02-architecture.md +0 -452
- package/dist/docs/ai_adapter/03-technical-design.md +0 -1470
- package/dist/docs/ai_adapter/04-integration-design.md +0 -1904
- package/dist/docs/ai_adapter/05-implementation-plan.md +0 -312
- package/dist/docs/ai_adapter/06-didiaistudio-plan.md +0 -559
- package/dist/docs/ai_adapter/README.md +0 -118
- package/dist/docs/ai_adapter/agent_service_openapi.json +0 -1
- 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
- package/dist/docs/ai_adapter/event-mapping-matrix.md +0 -140
- package/dist/docs/ai_adapter/migration-plan.md +0 -205
- package/dist/docs/ai_adapter/template/00_vibecoding_workflow.md +0 -636
- package/dist/docs/ai_adapter/template/01_todolist_performance_template.md +0 -372
- package/dist/docs/ai_adapter/template/02_code_review_template.md +0 -220
- package/dist/docs/ai_adapter/template/03_work_result_report_template.md +0 -120
- package/dist/docs/ai_adapter/template/100_Python_Performance_Guide.md +0 -453
- package/dist/docs/ai_adapter/template/99_TDD_plan.md +0 -111
- package/dist/docs/ai_adapter/todolist/00_master_implementation_plan.md +0 -433
- package/dist/docs/ai_adapter/todolist/phase1_foundation_todolist.md +0 -726
- package/dist/docs/ai_adapter/todolist/phase2_core_refactoring_todolist.md +0 -974
- package/dist/docs/ai_adapter/todolist/phase3_handoff.md +0 -203
- package/dist/docs/ai_adapter/todolist/phase3_provider_extension_todolist.md +0 -1382
- package/dist/docs/ai_adapter/utility-migration.md +0 -237
- package/dist/docs/ai_adapter/working_history/.gitkeep +0 -0
- 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
- 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
- package/dist/docs/ai_adapter/working_history/Phase1_M1.2_Adapter/354/235/270/355/224/204/353/235/274_20260203.md +0 -378
- package/dist/docs/ai_adapter/working_history/Phase1_M1.3_Provider/354/204/240/355/203/235_20260206.md +0 -269
- 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
- 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
- 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
- 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
- package/dist/docs/ai_adapter/working_history/Phase2_M2.2_EventMapper/352/265/254/355/230/204_20260207.md +0 -372
- package/dist/docs/ai_adapter/working_history/Phase2_M2.3_GeminiAdapter/352/265/254/355/230/204_20260208.md +0 -205
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/docs/ai_adapter/working_history/Phase3_M3.1.1_ClaudeAdapter/352/265/254/355/230/204_20260209.md +0 -225
- 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
- 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
- package/dist/docs/ai_adapter/working_history/Phase3_M3.1.4_ClaudeErrorMapping_20260209.md +0 -98
- package/dist/docs/ai_adapter/working_history/Phase3_M3.2.A_OpenAIAdapterCore_20260210.md +0 -264
- package/dist/docs/ai_adapter/working_history/Phase3_M3.2.B_OpenAIStreamConverter_20260210.md +0 -204
- 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
- package/dist/docs/ai_adapter/working_history/Phase3_M3.3_OpenAICompatibleAdapter_20260211.md +0 -251
- 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
- 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
- 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
- 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
- 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
- package/dist/docs/ai_adapter/working_history/phase2_tradeoff_EventType/354/240/204/355/231/230_20260208.md +0 -286
- package/dist/docs/api/index.md +0 -5
- package/dist/docs/api/providers.md +0 -56
- package/dist/docs/architecture.md +0 -80
- package/dist/docs/assets/connected_devtools.png +0 -0
- package/dist/docs/assets/gemini-screenshot.png +0 -0
- package/dist/docs/assets/monitoring-dashboard-logs.png +0 -0
- package/dist/docs/assets/monitoring-dashboard-metrics.png +0 -0
- package/dist/docs/assets/monitoring-dashboard-overview.png +0 -0
- package/dist/docs/assets/release_patch.png +0 -0
- package/dist/docs/assets/theme-ansi-light.png +0 -0
- package/dist/docs/assets/theme-ansi.png +0 -0
- package/dist/docs/assets/theme-atom-one.png +0 -0
- package/dist/docs/assets/theme-ayu-light.png +0 -0
- package/dist/docs/assets/theme-ayu.png +0 -0
- package/dist/docs/assets/theme-custom.png +0 -0
- package/dist/docs/assets/theme-default-light.png +0 -0
- package/dist/docs/assets/theme-default.png +0 -0
- package/dist/docs/assets/theme-dracula.png +0 -0
- package/dist/docs/assets/theme-github-light.png +0 -0
- package/dist/docs/assets/theme-github.png +0 -0
- package/dist/docs/assets/theme-google-light.png +0 -0
- package/dist/docs/assets/theme-xcode-light.png +0 -0
- package/dist/docs/change_model/model_command_multi_provider_plan.md +0 -221
- package/dist/docs/change_model/model_command_multi_provider_todolist.md +0 -206
- package/dist/docs/changelogs/index.md +0 -726
- package/dist/docs/changelogs/latest.md +0 -370
- package/dist/docs/changelogs/preview.md +0 -332
- package/dist/docs/cli/authentication.md +0 -3
- package/dist/docs/cli/checkpointing.md +0 -94
- package/dist/docs/cli/commands.md +0 -375
- package/dist/docs/cli/custom-commands.md +0 -315
- package/dist/docs/cli/enterprise.md +0 -565
- package/dist/docs/cli/gemini-ignore.md +0 -71
- package/dist/docs/cli/gemini-md.md +0 -108
- package/dist/docs/cli/generation-settings.md +0 -210
- package/dist/docs/cli/headless.md +0 -388
- package/dist/docs/cli/index.md +0 -65
- package/dist/docs/cli/keyboard-shortcuts.md +0 -129
- package/dist/docs/cli/model-routing.md +0 -42
- package/dist/docs/cli/model.md +0 -62
- package/dist/docs/cli/sandbox.md +0 -171
- package/dist/docs/cli/session-management.md +0 -158
- package/dist/docs/cli/settings.md +0 -130
- package/dist/docs/cli/skills.md +0 -188
- package/dist/docs/cli/system-prompt.md +0 -125
- package/dist/docs/cli/telemetry.md +0 -826
- package/dist/docs/cli/themes.md +0 -235
- package/dist/docs/cli/token-caching.md +0 -20
- package/dist/docs/cli/trusted-folders.md +0 -95
- package/dist/docs/cli/tutorials/skills-getting-started.md +0 -124
- package/dist/docs/cli/tutorials.md +0 -87
- package/dist/docs/cli/uninstall.md +0 -65
- package/dist/docs/configuration.md +0 -108
- package/dist/docs/core/index.md +0 -105
- package/dist/docs/core/long-term-memory-design.md +0 -254
- package/dist/docs/core/long-term-memory-proposal.md +0 -112
- package/dist/docs/core/memport.md +0 -246
- package/dist/docs/core/policy-engine.md +0 -300
- package/dist/docs/core/tools-api.md +0 -131
- package/dist/docs/examples/proxy-script.md +0 -83
- package/dist/docs/extensions/best-practices.md +0 -139
- package/dist/docs/extensions/index.md +0 -44
- package/dist/docs/extensions/reference.md +0 -312
- package/dist/docs/extensions/releasing.md +0 -183
- package/dist/docs/extensions/writing-extensions.md +0 -283
- package/dist/docs/faq.md +0 -154
- package/dist/docs/get-started/authentication.md +0 -321
- package/dist/docs/get-started/configuration-v1.md +0 -888
- package/dist/docs/get-started/configuration.md +0 -1567
- package/dist/docs/get-started/examples.md +0 -219
- package/dist/docs/get-started/gemini-3.md +0 -101
- package/dist/docs/get-started/index.md +0 -71
- package/dist/docs/get-started/installation.md +0 -141
- package/dist/docs/hooks/best-practices.md +0 -677
- package/dist/docs/hooks/index.md +0 -178
- package/dist/docs/hooks/reference.md +0 -322
- package/dist/docs/hooks/writing-hooks.md +0 -450
- package/dist/docs/ide-integration/ide-companion-spec.md +0 -267
- package/dist/docs/ide-integration/index.md +0 -202
- package/dist/docs/index.md +0 -153
- package/dist/docs/integration-tests.md +0 -211
- package/dist/docs/issue-and-pr-automation.md +0 -134
- package/dist/docs/local-development.md +0 -128
- package/dist/docs/mermaid/context.mmd +0 -103
- package/dist/docs/mermaid/render-path.mmd +0 -64
- package/dist/docs/migration.md +0 -78
- package/dist/docs/npm.md +0 -62
- package/dist/docs/providers.md +0 -136
- package/dist/docs/quota-and-pricing.md +0 -158
- package/dist/docs/release-confidence.md +0 -164
- package/dist/docs/releases.md +0 -539
- package/dist/docs/sidebar.json +0 -140
- package/dist/docs/tools/file-system.md +0 -217
- package/dist/docs/tools/index.md +0 -98
- package/dist/docs/tools/mcp-server.md +0 -1068
- package/dist/docs/tools/memory.md +0 -54
- package/dist/docs/tools/shell.md +0 -260
- package/dist/docs/tools/todos.md +0 -57
- package/dist/docs/tools/web-fetch.md +0 -59
- package/dist/docs/tools/web-search.md +0 -42
- package/dist/docs/tos-privacy.md +0 -96
- package/dist/docs/troubleshooting.md +0 -173
- package/dist/src/agents/a2a-client-manager.test.d.ts +0 -6
- package/dist/src/agents/a2a-client-manager.test.js +0 -220
- package/dist/src/agents/a2a-client-manager.test.js.map +0 -1
- package/dist/src/agents/a2aUtils.test.d.ts +0 -6
- package/dist/src/agents/a2aUtils.test.js +0 -147
- package/dist/src/agents/a2aUtils.test.js.map +0 -1
- package/dist/src/agents/acknowledgedAgents.test.d.ts +0 -6
- package/dist/src/agents/acknowledgedAgents.test.js +0 -70
- package/dist/src/agents/acknowledgedAgents.test.js.map +0 -1
- package/dist/src/agents/agent-scheduler.test.d.ts +0 -6
- package/dist/src/agents/agent-scheduler.test.js +0 -56
- package/dist/src/agents/agent-scheduler.test.js.map +0 -1
- package/dist/src/agents/agentLoader.test.d.ts +0 -6
- package/dist/src/agents/agentLoader.test.js +0 -304
- package/dist/src/agents/agentLoader.test.js.map +0 -1
- package/dist/src/agents/cli-help-agent.test.d.ts +0 -6
- package/dist/src/agents/cli-help-agent.test.js +0 -67
- package/dist/src/agents/cli-help-agent.test.js.map +0 -1
- package/dist/src/agents/codebase-investigator.test.d.ts +0 -6
- package/dist/src/agents/codebase-investigator.test.js +0 -42
- package/dist/src/agents/codebase-investigator.test.js.map +0 -1
- package/dist/src/agents/generalist-agent.test.d.ts +0 -6
- package/dist/src/agents/generalist-agent.test.js +0 -31
- package/dist/src/agents/generalist-agent.test.js.map +0 -1
- package/dist/src/agents/local-executor.test.d.ts +0 -6
- package/dist/src/agents/local-executor.test.js +0 -1577
- package/dist/src/agents/local-executor.test.js.map +0 -1
- package/dist/src/agents/local-invocation.test.d.ts +0 -6
- package/dist/src/agents/local-invocation.test.js +0 -228
- package/dist/src/agents/local-invocation.test.js.map +0 -1
- package/dist/src/agents/registry.test.d.ts +0 -6
- package/dist/src/agents/registry.test.js +0 -773
- package/dist/src/agents/registry.test.js.map +0 -1
- package/dist/src/agents/registry_acknowledgement.test.d.ts +0 -6
- package/dist/src/agents/registry_acknowledgement.test.js +0 -130
- package/dist/src/agents/registry_acknowledgement.test.js.map +0 -1
- package/dist/src/agents/remote-invocation.test.d.ts +0 -6
- package/dist/src/agents/remote-invocation.test.js +0 -213
- package/dist/src/agents/remote-invocation.test.js.map +0 -1
- package/dist/src/agents/subagent-tool-wrapper.test.d.ts +0 -6
- package/dist/src/agents/subagent-tool-wrapper.test.js +0 -109
- package/dist/src/agents/subagent-tool-wrapper.test.js.map +0 -1
- package/dist/src/agents/utils.test.d.ts +0 -6
- package/dist/src/agents/utils.test.js +0 -87
- package/dist/src/agents/utils.test.js.map +0 -1
- package/dist/src/availability/fallbackIntegration.test.d.ts +0 -6
- package/dist/src/availability/fallbackIntegration.test.js +0 -58
- package/dist/src/availability/fallbackIntegration.test.js.map +0 -1
- package/dist/src/availability/modelAvailabilityService.test.d.ts +0 -6
- package/dist/src/availability/modelAvailabilityService.test.js +0 -140
- package/dist/src/availability/modelAvailabilityService.test.js.map +0 -1
- package/dist/src/availability/policyCatalog.test.d.ts +0 -6
- package/dist/src/availability/policyCatalog.test.js +0 -70
- package/dist/src/availability/policyCatalog.test.js.map +0 -1
- package/dist/src/availability/policyHelpers.test.d.ts +0 -6
- package/dist/src/availability/policyHelpers.test.js +0 -220
- package/dist/src/availability/policyHelpers.test.js.map +0 -1
- package/dist/src/code_assist/admin/admin_controls.test.d.ts +0 -6
- package/dist/src/code_assist/admin/admin_controls.test.js +0 -200
- package/dist/src/code_assist/admin/admin_controls.test.js.map +0 -1
- package/dist/src/code_assist/codeAssist.test.d.ts +0 -6
- package/dist/src/code_assist/codeAssist.test.js +0 -102
- package/dist/src/code_assist/codeAssist.test.js.map +0 -1
- package/dist/src/code_assist/converter.test.d.ts +0 -6
- package/dist/src/code_assist/converter.test.js +0 -391
- package/dist/src/code_assist/converter.test.js.map +0 -1
- package/dist/src/code_assist/experiments/client_metadata.test.d.ts +0 -6
- package/dist/src/code_assist/experiments/client_metadata.test.js +0 -96
- package/dist/src/code_assist/experiments/client_metadata.test.js.map +0 -1
- package/dist/src/code_assist/experiments/experiments.test.d.ts +0 -6
- package/dist/src/code_assist/experiments/experiments.test.js +0 -93
- package/dist/src/code_assist/experiments/experiments.test.js.map +0 -1
- package/dist/src/code_assist/experiments/experiments_local.test.d.ts +0 -6
- package/dist/src/code_assist/experiments/experiments_local.test.js +0 -115
- package/dist/src/code_assist/experiments/experiments_local.test.js.map +0 -1
- package/dist/src/code_assist/oauth-credential-storage.test.d.ts +0 -6
- package/dist/src/code_assist/oauth-credential-storage.test.js +0 -198
- package/dist/src/code_assist/oauth-credential-storage.test.js.map +0 -1
- package/dist/src/code_assist/oauth2.test.d.ts +0 -6
- package/dist/src/code_assist/oauth2.test.js +0 -1065
- package/dist/src/code_assist/oauth2.test.js.map +0 -1
- package/dist/src/code_assist/server.test.d.ts +0 -6
- package/dist/src/code_assist/server.test.js +0 -453
- package/dist/src/code_assist/server.test.js.map +0 -1
- package/dist/src/code_assist/setup.test.d.ts +0 -6
- package/dist/src/code_assist/setup.test.js +0 -517
- package/dist/src/code_assist/setup.test.js.map +0 -1
- package/dist/src/code_assist/telemetry.test.d.ts +0 -6
- package/dist/src/code_assist/telemetry.test.js +0 -301
- package/dist/src/code_assist/telemetry.test.js.map +0 -1
- package/dist/src/commands/extensions.test.d.ts +0 -6
- package/dist/src/commands/extensions.test.js +0 -19
- package/dist/src/commands/extensions.test.js.map +0 -1
- package/dist/src/commands/init.test.d.ts +0 -6
- package/dist/src/commands/init.test.js +0 -25
- package/dist/src/commands/init.test.js.map +0 -1
- package/dist/src/commands/memory.test.d.ts +0 -6
- package/dist/src/commands/memory.test.js +0 -182
- package/dist/src/commands/memory.test.js.map +0 -1
- package/dist/src/commands/restore.test.d.ts +0 -6
- package/dist/src/commands/restore.test.js +0 -137
- package/dist/src/commands/restore.test.js.map +0 -1
- package/dist/src/config/config.test.d.ts +0 -6
- package/dist/src/config/config.test.js +0 -1811
- package/dist/src/config/config.test.js.map +0 -1
- package/dist/src/config/flashFallback.test.d.ts +0 -6
- package/dist/src/config/flashFallback.test.js +0 -63
- package/dist/src/config/flashFallback.test.js.map +0 -1
- package/dist/src/config/models.test.d.ts +0 -6
- package/dist/src/config/models.test.js +0 -146
- package/dist/src/config/models.test.js.map +0 -1
- package/dist/src/config/storage.test.d.ts +0 -6
- package/dist/src/config/storage.test.js +0 -115
- package/dist/src/config/storage.test.js.map +0 -1
- package/dist/src/confirmation-bus/message-bus.test.d.ts +0 -6
- package/dist/src/confirmation-bus/message-bus.test.js +0 -170
- package/dist/src/confirmation-bus/message-bus.test.js.map +0 -1
- package/dist/src/core/apiKeyCredentialStorage.test.d.ts +0 -6
- package/dist/src/core/apiKeyCredentialStorage.test.js +0 -71
- package/dist/src/core/apiKeyCredentialStorage.test.js.map +0 -1
- package/dist/src/core/baseLlmClient.test.d.ts +0 -6
- package/dist/src/core/baseLlmClient.test.js +0 -569
- package/dist/src/core/baseLlmClient.test.js.map +0 -1
- package/dist/src/core/baseLlmClient_new_types.test.d.ts +0 -1
- package/dist/src/core/baseLlmClient_new_types.test.js +0 -387
- package/dist/src/core/baseLlmClient_new_types.test.js.map +0 -1
- package/dist/src/core/client.test.d.ts +0 -6
- package/dist/src/core/client.test.js +0 -2654
- package/dist/src/core/client.test.js.map +0 -1
- package/dist/src/core/contentGenerator.multiProvider.test.d.ts +0 -6
- package/dist/src/core/contentGenerator.multiProvider.test.js +0 -314
- package/dist/src/core/contentGenerator.multiProvider.test.js.map +0 -1
- package/dist/src/core/contentGenerator.test.d.ts +0 -6
- package/dist/src/core/contentGenerator.test.js +0 -299
- package/dist/src/core/contentGenerator.test.js.map +0 -1
- package/dist/src/core/contentGenerator_new_types.test.d.ts +0 -6
- package/dist/src/core/contentGenerator_new_types.test.js +0 -292
- package/dist/src/core/contentGenerator_new_types.test.js.map +0 -1
- package/dist/src/core/coreToolHookTriggers.test.d.ts +0 -6
- package/dist/src/core/coreToolHookTriggers.test.js +0 -159
- package/dist/src/core/coreToolHookTriggers.test.js.map +0 -1
- package/dist/src/core/coreToolScheduler.test.d.ts +0 -6
- package/dist/src/core/coreToolScheduler.test.js +0 -1684
- package/dist/src/core/coreToolScheduler.test.js.map +0 -1
- package/dist/src/core/fakeContentGenerator.test.d.ts +0 -6
- package/dist/src/core/fakeContentGenerator.test.js +0 -127
- package/dist/src/core/fakeContentGenerator.test.js.map +0 -1
- package/dist/src/core/geminiChat.test.d.ts +0 -6
- package/dist/src/core/geminiChat.test.js +0 -1773
- package/dist/src/core/geminiChat.test.js.map +0 -1
- package/dist/src/core/geminiChat_network_retry.test.d.ts +0 -6
- package/dist/src/core/geminiChat_network_retry.test.js +0 -201
- package/dist/src/core/geminiChat_network_retry.test.js.map +0 -1
- package/dist/src/core/logger.test.d.ts +0 -6
- package/dist/src/core/logger.test.js +0 -550
- package/dist/src/core/logger.test.js.map +0 -1
- package/dist/src/core/loggingContentGenerator.test.d.ts +0 -6
- package/dist/src/core/loggingContentGenerator.test.js +0 -221
- package/dist/src/core/loggingContentGenerator.test.js.map +0 -1
- package/dist/src/core/prompts-substitution.test.d.ts +0 -6
- package/dist/src/core/prompts-substitution.test.js +0 -101
- package/dist/src/core/prompts-substitution.test.js.map +0 -1
- package/dist/src/core/prompts.test.d.ts +0 -6
- package/dist/src/core/prompts.test.js +0 -391
- package/dist/src/core/prompts.test.js.map +0 -1
- package/dist/src/core/recordingContentGenerator.test.d.ts +0 -6
- package/dist/src/core/recordingContentGenerator.test.js +0 -101
- package/dist/src/core/recordingContentGenerator.test.js.map +0 -1
- package/dist/src/core/tokenLimits.test.d.ts +0 -6
- package/dist/src/core/tokenLimits.test.js +0 -30
- package/dist/src/core/tokenLimits.test.js.map +0 -1
- package/dist/src/core/turn.test.d.ts +0 -6
- package/dist/src/core/turn.test.js +0 -739
- package/dist/src/core/turn.test.js.map +0 -1
- package/dist/src/fallback/handler.test.d.ts +0 -6
- package/dist/src/fallback/handler.test.js +0 -242
- package/dist/src/fallback/handler.test.js.map +0 -1
- package/dist/src/hooks/hookAggregator.test.d.ts +0 -6
- package/dist/src/hooks/hookAggregator.test.js +0 -387
- package/dist/src/hooks/hookAggregator.test.js.map +0 -1
- package/dist/src/hooks/hookEventHandler.test.d.ts +0 -6
- package/dist/src/hooks/hookEventHandler.test.js +0 -603
- package/dist/src/hooks/hookEventHandler.test.js.map +0 -1
- package/dist/src/hooks/hookPlanner.test.d.ts +0 -6
- package/dist/src/hooks/hookPlanner.test.js +0 -315
- package/dist/src/hooks/hookPlanner.test.js.map +0 -1
- package/dist/src/hooks/hookRegistry.test.d.ts +0 -6
- package/dist/src/hooks/hookRegistry.test.js +0 -529
- package/dist/src/hooks/hookRegistry.test.js.map +0 -1
- package/dist/src/hooks/hookRunner.test.d.ts +0 -6
- package/dist/src/hooks/hookRunner.test.js +0 -606
- package/dist/src/hooks/hookRunner.test.js.map +0 -1
- package/dist/src/hooks/hookSystem.test.d.ts +0 -6
- package/dist/src/hooks/hookSystem.test.js +0 -330
- package/dist/src/hooks/hookSystem.test.js.map +0 -1
- package/dist/src/hooks/hookSystem_new_types.test.d.ts +0 -6
- package/dist/src/hooks/hookSystem_new_types.test.js +0 -243
- package/dist/src/hooks/hookSystem_new_types.test.js.map +0 -1
- package/dist/src/hooks/hookTranslator.test.d.ts +0 -6
- package/dist/src/hooks/hookTranslator.test.js +0 -192
- package/dist/src/hooks/hookTranslator.test.js.map +0 -1
- package/dist/src/hooks/trustedHooks.test.d.ts +0 -6
- package/dist/src/hooks/trustedHooks.test.js +0 -154
- package/dist/src/hooks/trustedHooks.test.js.map +0 -1
- package/dist/src/hooks/types.test.d.ts +0 -6
- package/dist/src/hooks/types.test.js +0 -278
- package/dist/src/hooks/types.test.js.map +0 -1
- package/dist/src/ide/detect-ide.test.d.ts +0 -6
- package/dist/src/ide/detect-ide.test.js +0 -195
- package/dist/src/ide/detect-ide.test.js.map +0 -1
- package/dist/src/ide/ide-client.test.d.ts +0 -6
- package/dist/src/ide/ide-client.test.js +0 -753
- package/dist/src/ide/ide-client.test.js.map +0 -1
- package/dist/src/ide/ide-installer.test.d.ts +0 -6
- package/dist/src/ide/ide-installer.test.js +0 -193
- package/dist/src/ide/ide-installer.test.js.map +0 -1
- package/dist/src/ide/ideContext.test.d.ts +0 -6
- package/dist/src/ide/ideContext.test.js +0 -393
- package/dist/src/ide/ideContext.test.js.map +0 -1
- package/dist/src/ide/process-utils.test.d.ts +0 -6
- package/dist/src/ide/process-utils.test.js +0 -151
- package/dist/src/ide/process-utils.test.js.map +0 -1
- package/dist/src/index.test.d.ts +0 -6
- package/dist/src/index.test.js +0 -53
- package/dist/src/index.test.js.map +0 -1
- package/dist/src/mcp/google-auth-provider.test.d.ts +0 -6
- package/dist/src/mcp/google-auth-provider.test.js +0 -167
- package/dist/src/mcp/google-auth-provider.test.js.map +0 -1
- package/dist/src/mcp/oauth-provider.test.d.ts +0 -6
- package/dist/src/mcp/oauth-provider.test.js +0 -1355
- package/dist/src/mcp/oauth-provider.test.js.map +0 -1
- package/dist/src/mcp/oauth-token-storage.test.d.ts +0 -6
- package/dist/src/mcp/oauth-token-storage.test.js +0 -305
- package/dist/src/mcp/oauth-token-storage.test.js.map +0 -1
- package/dist/src/mcp/oauth-utils.test.d.ts +0 -6
- package/dist/src/mcp/oauth-utils.test.js +0 -289
- package/dist/src/mcp/oauth-utils.test.js.map +0 -1
- package/dist/src/mcp/sa-impersonation-provider.test.d.ts +0 -6
- package/dist/src/mcp/sa-impersonation-provider.test.js +0 -117
- package/dist/src/mcp/sa-impersonation-provider.test.js.map +0 -1
- package/dist/src/mcp/token-storage/base-token-storage.test.d.ts +0 -6
- package/dist/src/mcp/token-storage/base-token-storage.test.js +0 -151
- package/dist/src/mcp/token-storage/base-token-storage.test.js.map +0 -1
- package/dist/src/mcp/token-storage/file-token-storage.test.d.ts +0 -6
- package/dist/src/mcp/token-storage/file-token-storage.test.js +0 -238
- package/dist/src/mcp/token-storage/file-token-storage.test.js.map +0 -1
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.d.ts +0 -6
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.js +0 -193
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.js.map +0 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.test.d.ts +0 -6
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js +0 -305
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +0 -1
- package/dist/src/output/json-formatter.test.d.ts +0 -6
- package/dist/src/output/json-formatter.test.js +0 -294
- package/dist/src/output/json-formatter.test.js.map +0 -1
- package/dist/src/output/stream-json-formatter.test.d.ts +0 -6
- package/dist/src/output/stream-json-formatter.test.js +0 -477
- package/dist/src/output/stream-json-formatter.test.js.map +0 -1
- package/dist/src/policy/config.test.d.ts +0 -6
- package/dist/src/policy/config.test.js +0 -598
- package/dist/src/policy/config.test.js.map +0 -1
- package/dist/src/policy/persistence.test.d.ts +0 -6
- package/dist/src/policy/persistence.test.js +0 -154
- package/dist/src/policy/persistence.test.js.map +0 -1
- package/dist/src/policy/policy-engine.test.d.ts +0 -6
- package/dist/src/policy/policy-engine.test.js +0 -1299
- package/dist/src/policy/policy-engine.test.js.map +0 -1
- package/dist/src/policy/policy-updater.test.d.ts +0 -6
- package/dist/src/policy/policy-updater.test.js +0 -116
- package/dist/src/policy/policy-updater.test.js.map +0 -1
- package/dist/src/policy/shell-safety.test.d.ts +0 -6
- package/dist/src/policy/shell-safety.test.js +0 -438
- package/dist/src/policy/shell-safety.test.js.map +0 -1
- package/dist/src/policy/toml-loader.test.d.ts +0 -6
- package/dist/src/policy/toml-loader.test.js +0 -409
- package/dist/src/policy/toml-loader.test.js.map +0 -1
- package/dist/src/policy/utils.test.d.ts +0 -6
- package/dist/src/policy/utils.test.js +0 -92
- package/dist/src/policy/utils.test.js.map +0 -1
- package/dist/src/prompts/mcp-prompts.test.d.ts +0 -6
- package/dist/src/prompts/mcp-prompts.test.js +0 -39
- package/dist/src/prompts/mcp-prompts.test.js.map +0 -1
- package/dist/src/prompts/prompt-registry.test.d.ts +0 -6
- package/dist/src/prompts/prompt-registry.test.js +0 -96
- package/dist/src/prompts/prompt-registry.test.js.map +0 -1
- package/dist/src/providers/__tests__/bundleSize.test.d.ts +0 -6
- package/dist/src/providers/__tests__/bundleSize.test.js +0 -75
- package/dist/src/providers/__tests__/bundleSize.test.js.map +0 -1
- package/dist/src/providers/__tests__/errorHandling.integration.test.d.ts +0 -6
- package/dist/src/providers/__tests__/errorHandling.integration.test.js +0 -339
- package/dist/src/providers/__tests__/errorHandling.integration.test.js.map +0 -1
- package/dist/src/providers/__tests__/multiProvider.integration.test.d.ts +0 -6
- package/dist/src/providers/__tests__/multiProvider.integration.test.js +0 -419
- package/dist/src/providers/__tests__/multiProvider.integration.test.js.map +0 -1
- package/dist/src/providers/__tests__/performance.test.d.ts +0 -6
- package/dist/src/providers/__tests__/performance.test.js +0 -270
- package/dist/src/providers/__tests__/performance.test.js.map +0 -1
- package/dist/src/providers/__tests__/providerConfigIntegration.test.d.ts +0 -6
- package/dist/src/providers/__tests__/providerConfigIntegration.test.js +0 -245
- package/dist/src/providers/__tests__/providerConfigIntegration.test.js.map +0 -1
- package/dist/src/providers/baseAdapter.test.d.ts +0 -1
- package/dist/src/providers/baseAdapter.test.js +0 -142
- package/dist/src/providers/baseAdapter.test.js.map +0 -1
- package/dist/src/providers/claude/adapter.test.d.ts +0 -6
- package/dist/src/providers/claude/adapter.test.js +0 -628
- package/dist/src/providers/claude/adapter.test.js.map +0 -1
- package/dist/src/providers/claude/bootstrap.test.d.ts +0 -6
- package/dist/src/providers/claude/bootstrap.test.js +0 -74
- package/dist/src/providers/claude/bootstrap.test.js.map +0 -1
- package/dist/src/providers/claude/converter.test.d.ts +0 -6
- package/dist/src/providers/claude/converter.test.js +0 -1002
- package/dist/src/providers/claude/converter.test.js.map +0 -1
- package/dist/src/providers/claude/exports.test.d.ts +0 -6
- package/dist/src/providers/claude/exports.test.js +0 -40
- package/dist/src/providers/claude/exports.test.js.map +0 -1
- package/dist/src/providers/configAdapter.test.d.ts +0 -1
- package/dist/src/providers/configAdapter.test.js +0 -150
- package/dist/src/providers/configAdapter.test.js.map +0 -1
- package/dist/src/providers/contentResolver.test.d.ts +0 -1
- package/dist/src/providers/contentResolver.test.js +0 -89
- package/dist/src/providers/contentResolver.test.js.map +0 -1
- package/dist/src/providers/factory.test.d.ts +0 -1
- package/dist/src/providers/factory.test.js +0 -151
- package/dist/src/providers/factory.test.js.map +0 -1
- package/dist/src/providers/gemini/adapterBridge.test.d.ts +0 -6
- package/dist/src/providers/gemini/adapterBridge.test.js +0 -164
- package/dist/src/providers/gemini/adapterBridge.test.js.map +0 -1
- package/dist/src/providers/gemini/bootstrap.test.d.ts +0 -6
- package/dist/src/providers/gemini/bootstrap.test.js +0 -72
- package/dist/src/providers/gemini/bootstrap.test.js.map +0 -1
- package/dist/src/providers/gemini/configConverter.test.d.ts +0 -6
- package/dist/src/providers/gemini/configConverter.test.js +0 -218
- package/dist/src/providers/gemini/configConverter.test.js.map +0 -1
- package/dist/src/providers/gemini/errorClassifier.test.d.ts +0 -6
- package/dist/src/providers/gemini/errorClassifier.test.js +0 -83
- package/dist/src/providers/gemini/errorClassifier.test.js.map +0 -1
- package/dist/src/providers/gemini/eventMapper.test.d.ts +0 -6
- package/dist/src/providers/gemini/eventMapper.test.js +0 -502
- package/dist/src/providers/gemini/eventMapper.test.js.map +0 -1
- package/dist/src/providers/gemini/exports.test.d.ts +0 -6
- package/dist/src/providers/gemini/exports.test.js +0 -90
- package/dist/src/providers/gemini/exports.test.js.map +0 -1
- package/dist/src/providers/gemini/featureFlag.test.d.ts +0 -6
- package/dist/src/providers/gemini/featureFlag.test.js +0 -139
- package/dist/src/providers/gemini/featureFlag.test.js.map +0 -1
- package/dist/src/providers/gemini/geminiAdapter.test.d.ts +0 -6
- package/dist/src/providers/gemini/geminiAdapter.test.js +0 -279
- package/dist/src/providers/gemini/geminiAdapter.test.js.map +0 -1
- package/dist/src/providers/gemini/geminiConverter.test.d.ts +0 -6
- package/dist/src/providers/gemini/geminiConverter.test.js +0 -474
- package/dist/src/providers/gemini/geminiConverter.test.js.map +0 -1
- package/dist/src/providers/gemini/geminiParity.test.d.ts +0 -6
- package/dist/src/providers/gemini/geminiParity.test.js +0 -754
- package/dist/src/providers/gemini/geminiParity.test.js.map +0 -1
- package/dist/src/providers/gemini/geminiStream.test.d.ts +0 -6
- package/dist/src/providers/gemini/geminiStream.test.js +0 -391
- package/dist/src/providers/gemini/geminiStream.test.js.map +0 -1
- package/dist/src/providers/gemini/historyBuilder.test.d.ts +0 -6
- package/dist/src/providers/gemini/historyBuilder.test.js +0 -207
- package/dist/src/providers/gemini/historyBuilder.test.js.map +0 -1
- package/dist/src/providers/gemini/requestBuilder.test.d.ts +0 -6
- package/dist/src/providers/gemini/requestBuilder.test.js +0 -358
- package/dist/src/providers/gemini/requestBuilder.test.js.map +0 -1
- package/dist/src/providers/gemini/streamConverter.test.d.ts +0 -6
- package/dist/src/providers/gemini/streamConverter.test.js +0 -131
- package/dist/src/providers/gemini/streamConverter.test.js.map +0 -1
- package/dist/src/providers/modelSpec.test.d.ts +0 -1
- package/dist/src/providers/modelSpec.test.js +0 -119
- package/dist/src/providers/modelSpec.test.js.map +0 -1
- package/dist/src/providers/openai/adapter.test.d.ts +0 -6
- package/dist/src/providers/openai/adapter.test.js +0 -274
- package/dist/src/providers/openai/adapter.test.js.map +0 -1
- package/dist/src/providers/openai/bootstrap.test.d.ts +0 -6
- package/dist/src/providers/openai/bootstrap.test.js +0 -76
- package/dist/src/providers/openai/bootstrap.test.js.map +0 -1
- package/dist/src/providers/openai/converter.test.d.ts +0 -6
- package/dist/src/providers/openai/converter.test.js +0 -1133
- package/dist/src/providers/openai/converter.test.js.map +0 -1
- package/dist/src/providers/openai-compatible/__tests__/compatibility.test.d.ts +0 -6
- package/dist/src/providers/openai-compatible/__tests__/compatibility.test.js +0 -356
- package/dist/src/providers/openai-compatible/__tests__/compatibility.test.js.map +0 -1
- package/dist/src/providers/openai-compatible/adapter.test.d.ts +0 -6
- package/dist/src/providers/openai-compatible/adapter.test.js +0 -240
- package/dist/src/providers/openai-compatible/adapter.test.js.map +0 -1
- package/dist/src/providers/openai-compatible/bootstrap.test.d.ts +0 -6
- package/dist/src/providers/openai-compatible/bootstrap.test.js +0 -145
- package/dist/src/providers/openai-compatible/bootstrap.test.js.map +0 -1
- package/dist/src/providers/openai-compatible/promptBuilder.test.d.ts +0 -6
- package/dist/src/providers/openai-compatible/promptBuilder.test.js +0 -154
- package/dist/src/providers/openai-compatible/promptBuilder.test.js.map +0 -1
- package/dist/src/providers/providerConfig.test.d.ts +0 -1
- package/dist/src/providers/providerConfig.test.js +0 -145
- package/dist/src/providers/providerConfig.test.js.map +0 -1
- package/dist/src/providers/providerConfigIntegration.test.d.ts +0 -6
- package/dist/src/providers/providerConfigIntegration.test.js +0 -187
- package/dist/src/providers/providerConfigIntegration.test.js.map +0 -1
- package/dist/src/providers/providerSelector.test.d.ts +0 -1
- package/dist/src/providers/providerSelector.test.js +0 -199
- package/dist/src/providers/providerSelector.test.js.map +0 -1
- package/dist/src/providers/providerTypes.test.d.ts +0 -1
- package/dist/src/providers/providerTypes.test.js +0 -95
- package/dist/src/providers/providerTypes.test.js.map +0 -1
- package/dist/src/providers/registry.test.d.ts +0 -1
- package/dist/src/providers/registry.test.js +0 -207
- package/dist/src/providers/registry.test.js.map +0 -1
- package/dist/src/providers/streamAssembler.test.d.ts +0 -1
- package/dist/src/providers/streamAssembler.test.js +0 -247
- package/dist/src/providers/streamAssembler.test.js.map +0 -1
- package/dist/src/providers/telemetryBridge.test.d.ts +0 -6
- package/dist/src/providers/telemetryBridge.test.js +0 -235
- package/dist/src/providers/telemetryBridge.test.js.map +0 -1
- package/dist/src/providers/types.test.d.ts +0 -6
- package/dist/src/providers/types.test.js +0 -253
- package/dist/src/providers/types.test.js.map +0 -1
- package/dist/src/resources/resource-registry.test.d.ts +0 -6
- package/dist/src/resources/resource-registry.test.js +0 -54
- package/dist/src/resources/resource-registry.test.js.map +0 -1
- package/dist/src/routing/modelRouterService.test.d.ts +0 -6
- package/dist/src/routing/modelRouterService.test.js +0 -106
- package/dist/src/routing/modelRouterService.test.js.map +0 -1
- package/dist/src/routing/strategies/classifierStrategy.test.d.ts +0 -6
- package/dist/src/routing/strategies/classifierStrategy.test.js +0 -249
- package/dist/src/routing/strategies/classifierStrategy.test.js.map +0 -1
- package/dist/src/routing/strategies/compositeStrategy.test.d.ts +0 -6
- package/dist/src/routing/strategies/compositeStrategy.test.js +0 -124
- package/dist/src/routing/strategies/compositeStrategy.test.js.map +0 -1
- package/dist/src/routing/strategies/defaultStrategy.test.d.ts +0 -6
- package/dist/src/routing/strategies/defaultStrategy.test.js +0 -102
- package/dist/src/routing/strategies/defaultStrategy.test.js.map +0 -1
- package/dist/src/routing/strategies/fallbackStrategy.test.d.ts +0 -6
- package/dist/src/routing/strategies/fallbackStrategy.test.js +0 -96
- package/dist/src/routing/strategies/fallbackStrategy.test.js.map +0 -1
- package/dist/src/routing/strategies/numericalClassifierStrategy.test.d.ts +0 -6
- package/dist/src/routing/strategies/numericalClassifierStrategy.test.js +0 -367
- package/dist/src/routing/strategies/numericalClassifierStrategy.test.js.map +0 -1
- package/dist/src/routing/strategies/overrideStrategy.test.d.ts +0 -6
- package/dist/src/routing/strategies/overrideStrategy.test.js +0 -59
- package/dist/src/routing/strategies/overrideStrategy.test.js.map +0 -1
- package/dist/src/safety/built-in.test.d.ts +0 -6
- package/dist/src/safety/built-in.test.js +0 -199
- package/dist/src/safety/built-in.test.js.map +0 -1
- package/dist/src/safety/checker-runner.test.d.ts +0 -6
- package/dist/src/safety/checker-runner.test.js +0 -238
- package/dist/src/safety/checker-runner.test.js.map +0 -1
- package/dist/src/safety/context-builder.test.d.ts +0 -6
- package/dist/src/safety/context-builder.test.js +0 -49
- package/dist/src/safety/context-builder.test.js.map +0 -1
- package/dist/src/safety/registry.test.d.ts +0 -6
- package/dist/src/safety/registry.test.js +0 -31
- package/dist/src/safety/registry.test.js.map +0 -1
- package/dist/src/scheduler/confirmation.test.d.ts +0 -6
- package/dist/src/scheduler/confirmation.test.js +0 -325
- package/dist/src/scheduler/confirmation.test.js.map +0 -1
- package/dist/src/scheduler/policy.test.d.ts +0 -6
- package/dist/src/scheduler/policy.test.js +0 -299
- package/dist/src/scheduler/policy.test.js.map +0 -1
- package/dist/src/scheduler/scheduler.test.d.ts +0 -6
- package/dist/src/scheduler/scheduler.test.js +0 -822
- package/dist/src/scheduler/scheduler.test.js.map +0 -1
- package/dist/src/scheduler/state-manager.test.d.ts +0 -6
- package/dist/src/scheduler/state-manager.test.js +0 -429
- package/dist/src/scheduler/state-manager.test.js.map +0 -1
- package/dist/src/scheduler/tool-executor.test.d.ts +0 -6
- package/dist/src/scheduler/tool-executor.test.js +0 -232
- package/dist/src/scheduler/tool-executor.test.js.map +0 -1
- package/dist/src/scheduler/tool-modifier.test.d.ts +0 -6
- package/dist/src/scheduler/tool-modifier.test.js +0 -159
- package/dist/src/scheduler/tool-modifier.test.js.map +0 -1
- package/dist/src/services/chatCompressionService.test.d.ts +0 -6
- package/dist/src/services/chatCompressionService.test.js +0 -573
- package/dist/src/services/chatCompressionService.test.js.map +0 -1
- package/dist/src/services/chatRecordingService.test.d.ts +0 -6
- package/dist/src/services/chatRecordingService.test.js +0 -486
- package/dist/src/services/chatRecordingService.test.js.map +0 -1
- package/dist/src/services/contextManager.test.d.ts +0 -6
- package/dist/src/services/contextManager.test.js +0 -104
- package/dist/src/services/contextManager.test.js.map +0 -1
- package/dist/src/services/environmentSanitization.test.d.ts +0 -6
- package/dist/src/services/environmentSanitization.test.js +0 -284
- package/dist/src/services/environmentSanitization.test.js.map +0 -1
- package/dist/src/services/fileDiscoveryService.test.d.ts +0 -6
- package/dist/src/services/fileDiscoveryService.test.js +0 -223
- package/dist/src/services/fileDiscoveryService.test.js.map +0 -1
- package/dist/src/services/fileSystemService.test.d.ts +0 -6
- package/dist/src/services/fileSystemService.test.js +0 -41
- package/dist/src/services/fileSystemService.test.js.map +0 -1
- package/dist/src/services/gitService.test.d.ts +0 -6
- package/dist/src/services/gitService.test.js +0 -264
- package/dist/src/services/gitService.test.js.map +0 -1
- package/dist/src/services/loopDetectionService.test.d.ts +0 -6
- package/dist/src/services/loopDetectionService.test.js +0 -881
- package/dist/src/services/loopDetectionService.test.js.map +0 -1
- package/dist/src/services/modelConfig.golden.test.d.ts +0 -6
- package/dist/src/services/modelConfig.golden.test.js +0 -74
- package/dist/src/services/modelConfig.golden.test.js.map +0 -1
- package/dist/src/services/modelConfig.integration.test.d.ts +0 -6
- package/dist/src/services/modelConfig.integration.test.js +0 -247
- package/dist/src/services/modelConfig.integration.test.js.map +0 -1
- package/dist/src/services/modelConfigBridge.test.d.ts +0 -6
- package/dist/src/services/modelConfigBridge.test.js +0 -410
- package/dist/src/services/modelConfigBridge.test.js.map +0 -1
- package/dist/src/services/modelConfigService.test.d.ts +0 -6
- package/dist/src/services/modelConfigService.test.js +0 -868
- package/dist/src/services/modelConfigService.test.js.map +0 -1
- package/dist/src/services/sessionSummaryService.test.d.ts +0 -6
- package/dist/src/services/sessionSummaryService.test.js +0 -785
- package/dist/src/services/sessionSummaryService.test.js.map +0 -1
- package/dist/src/services/sessionSummaryUtils.test.d.ts +0 -6
- package/dist/src/services/sessionSummaryUtils.test.js +0 -160
- package/dist/src/services/sessionSummaryUtils.test.js.map +0 -1
- package/dist/src/services/shellExecutionService.test.d.ts +0 -6
- package/dist/src/services/shellExecutionService.test.js +0 -1080
- package/dist/src/services/shellExecutionService.test.js.map +0 -1
- package/dist/src/skills/skillLoader.test.d.ts +0 -6
- package/dist/src/skills/skillLoader.test.js +0 -185
- package/dist/src/skills/skillLoader.test.js.map +0 -1
- package/dist/src/skills/skillManager.test.d.ts +0 -6
- package/dist/src/skills/skillManager.test.js +0 -297
- package/dist/src/skills/skillManager.test.js.map +0 -1
- package/dist/src/telemetry/activity-detector.test.d.ts +0 -6
- package/dist/src/telemetry/activity-detector.test.js +0 -136
- package/dist/src/telemetry/activity-detector.test.js.map +0 -1
- package/dist/src/telemetry/activity-monitor.test.d.ts +0 -6
- package/dist/src/telemetry/activity-monitor.test.js +0 -251
- package/dist/src/telemetry/activity-monitor.test.js.map +0 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +0 -19
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +0 -964
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +0 -1
- package/dist/src/telemetry/config.test.d.ts +0 -6
- package/dist/src/telemetry/config.test.js +0 -149
- package/dist/src/telemetry/config.test.js.map +0 -1
- package/dist/src/telemetry/gcp-exporters.test.d.ts +0 -6
- package/dist/src/telemetry/gcp-exporters.test.js +0 -318
- package/dist/src/telemetry/gcp-exporters.test.js.map +0 -1
- package/dist/src/telemetry/high-water-mark-tracker.test.d.ts +0 -6
- package/dist/src/telemetry/high-water-mark-tracker.test.js +0 -152
- package/dist/src/telemetry/high-water-mark-tracker.test.js.map +0 -1
- package/dist/src/telemetry/integration.test.circular.d.ts +0 -6
- package/dist/src/telemetry/integration.test.circular.js +0 -54
- package/dist/src/telemetry/integration.test.circular.js.map +0 -1
- package/dist/src/telemetry/loggers.test.circular.d.ts +0 -6
- package/dist/src/telemetry/loggers.test.circular.js +0 -107
- package/dist/src/telemetry/loggers.test.circular.js.map +0 -1
- package/dist/src/telemetry/loggers.test.d.ts +0 -6
- package/dist/src/telemetry/loggers.test.js +0 -1618
- package/dist/src/telemetry/loggers.test.js.map +0 -1
- package/dist/src/telemetry/memory-monitor.test.d.ts +0 -6
- package/dist/src/telemetry/memory-monitor.test.js +0 -472
- package/dist/src/telemetry/memory-monitor.test.js.map +0 -1
- package/dist/src/telemetry/metrics.test.d.ts +0 -6
- package/dist/src/telemetry/metrics.test.js +0 -1176
- package/dist/src/telemetry/metrics.test.js.map +0 -1
- package/dist/src/telemetry/rate-limiter.test.d.ts +0 -6
- package/dist/src/telemetry/rate-limiter.test.js +0 -207
- package/dist/src/telemetry/rate-limiter.test.js.map +0 -1
- package/dist/src/telemetry/sanitize.test.d.ts +0 -6
- package/dist/src/telemetry/sanitize.test.js +0 -279
- package/dist/src/telemetry/sanitize.test.js.map +0 -1
- package/dist/src/telemetry/sdk.test.d.ts +0 -6
- package/dist/src/telemetry/sdk.test.js +0 -360
- package/dist/src/telemetry/sdk.test.js.map +0 -1
- package/dist/src/telemetry/semantic.test.d.ts +0 -6
- package/dist/src/telemetry/semantic.test.js +0 -387
- package/dist/src/telemetry/semantic.test.js.map +0 -1
- package/dist/src/telemetry/semantic.truncation.test.d.ts +0 -1
- package/dist/src/telemetry/semantic.truncation.test.js +0 -92
- package/dist/src/telemetry/semantic.truncation.test.js.map +0 -1
- package/dist/src/telemetry/startupProfiler.test.d.ts +0 -6
- package/dist/src/telemetry/startupProfiler.test.js +0 -285
- package/dist/src/telemetry/startupProfiler.test.js.map +0 -1
- package/dist/src/telemetry/telemetry-utils.test.d.ts +0 -6
- package/dist/src/telemetry/telemetry-utils.test.js +0 -41
- package/dist/src/telemetry/telemetry-utils.test.js.map +0 -1
- package/dist/src/telemetry/telemetry.test.d.ts +0 -6
- package/dist/src/telemetry/telemetry.test.js +0 -57
- package/dist/src/telemetry/telemetry.test.js.map +0 -1
- package/dist/src/telemetry/uiTelemetry.test.d.ts +0 -6
- package/dist/src/telemetry/uiTelemetry.test.js +0 -584
- package/dist/src/telemetry/uiTelemetry.test.js.map +0 -1
- package/dist/src/tools/activate-skill.test.d.ts +0 -6
- package/dist/src/tools/activate-skill.test.js +0 -113
- package/dist/src/tools/activate-skill.test.js.map +0 -1
- package/dist/src/tools/ask-user.test.d.ts +0 -6
- package/dist/src/tools/ask-user.test.js +0 -187
- package/dist/src/tools/ask-user.test.js.map +0 -1
- package/dist/src/tools/base-tool-invocation.test.d.ts +0 -6
- package/dist/src/tools/base-tool-invocation.test.js +0 -85
- package/dist/src/tools/base-tool-invocation.test.js.map +0 -1
- package/dist/src/tools/confirmation-policy.test.d.ts +0 -6
- package/dist/src/tools/confirmation-policy.test.js +0 -143
- package/dist/src/tools/confirmation-policy.test.js.map +0 -1
- package/dist/src/tools/diffOptions.test.d.ts +0 -6
- package/dist/src/tools/diffOptions.test.js +0 -172
- package/dist/src/tools/diffOptions.test.js.map +0 -1
- package/dist/src/tools/edit.test.d.ts +0 -6
- package/dist/src/tools/edit.test.js +0 -729
- package/dist/src/tools/edit.test.js.map +0 -1
- package/dist/src/tools/get-internal-docs.test.d.ts +0 -6
- package/dist/src/tools/get-internal-docs.test.js +0 -57
- package/dist/src/tools/get-internal-docs.test.js.map +0 -1
- package/dist/src/tools/glob.test.d.ts +0 -6
- package/dist/src/tools/glob.test.js +0 -433
- package/dist/src/tools/glob.test.js.map +0 -1
- package/dist/src/tools/grep.test.d.ts +0 -6
- package/dist/src/tools/grep.test.js +0 -328
- package/dist/src/tools/grep.test.js.map +0 -1
- package/dist/src/tools/ls.test.d.ts +0 -6
- package/dist/src/tools/ls.test.js +0 -242
- package/dist/src/tools/ls.test.js.map +0 -1
- package/dist/src/tools/mcp-client-manager.test.d.ts +0 -6
- package/dist/src/tools/mcp-client-manager.test.js +0 -251
- package/dist/src/tools/mcp-client-manager.test.js.map +0 -1
- package/dist/src/tools/mcp-client.test.d.ts +0 -6
- package/dist/src/tools/mcp-client.test.js +0 -1346
- package/dist/src/tools/mcp-client.test.js.map +0 -1
- package/dist/src/tools/mcp-tool.test.d.ts +0 -6
- package/dist/src/tools/mcp-tool.test.js +0 -657
- package/dist/src/tools/mcp-tool.test.js.map +0 -1
- package/dist/src/tools/memoryTool.test.d.ts +0 -6
- package/dist/src/tools/memoryTool.test.js +0 -302
- package/dist/src/tools/memoryTool.test.js.map +0 -1
- package/dist/src/tools/message-bus-integration.test.d.ts +0 -6
- package/dist/src/tools/message-bus-integration.test.js +0 -169
- package/dist/src/tools/message-bus-integration.test.js.map +0 -1
- package/dist/src/tools/modifiable-tool.test.d.ts +0 -6
- package/dist/src/tools/modifiable-tool.test.js +0 -237
- package/dist/src/tools/modifiable-tool.test.js.map +0 -1
- package/dist/src/tools/read-file.test.d.ts +0 -6
- package/dist/src/tools/read-file.test.js +0 -376
- package/dist/src/tools/read-file.test.js.map +0 -1
- package/dist/src/tools/read-many-files.test.d.ts +0 -6
- package/dist/src/tools/read-many-files.test.js +0 -567
- package/dist/src/tools/read-many-files.test.js.map +0 -1
- package/dist/src/tools/ripGrep.test.d.ts +0 -6
- package/dist/src/tools/ripGrep.test.js +0 -1139
- package/dist/src/tools/ripGrep.test.js.map +0 -1
- package/dist/src/tools/shell.test.d.ts +0 -6
- package/dist/src/tools/shell.test.js +0 -526
- package/dist/src/tools/shell.test.js.map +0 -1
- package/dist/src/tools/tool-names.test.d.ts +0 -6
- package/dist/src/tools/tool-names.test.js +0 -43
- package/dist/src/tools/tool-names.test.js.map +0 -1
- package/dist/src/tools/tool-registry.test.d.ts +0 -6
- package/dist/src/tools/tool-registry.test.js +0 -461
- package/dist/src/tools/tool-registry.test.js.map +0 -1
- package/dist/src/tools/tools.test.d.ts +0 -6
- package/dist/src/tools/tools.test.js +0 -207
- package/dist/src/tools/tools.test.js.map +0 -1
- package/dist/src/tools/web-fetch.test.d.ts +0 -6
- package/dist/src/tools/web-fetch.test.js +0 -442
- package/dist/src/tools/web-fetch.test.js.map +0 -1
- package/dist/src/tools/web-search.test.d.ts +0 -6
- package/dist/src/tools/web-search.test.js +0 -214
- package/dist/src/tools/web-search.test.js.map +0 -1
- package/dist/src/tools/write-file.test.d.ts +0 -6
- package/dist/src/tools/write-file.test.js +0 -681
- package/dist/src/tools/write-file.test.js.map +0 -1
- package/dist/src/tools/write-todos.test.d.ts +0 -6
- package/dist/src/tools/write-todos.test.js +0 -90
- package/dist/src/tools/write-todos.test.js.map +0 -1
- package/dist/src/utils/apiConversionUtils.test.d.ts +0 -6
- package/dist/src/utils/apiConversionUtils.test.js +0 -150
- package/dist/src/utils/apiConversionUtils.test.js.map +0 -1
- package/dist/src/utils/bfsFileSearch.test.d.ts +0 -6
- package/dist/src/utils/bfsFileSearch.test.js +0 -227
- package/dist/src/utils/bfsFileSearch.test.js.map +0 -1
- package/dist/src/utils/channel.test.d.ts +0 -6
- package/dist/src/utils/channel.test.js +0 -170
- package/dist/src/utils/channel.test.js.map +0 -1
- package/dist/src/utils/checkpointUtils.test.d.ts +0 -6
- package/dist/src/utils/checkpointUtils.test.js +0 -229
- package/dist/src/utils/checkpointUtils.test.js.map +0 -1
- package/dist/src/utils/customHeaderUtils.test.d.ts +0 -6
- package/dist/src/utils/customHeaderUtils.test.js +0 -77
- package/dist/src/utils/customHeaderUtils.test.js.map +0 -1
- package/dist/src/utils/debugLogger.test.d.ts +0 -6
- package/dist/src/utils/debugLogger.test.js +0 -69
- package/dist/src/utils/debugLogger.test.js.map +0 -1
- package/dist/src/utils/delay.test.d.ts +0 -6
- package/dist/src/utils/delay.test.js +0 -88
- package/dist/src/utils/delay.test.js.map +0 -1
- package/dist/src/utils/editCorrector.test.d.ts +0 -6
- package/dist/src/utils/editCorrector.test.js +0 -533
- package/dist/src/utils/editCorrector.test.js.map +0 -1
- package/dist/src/utils/editor.test.d.ts +0 -6
- package/dist/src/utils/editor.test.js +0 -429
- package/dist/src/utils/editor.test.js.map +0 -1
- package/dist/src/utils/environmentContext.test.d.ts +0 -6
- package/dist/src/utils/environmentContext.test.js +0 -114
- package/dist/src/utils/environmentContext.test.js.map +0 -1
- package/dist/src/utils/errorParsing.test.d.ts +0 -6
- package/dist/src/utils/errorParsing.test.js +0 -84
- package/dist/src/utils/errorParsing.test.js.map +0 -1
- package/dist/src/utils/errorReporting.test.d.ts +0 -6
- package/dist/src/utils/errorReporting.test.js +0 -133
- package/dist/src/utils/errorReporting.test.js.map +0 -1
- package/dist/src/utils/errors.test.d.ts +0 -6
- package/dist/src/utils/errors.test.js +0 -155
- package/dist/src/utils/errors.test.js.map +0 -1
- package/dist/src/utils/events.test.d.ts +0 -6
- package/dist/src/utils/events.test.js +0 -237
- package/dist/src/utils/events.test.js.map +0 -1
- package/dist/src/utils/extensionLoader.test.d.ts +0 -6
- package/dist/src/utils/extensionLoader.test.js +0 -176
- package/dist/src/utils/extensionLoader.test.js.map +0 -1
- package/dist/src/utils/fileDiffUtils.test.d.ts +0 -6
- package/dist/src/utils/fileDiffUtils.test.js +0 -84
- package/dist/src/utils/fileDiffUtils.test.js.map +0 -1
- package/dist/src/utils/fileUtils.test.d.ts +0 -6
- package/dist/src/utils/fileUtils.test.js +0 -780
- package/dist/src/utils/fileUtils.test.js.map +0 -1
- package/dist/src/utils/filesearch/crawlCache.test.d.ts +0 -6
- package/dist/src/utils/filesearch/crawlCache.test.js +0 -103
- package/dist/src/utils/filesearch/crawlCache.test.js.map +0 -1
- package/dist/src/utils/filesearch/crawler.test.d.ts +0 -6
- package/dist/src/utils/filesearch/crawler.test.js +0 -495
- package/dist/src/utils/filesearch/crawler.test.js.map +0 -1
- package/dist/src/utils/filesearch/fileSearch.test.d.ts +0 -6
- package/dist/src/utils/filesearch/fileSearch.test.js +0 -663
- package/dist/src/utils/filesearch/fileSearch.test.js.map +0 -1
- package/dist/src/utils/filesearch/ignore.test.d.ts +0 -6
- package/dist/src/utils/filesearch/ignore.test.js +0 -144
- package/dist/src/utils/filesearch/ignore.test.js.map +0 -1
- package/dist/src/utils/filesearch/result-cache.test.d.ts +0 -6
- package/dist/src/utils/filesearch/result-cache.test.js +0 -46
- package/dist/src/utils/filesearch/result-cache.test.js.map +0 -1
- package/dist/src/utils/flashFallback.test.d.ts +0 -6
- package/dist/src/utils/flashFallback.test.js +0 -103
- package/dist/src/utils/flashFallback.test.js.map +0 -1
- package/dist/src/utils/formatters.test.d.ts +0 -6
- package/dist/src/utils/formatters.test.js +0 -26
- package/dist/src/utils/formatters.test.js.map +0 -1
- package/dist/src/utils/geminiIgnoreParser.test.d.ts +0 -6
- package/dist/src/utils/geminiIgnoreParser.test.js +0 -98
- package/dist/src/utils/geminiIgnoreParser.test.js.map +0 -1
- package/dist/src/utils/geminiTypeConversion.test.d.ts +0 -6
- package/dist/src/utils/geminiTypeConversion.test.js +0 -310
- package/dist/src/utils/geminiTypeConversion.test.js.map +0 -1
- package/dist/src/utils/generateContentResponseUtilities.test.d.ts +0 -6
- package/dist/src/utils/generateContentResponseUtilities.test.js +0 -512
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +0 -1
- package/dist/src/utils/getFolderStructure.test.d.ts +0 -6
- package/dist/src/utils/getFolderStructure.test.js +0 -283
- package/dist/src/utils/getFolderStructure.test.js.map +0 -1
- package/dist/src/utils/gitIgnoreParser.test.d.ts +0 -6
- package/dist/src/utils/gitIgnoreParser.test.js +0 -243
- package/dist/src/utils/gitIgnoreParser.test.js.map +0 -1
- package/dist/src/utils/googleErrors.test.d.ts +0 -6
- package/dist/src/utils/googleErrors.test.js +0 -309
- package/dist/src/utils/googleErrors.test.js.map +0 -1
- package/dist/src/utils/googleQuotaErrors.test.d.ts +0 -6
- package/dist/src/utils/googleQuotaErrors.test.js +0 -548
- package/dist/src/utils/googleQuotaErrors.test.js.map +0 -1
- package/dist/src/utils/ignorePatterns.test.d.ts +0 -6
- package/dist/src/utils/ignorePatterns.test.js +0 -246
- package/dist/src/utils/ignorePatterns.test.js.map +0 -1
- package/dist/src/utils/installationManager.test.d.ts +0 -6
- package/dist/src/utils/installationManager.test.js +0 -93
- package/dist/src/utils/installationManager.test.js.map +0 -1
- package/dist/src/utils/llm-edit-fixer.test.d.ts +0 -6
- package/dist/src/utils/llm-edit-fixer.test.js +0 -223
- package/dist/src/utils/llm-edit-fixer.test.js.map +0 -1
- package/dist/src/utils/llmUtils.test.d.ts +0 -6
- package/dist/src/utils/llmUtils.test.js +0 -196
- package/dist/src/utils/llmUtils.test.js.map +0 -1
- package/dist/src/utils/memoryDiscovery.test.d.ts +0 -6
- package/dist/src/utils/memoryDiscovery.test.js +0 -542
- package/dist/src/utils/memoryDiscovery.test.js.map +0 -1
- package/dist/src/utils/memoryImportProcessor.test.d.ts +0 -6
- package/dist/src/utils/memoryImportProcessor.test.js +0 -581
- package/dist/src/utils/memoryImportProcessor.test.js.map +0 -1
- package/dist/src/utils/nextSpeakerChecker.test.d.ts +0 -6
- package/dist/src/utils/nextSpeakerChecker.test.js +0 -191
- package/dist/src/utils/nextSpeakerChecker.test.js.map +0 -1
- package/dist/src/utils/partUtils.test.d.ts +0 -6
- package/dist/src/utils/partUtils.test.js +0 -397
- package/dist/src/utils/partUtils.test.js.map +0 -1
- package/dist/src/utils/pathCorrector.test.d.ts +0 -6
- package/dist/src/utils/pathCorrector.test.js +0 -87
- package/dist/src/utils/pathCorrector.test.js.map +0 -1
- package/dist/src/utils/pathReader.test.d.ts +0 -6
- package/dist/src/utils/pathReader.test.js +0 -406
- package/dist/src/utils/pathReader.test.js.map +0 -1
- package/dist/src/utils/paths.test.d.ts +0 -6
- package/dist/src/utils/paths.test.js +0 -402
- package/dist/src/utils/paths.test.js.map +0 -1
- package/dist/src/utils/retry.test.d.ts +0 -6
- package/dist/src/utils/retry.test.js +0 -548
- package/dist/src/utils/retry.test.js.map +0 -1
- package/dist/src/utils/retry_llm_error.test.d.ts +0 -6
- package/dist/src/utils/retry_llm_error.test.js +0 -280
- package/dist/src/utils/retry_llm_error.test.js.map +0 -1
- package/dist/src/utils/safeJsonStringify.test.d.ts +0 -6
- package/dist/src/utils/safeJsonStringify.test.js +0 -61
- package/dist/src/utils/safeJsonStringify.test.js.map +0 -1
- package/dist/src/utils/schemaValidator.test.d.ts +0 -6
- package/dist/src/utils/schemaValidator.test.js +0 -113
- package/dist/src/utils/schemaValidator.test.js.map +0 -1
- package/dist/src/utils/secure-browser-launcher.test.d.ts +0 -6
- package/dist/src/utils/secure-browser-launcher.test.js +0 -149
- package/dist/src/utils/secure-browser-launcher.test.js.map +0 -1
- package/dist/src/utils/security.test.d.ts +0 -1
- package/dist/src/utils/security.test.js +0 -121
- package/dist/src/utils/security.test.js.map +0 -1
- package/dist/src/utils/shell-utils.integration.test.d.ts +0 -1
- package/dist/src/utils/shell-utils.integration.test.js +0 -58
- package/dist/src/utils/shell-utils.integration.test.js.map +0 -1
- package/dist/src/utils/shell-utils.test.d.ts +0 -6
- package/dist/src/utils/shell-utils.test.js +0 -437
- package/dist/src/utils/shell-utils.test.js.map +0 -1
- package/dist/src/utils/stdio.test.d.ts +0 -6
- package/dist/src/utils/stdio.test.js +0 -47
- package/dist/src/utils/stdio.test.js.map +0 -1
- package/dist/src/utils/summarizer.test.d.ts +0 -6
- package/dist/src/utils/summarizer.test.js +0 -152
- package/dist/src/utils/summarizer.test.js.map +0 -1
- package/dist/src/utils/systemEncoding.test.d.ts +0 -6
- package/dist/src/utils/systemEncoding.test.js +0 -369
- package/dist/src/utils/systemEncoding.test.js.map +0 -1
- package/dist/src/utils/terminalSerializer.test.d.ts +0 -6
- package/dist/src/utils/terminalSerializer.test.js +0 -193
- package/dist/src/utils/terminalSerializer.test.js.map +0 -1
- package/dist/src/utils/textUtils.test.d.ts +0 -6
- package/dist/src/utils/textUtils.test.js +0 -76
- package/dist/src/utils/textUtils.test.js.map +0 -1
- package/dist/src/utils/thoughtUtils.test.d.ts +0 -6
- package/dist/src/utils/thoughtUtils.test.js +0 -78
- package/dist/src/utils/thoughtUtils.test.js.map +0 -1
- package/dist/src/utils/tokenCalculation.test.d.ts +0 -6
- package/dist/src/utils/tokenCalculation.test.js +0 -184
- package/dist/src/utils/tokenCalculation.test.js.map +0 -1
- package/dist/src/utils/tool-utils.test.d.ts +0 -6
- package/dist/src/utils/tool-utils.test.js +0 -84
- package/dist/src/utils/tool-utils.test.js.map +0 -1
- package/dist/src/utils/toolCallContext.test.d.ts +0 -6
- package/dist/src/utils/toolCallContext.test.js +0 -68
- package/dist/src/utils/toolCallContext.test.js.map +0 -1
- package/dist/src/utils/userAccountManager.test.d.ts +0 -6
- package/dist/src/utils/userAccountManager.test.js +0 -225
- package/dist/src/utils/userAccountManager.test.js.map +0 -1
- package/dist/src/utils/version.test.d.ts +0 -6
- package/dist/src/utils/version.test.js +0 -39
- package/dist/src/utils/version.test.js.map +0 -1
- package/dist/src/utils/workspaceContext.test.d.ts +0 -6
- package/dist/src/utils/workspaceContext.test.js +0 -374
- package/dist/src/utils/workspaceContext.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,1139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { describe, it, expect, beforeEach, afterEach, afterAll, vi, } from 'vitest';
|
|
7
|
-
import { canUseRipgrep, RipGrepTool, ensureRgPath } from './ripGrep.js';
|
|
8
|
-
import path from 'node:path';
|
|
9
|
-
import fs from 'node:fs/promises';
|
|
10
|
-
import os from 'node:os';
|
|
11
|
-
import { Storage } from '../config/storage.js';
|
|
12
|
-
import { createMockWorkspaceContext } from '../test-utils/mockWorkspaceContext.js';
|
|
13
|
-
import { spawn } from 'node:child_process';
|
|
14
|
-
import { PassThrough, Readable } from 'node:stream';
|
|
15
|
-
import EventEmitter from 'node:events';
|
|
16
|
-
import { downloadRipGrep } from '@joshua.litt/get-ripgrep';
|
|
17
|
-
import { createMockMessageBus } from '../test-utils/mock-message-bus.js';
|
|
18
|
-
// Mock dependencies for canUseRipgrep
|
|
19
|
-
vi.mock('@joshua.litt/get-ripgrep', () => ({
|
|
20
|
-
downloadRipGrep: vi.fn(),
|
|
21
|
-
}));
|
|
22
|
-
// Mock child_process for ripgrep calls
|
|
23
|
-
vi.mock('child_process', () => ({
|
|
24
|
-
spawn: vi.fn(),
|
|
25
|
-
}));
|
|
26
|
-
const mockSpawn = vi.mocked(spawn);
|
|
27
|
-
const downloadRipGrepMock = vi.mocked(downloadRipGrep);
|
|
28
|
-
const originalGetGlobalBinDir = Storage.getGlobalBinDir.bind(Storage);
|
|
29
|
-
const storageSpy = vi.spyOn(Storage, 'getGlobalBinDir');
|
|
30
|
-
function getRipgrepBinaryName() {
|
|
31
|
-
return process.platform === 'win32' ? 'rg.exe' : 'rg';
|
|
32
|
-
}
|
|
33
|
-
describe('canUseRipgrep', () => {
|
|
34
|
-
let tempRootDir;
|
|
35
|
-
let binDir;
|
|
36
|
-
beforeEach(async () => {
|
|
37
|
-
downloadRipGrepMock.mockReset();
|
|
38
|
-
downloadRipGrepMock.mockResolvedValue(undefined);
|
|
39
|
-
tempRootDir = await fs.mkdtemp(path.join(os.tmpdir(), 'ripgrep-bin-'));
|
|
40
|
-
binDir = path.join(tempRootDir, 'bin');
|
|
41
|
-
await fs.mkdir(binDir, { recursive: true });
|
|
42
|
-
storageSpy.mockImplementation(() => binDir);
|
|
43
|
-
});
|
|
44
|
-
afterEach(async () => {
|
|
45
|
-
storageSpy.mockImplementation(() => originalGetGlobalBinDir());
|
|
46
|
-
await fs.rm(tempRootDir, { recursive: true, force: true });
|
|
47
|
-
});
|
|
48
|
-
it('should return true if ripgrep already exists', async () => {
|
|
49
|
-
const existingPath = path.join(binDir, getRipgrepBinaryName());
|
|
50
|
-
await fs.writeFile(existingPath, '');
|
|
51
|
-
const result = await canUseRipgrep();
|
|
52
|
-
expect(result).toBe(true);
|
|
53
|
-
expect(downloadRipGrepMock).not.toHaveBeenCalled();
|
|
54
|
-
});
|
|
55
|
-
it('should download ripgrep and return true if it does not exist initially', async () => {
|
|
56
|
-
const expectedPath = path.join(binDir, getRipgrepBinaryName());
|
|
57
|
-
downloadRipGrepMock.mockImplementation(async () => {
|
|
58
|
-
await fs.writeFile(expectedPath, '');
|
|
59
|
-
});
|
|
60
|
-
const result = await canUseRipgrep();
|
|
61
|
-
expect(result).toBe(true);
|
|
62
|
-
expect(downloadRipGrep).toHaveBeenCalledWith(binDir);
|
|
63
|
-
await expect(fs.access(expectedPath)).resolves.toBeUndefined();
|
|
64
|
-
});
|
|
65
|
-
it('should return false if download fails and file does not exist', async () => {
|
|
66
|
-
const result = await canUseRipgrep();
|
|
67
|
-
expect(result).toBe(false);
|
|
68
|
-
expect(downloadRipGrep).toHaveBeenCalledWith(binDir);
|
|
69
|
-
});
|
|
70
|
-
it('should propagate errors from downloadRipGrep', async () => {
|
|
71
|
-
const error = new Error('Download failed');
|
|
72
|
-
downloadRipGrepMock.mockRejectedValue(error);
|
|
73
|
-
await expect(canUseRipgrep()).rejects.toThrow(error);
|
|
74
|
-
expect(downloadRipGrep).toHaveBeenCalledWith(binDir);
|
|
75
|
-
});
|
|
76
|
-
it('should only download once when called concurrently', async () => {
|
|
77
|
-
const expectedPath = path.join(binDir, getRipgrepBinaryName());
|
|
78
|
-
downloadRipGrepMock.mockImplementation(() => new Promise((resolve, reject) => {
|
|
79
|
-
setTimeout(() => {
|
|
80
|
-
fs.writeFile(expectedPath, '')
|
|
81
|
-
.then(() => resolve())
|
|
82
|
-
.catch(reject);
|
|
83
|
-
}, 0);
|
|
84
|
-
}));
|
|
85
|
-
const firstCall = ensureRgPath();
|
|
86
|
-
const secondCall = ensureRgPath();
|
|
87
|
-
const [pathOne, pathTwo] = await Promise.all([firstCall, secondCall]);
|
|
88
|
-
expect(pathOne).toBe(expectedPath);
|
|
89
|
-
expect(pathTwo).toBe(expectedPath);
|
|
90
|
-
expect(downloadRipGrepMock).toHaveBeenCalledTimes(1);
|
|
91
|
-
await expect(fs.access(expectedPath)).resolves.toBeUndefined();
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
describe('ensureRgPath', () => {
|
|
95
|
-
let tempRootDir;
|
|
96
|
-
let binDir;
|
|
97
|
-
beforeEach(async () => {
|
|
98
|
-
downloadRipGrepMock.mockReset();
|
|
99
|
-
downloadRipGrepMock.mockResolvedValue(undefined);
|
|
100
|
-
tempRootDir = await fs.mkdtemp(path.join(os.tmpdir(), 'ripgrep-bin-'));
|
|
101
|
-
binDir = path.join(tempRootDir, 'bin');
|
|
102
|
-
await fs.mkdir(binDir, { recursive: true });
|
|
103
|
-
storageSpy.mockImplementation(() => binDir);
|
|
104
|
-
});
|
|
105
|
-
afterEach(async () => {
|
|
106
|
-
storageSpy.mockImplementation(() => originalGetGlobalBinDir());
|
|
107
|
-
await fs.rm(tempRootDir, { recursive: true, force: true });
|
|
108
|
-
});
|
|
109
|
-
it('should return rg path if ripgrep already exists', async () => {
|
|
110
|
-
const existingPath = path.join(binDir, getRipgrepBinaryName());
|
|
111
|
-
await fs.writeFile(existingPath, '');
|
|
112
|
-
const rgPath = await ensureRgPath();
|
|
113
|
-
expect(rgPath).toBe(existingPath);
|
|
114
|
-
expect(downloadRipGrep).not.toHaveBeenCalled();
|
|
115
|
-
});
|
|
116
|
-
it('should return rg path if ripgrep is downloaded successfully', async () => {
|
|
117
|
-
const expectedPath = path.join(binDir, getRipgrepBinaryName());
|
|
118
|
-
downloadRipGrepMock.mockImplementation(async () => {
|
|
119
|
-
await fs.writeFile(expectedPath, '');
|
|
120
|
-
});
|
|
121
|
-
const rgPath = await ensureRgPath();
|
|
122
|
-
expect(rgPath).toBe(expectedPath);
|
|
123
|
-
expect(downloadRipGrep).toHaveBeenCalledTimes(1);
|
|
124
|
-
await expect(fs.access(expectedPath)).resolves.toBeUndefined();
|
|
125
|
-
});
|
|
126
|
-
it('should throw an error if ripgrep cannot be used after download attempt', async () => {
|
|
127
|
-
await expect(ensureRgPath()).rejects.toThrow('Cannot use ripgrep.');
|
|
128
|
-
expect(downloadRipGrep).toHaveBeenCalledTimes(1);
|
|
129
|
-
});
|
|
130
|
-
it('should propagate errors from downloadRipGrep', async () => {
|
|
131
|
-
const error = new Error('Download failed');
|
|
132
|
-
downloadRipGrepMock.mockRejectedValue(error);
|
|
133
|
-
await expect(ensureRgPath()).rejects.toThrow(error);
|
|
134
|
-
expect(downloadRipGrep).toHaveBeenCalledWith(binDir);
|
|
135
|
-
});
|
|
136
|
-
it.runIf(process.platform === 'win32')('should detect ripgrep when only rg.exe exists on Windows', async () => {
|
|
137
|
-
const expectedRgExePath = path.join(binDir, 'rg.exe');
|
|
138
|
-
await fs.writeFile(expectedRgExePath, '');
|
|
139
|
-
const rgPath = await ensureRgPath();
|
|
140
|
-
expect(rgPath).toBe(expectedRgExePath);
|
|
141
|
-
expect(downloadRipGrep).not.toHaveBeenCalled();
|
|
142
|
-
await expect(fs.access(expectedRgExePath)).resolves.toBeUndefined();
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
// Helper function to create mock spawn implementations
|
|
146
|
-
function createMockSpawn(options = {}) {
|
|
147
|
-
const { outputData, exitCode = 0, signal } = options;
|
|
148
|
-
return () => {
|
|
149
|
-
// strict Readable implementation
|
|
150
|
-
let pushed = false;
|
|
151
|
-
const stdout = new Readable({
|
|
152
|
-
read() {
|
|
153
|
-
if (!pushed) {
|
|
154
|
-
if (outputData) {
|
|
155
|
-
this.push(outputData);
|
|
156
|
-
}
|
|
157
|
-
this.push(null); // EOF
|
|
158
|
-
pushed = true;
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
});
|
|
162
|
-
const stderr = new PassThrough();
|
|
163
|
-
const mockProcess = new EventEmitter();
|
|
164
|
-
mockProcess.stdout = stdout;
|
|
165
|
-
mockProcess.stderr = stderr;
|
|
166
|
-
mockProcess.kill = vi.fn();
|
|
167
|
-
// @ts-expect-error - mocking private/internal property
|
|
168
|
-
mockProcess.killed = false;
|
|
169
|
-
// @ts-expect-error - mocking private/internal property
|
|
170
|
-
mockProcess.exitCode = null;
|
|
171
|
-
// Emulating process exit
|
|
172
|
-
setTimeout(() => {
|
|
173
|
-
mockProcess.emit('close', exitCode, signal);
|
|
174
|
-
}, 10);
|
|
175
|
-
return mockProcess;
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
describe('RipGrepTool', () => {
|
|
179
|
-
let tempRootDir;
|
|
180
|
-
let tempBinRoot;
|
|
181
|
-
let binDir;
|
|
182
|
-
let ripgrepBinaryPath;
|
|
183
|
-
let grepTool;
|
|
184
|
-
const abortSignal = new AbortController().signal;
|
|
185
|
-
const mockConfig = {
|
|
186
|
-
getTargetDir: () => tempRootDir,
|
|
187
|
-
getWorkspaceContext: () => createMockWorkspaceContext(tempRootDir),
|
|
188
|
-
getDebugMode: () => false,
|
|
189
|
-
getFileFilteringRespectGeminiIgnore: () => true,
|
|
190
|
-
};
|
|
191
|
-
beforeEach(async () => {
|
|
192
|
-
downloadRipGrepMock.mockReset();
|
|
193
|
-
downloadRipGrepMock.mockResolvedValue(undefined);
|
|
194
|
-
mockSpawn.mockReset();
|
|
195
|
-
tempBinRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'ripgrep-bin-'));
|
|
196
|
-
binDir = path.join(tempBinRoot, 'bin');
|
|
197
|
-
await fs.mkdir(binDir, { recursive: true });
|
|
198
|
-
const binaryName = process.platform === 'win32' ? 'rg.exe' : 'rg';
|
|
199
|
-
ripgrepBinaryPath = path.join(binDir, binaryName);
|
|
200
|
-
await fs.writeFile(ripgrepBinaryPath, '');
|
|
201
|
-
storageSpy.mockImplementation(() => binDir);
|
|
202
|
-
tempRootDir = await fs.mkdtemp(path.join(os.tmpdir(), 'grep-tool-root-'));
|
|
203
|
-
grepTool = new RipGrepTool(mockConfig, createMockMessageBus());
|
|
204
|
-
// Create some test files and directories
|
|
205
|
-
await fs.writeFile(path.join(tempRootDir, 'fileA.txt'), 'hello world\nsecond line with world');
|
|
206
|
-
await fs.writeFile(path.join(tempRootDir, 'fileB.js'), 'const foo = "bar";\nfunction baz() { return "hello"; }');
|
|
207
|
-
await fs.mkdir(path.join(tempRootDir, 'sub'));
|
|
208
|
-
await fs.writeFile(path.join(tempRootDir, 'sub', 'fileC.txt'), 'another world in sub dir');
|
|
209
|
-
await fs.writeFile(path.join(tempRootDir, 'sub', 'fileD.md'), '# Markdown file\nThis is a test.');
|
|
210
|
-
});
|
|
211
|
-
afterEach(async () => {
|
|
212
|
-
storageSpy.mockImplementation(() => originalGetGlobalBinDir());
|
|
213
|
-
await fs.rm(tempRootDir, { recursive: true, force: true });
|
|
214
|
-
await fs.rm(tempBinRoot, { recursive: true, force: true });
|
|
215
|
-
});
|
|
216
|
-
describe('validateToolParams', () => {
|
|
217
|
-
it.each([
|
|
218
|
-
{
|
|
219
|
-
name: 'pattern only',
|
|
220
|
-
params: { pattern: 'hello' },
|
|
221
|
-
expected: null,
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: 'pattern and path',
|
|
225
|
-
params: { pattern: 'hello', dir_path: '.' },
|
|
226
|
-
expected: null,
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
name: 'pattern, path, and include',
|
|
230
|
-
params: { pattern: 'hello', dir_path: '.', include: '*.txt' },
|
|
231
|
-
expected: null,
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
name: 'invalid regex pattern',
|
|
235
|
-
params: { pattern: '[[' },
|
|
236
|
-
expected: null,
|
|
237
|
-
},
|
|
238
|
-
])('should return null for valid params ($name)', ({ params, expected }) => {
|
|
239
|
-
expect(grepTool.validateToolParams(params)).toBe(expected);
|
|
240
|
-
});
|
|
241
|
-
it('should return error if pattern is missing', () => {
|
|
242
|
-
const params = { dir_path: '.' };
|
|
243
|
-
expect(grepTool.validateToolParams(params)).toBe(`params must have required property 'pattern'`);
|
|
244
|
-
});
|
|
245
|
-
it('should return error if path does not exist', () => {
|
|
246
|
-
const params = {
|
|
247
|
-
pattern: 'hello',
|
|
248
|
-
dir_path: 'nonexistent',
|
|
249
|
-
};
|
|
250
|
-
// Check for the core error message, as the full path might vary
|
|
251
|
-
expect(grepTool.validateToolParams(params)).toContain('Path does not exist');
|
|
252
|
-
expect(grepTool.validateToolParams(params)).toContain('nonexistent');
|
|
253
|
-
});
|
|
254
|
-
it('should allow path to be a file', async () => {
|
|
255
|
-
const filePath = path.join(tempRootDir, 'fileA.txt');
|
|
256
|
-
const params = {
|
|
257
|
-
pattern: 'hello',
|
|
258
|
-
dir_path: filePath,
|
|
259
|
-
};
|
|
260
|
-
expect(grepTool.validateToolParams(params)).toBeNull();
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
describe('execute', () => {
|
|
264
|
-
it('should find matches for a simple pattern in all files', async () => {
|
|
265
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
266
|
-
outputData: JSON.stringify({
|
|
267
|
-
type: 'match',
|
|
268
|
-
data: {
|
|
269
|
-
path: { text: 'fileA.txt' },
|
|
270
|
-
line_number: 1,
|
|
271
|
-
lines: { text: 'hello world\n' },
|
|
272
|
-
},
|
|
273
|
-
}) +
|
|
274
|
-
'\n' +
|
|
275
|
-
JSON.stringify({
|
|
276
|
-
type: 'match',
|
|
277
|
-
data: {
|
|
278
|
-
path: { text: 'fileA.txt' },
|
|
279
|
-
line_number: 2,
|
|
280
|
-
lines: { text: 'second line with world\n' },
|
|
281
|
-
},
|
|
282
|
-
}) +
|
|
283
|
-
'\n' +
|
|
284
|
-
JSON.stringify({
|
|
285
|
-
type: 'match',
|
|
286
|
-
data: {
|
|
287
|
-
path: { text: 'sub/fileC.txt' },
|
|
288
|
-
line_number: 1,
|
|
289
|
-
lines: { text: 'another world in sub dir\n' },
|
|
290
|
-
},
|
|
291
|
-
}) +
|
|
292
|
-
'\n',
|
|
293
|
-
exitCode: 0,
|
|
294
|
-
}));
|
|
295
|
-
const params = { pattern: 'world' };
|
|
296
|
-
const invocation = grepTool.build(params);
|
|
297
|
-
const result = await invocation.execute(abortSignal);
|
|
298
|
-
expect(result.llmContent).toContain('Found 3 matches for pattern "world" in path "."');
|
|
299
|
-
expect(result.llmContent).toContain('File: fileA.txt');
|
|
300
|
-
expect(result.llmContent).toContain('L1: hello world');
|
|
301
|
-
expect(result.llmContent).toContain('L2: second line with world');
|
|
302
|
-
expect(result.llmContent).toContain(`File: ${path.join('sub', 'fileC.txt')}`);
|
|
303
|
-
expect(result.llmContent).toContain('L1: another world in sub dir');
|
|
304
|
-
expect(result.returnDisplay).toBe('Found 3 matches');
|
|
305
|
-
});
|
|
306
|
-
it('should ignore matches that escape the base path', async () => {
|
|
307
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
308
|
-
outputData: JSON.stringify({
|
|
309
|
-
type: 'match',
|
|
310
|
-
data: {
|
|
311
|
-
path: { text: '..env' },
|
|
312
|
-
line_number: 1,
|
|
313
|
-
lines: { text: 'world in ..env\n' },
|
|
314
|
-
},
|
|
315
|
-
}) +
|
|
316
|
-
'\n' +
|
|
317
|
-
JSON.stringify({
|
|
318
|
-
type: 'match',
|
|
319
|
-
data: {
|
|
320
|
-
path: { text: '../secret.txt' },
|
|
321
|
-
line_number: 1,
|
|
322
|
-
lines: { text: 'leak\n' },
|
|
323
|
-
},
|
|
324
|
-
}) +
|
|
325
|
-
'\n',
|
|
326
|
-
exitCode: 0,
|
|
327
|
-
}));
|
|
328
|
-
const params = { pattern: 'world' };
|
|
329
|
-
const invocation = grepTool.build(params);
|
|
330
|
-
const result = await invocation.execute(abortSignal);
|
|
331
|
-
expect(result.llmContent).toContain('File: ..env');
|
|
332
|
-
expect(result.llmContent).toContain('L1: world in ..env');
|
|
333
|
-
expect(result.llmContent).not.toContain('secret.txt');
|
|
334
|
-
});
|
|
335
|
-
it('should find matches in a specific path', async () => {
|
|
336
|
-
// Setup specific mock for this test - searching in 'sub' should only return matches from that directory
|
|
337
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
338
|
-
outputData: JSON.stringify({
|
|
339
|
-
type: 'match',
|
|
340
|
-
data: {
|
|
341
|
-
path: { text: 'fileC.txt' },
|
|
342
|
-
line_number: 1,
|
|
343
|
-
lines: { text: 'another world in sub dir\n' },
|
|
344
|
-
},
|
|
345
|
-
}) + '\n',
|
|
346
|
-
exitCode: 0,
|
|
347
|
-
}));
|
|
348
|
-
const params = { pattern: 'world', dir_path: 'sub' };
|
|
349
|
-
const invocation = grepTool.build(params);
|
|
350
|
-
const result = await invocation.execute(abortSignal);
|
|
351
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "world" in path "sub"');
|
|
352
|
-
expect(result.llmContent).toContain('File: fileC.txt'); // Path relative to 'sub'
|
|
353
|
-
expect(result.llmContent).toContain('L1: another world in sub dir');
|
|
354
|
-
expect(result.returnDisplay).toBe('Found 1 match');
|
|
355
|
-
});
|
|
356
|
-
it('should find matches with an include glob', async () => {
|
|
357
|
-
// Setup specific mock for this test
|
|
358
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
359
|
-
outputData: JSON.stringify({
|
|
360
|
-
type: 'match',
|
|
361
|
-
data: {
|
|
362
|
-
path: { text: 'fileB.js' },
|
|
363
|
-
line_number: 2,
|
|
364
|
-
lines: { text: 'function baz() { return "hello"; }\n' },
|
|
365
|
-
},
|
|
366
|
-
}) + '\n',
|
|
367
|
-
exitCode: 0,
|
|
368
|
-
}));
|
|
369
|
-
const params = { pattern: 'hello', include: '*.js' };
|
|
370
|
-
const invocation = grepTool.build(params);
|
|
371
|
-
const result = await invocation.execute(abortSignal);
|
|
372
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "hello" in path "." (filter: "*.js"):');
|
|
373
|
-
expect(result.llmContent).toContain('File: fileB.js');
|
|
374
|
-
expect(result.llmContent).toContain('L2: function baz() { return "hello"; }');
|
|
375
|
-
expect(result.returnDisplay).toBe('Found 1 match');
|
|
376
|
-
});
|
|
377
|
-
it('should find matches with an include glob and path', async () => {
|
|
378
|
-
await fs.writeFile(path.join(tempRootDir, 'sub', 'another.js'), 'const greeting = "hello";');
|
|
379
|
-
// Setup specific mock for this test - searching for 'hello' in 'sub' with '*.js' filter
|
|
380
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
381
|
-
outputData: JSON.stringify({
|
|
382
|
-
type: 'match',
|
|
383
|
-
data: {
|
|
384
|
-
path: { text: 'another.js' },
|
|
385
|
-
line_number: 1,
|
|
386
|
-
lines: { text: 'const greeting = "hello";\n' },
|
|
387
|
-
},
|
|
388
|
-
}) + '\n',
|
|
389
|
-
exitCode: 0,
|
|
390
|
-
}));
|
|
391
|
-
const params = {
|
|
392
|
-
pattern: 'hello',
|
|
393
|
-
dir_path: 'sub',
|
|
394
|
-
include: '*.js',
|
|
395
|
-
};
|
|
396
|
-
const invocation = grepTool.build(params);
|
|
397
|
-
const result = await invocation.execute(abortSignal);
|
|
398
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "hello" in path "sub" (filter: "*.js")');
|
|
399
|
-
expect(result.llmContent).toContain('File: another.js');
|
|
400
|
-
expect(result.llmContent).toContain('L1: const greeting = "hello";');
|
|
401
|
-
expect(result.returnDisplay).toBe('Found 1 match');
|
|
402
|
-
});
|
|
403
|
-
it('should return "No matches found" when pattern does not exist', async () => {
|
|
404
|
-
// Setup specific mock for no matches
|
|
405
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
406
|
-
exitCode: 1, // No matches found
|
|
407
|
-
}));
|
|
408
|
-
const params = { pattern: 'nonexistentpattern' };
|
|
409
|
-
const invocation = grepTool.build(params);
|
|
410
|
-
const result = await invocation.execute(abortSignal);
|
|
411
|
-
expect(result.llmContent).toContain('No matches found for pattern "nonexistentpattern" in path ".".');
|
|
412
|
-
expect(result.returnDisplay).toBe('No matches found');
|
|
413
|
-
});
|
|
414
|
-
it('should return an error from ripgrep for invalid regex pattern', async () => {
|
|
415
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
416
|
-
exitCode: 2,
|
|
417
|
-
}));
|
|
418
|
-
const params = { pattern: '[[' };
|
|
419
|
-
const invocation = grepTool.build(params);
|
|
420
|
-
const result = await invocation.execute(abortSignal);
|
|
421
|
-
expect(result.llmContent).toContain('Process exited with code 2');
|
|
422
|
-
expect(result.returnDisplay).toContain('Error: Process exited with code 2');
|
|
423
|
-
});
|
|
424
|
-
it('should ignore invalid regex error from ripgrep when it is not a user error', async () => {
|
|
425
|
-
mockSpawn.mockImplementation(createMockSpawn({
|
|
426
|
-
outputData: '',
|
|
427
|
-
exitCode: 2,
|
|
428
|
-
signal: undefined,
|
|
429
|
-
}));
|
|
430
|
-
const invocation = grepTool.build({
|
|
431
|
-
pattern: 'foo',
|
|
432
|
-
dir_path: tempRootDir,
|
|
433
|
-
});
|
|
434
|
-
const result = await invocation.execute(abortSignal);
|
|
435
|
-
expect(result.llmContent).toContain('Process exited with code 2');
|
|
436
|
-
expect(result.returnDisplay).toContain('Error: Process exited with code 2');
|
|
437
|
-
});
|
|
438
|
-
it('should handle massive output by terminating early without crashing (Regression)', async () => {
|
|
439
|
-
const massiveOutputLines = 30000;
|
|
440
|
-
// Custom mock for massive streaming
|
|
441
|
-
mockSpawn.mockImplementation(() => {
|
|
442
|
-
const stdout = new PassThrough();
|
|
443
|
-
const stderr = new PassThrough();
|
|
444
|
-
const mockProcess = new EventEmitter();
|
|
445
|
-
mockProcess.stdout = stdout;
|
|
446
|
-
mockProcess.stderr = stderr;
|
|
447
|
-
mockProcess.kill = vi.fn();
|
|
448
|
-
// @ts-expect-error - mocking private/internal property
|
|
449
|
-
mockProcess.killed = false;
|
|
450
|
-
// @ts-expect-error - mocking private/internal property
|
|
451
|
-
mockProcess.exitCode = null;
|
|
452
|
-
// Push data over time
|
|
453
|
-
let linesPushed = 0;
|
|
454
|
-
const pushInterval = setInterval(() => {
|
|
455
|
-
if (linesPushed >= massiveOutputLines) {
|
|
456
|
-
clearInterval(pushInterval);
|
|
457
|
-
stdout.end();
|
|
458
|
-
mockProcess.emit('close', 0);
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
// Push a batch
|
|
462
|
-
try {
|
|
463
|
-
for (let i = 0; i < 2000 && linesPushed < massiveOutputLines; i++) {
|
|
464
|
-
const match = JSON.stringify({
|
|
465
|
-
type: 'match',
|
|
466
|
-
data: {
|
|
467
|
-
path: { text: `file_${linesPushed}.txt` },
|
|
468
|
-
line_number: 1,
|
|
469
|
-
lines: { text: `match ${linesPushed}\n` },
|
|
470
|
-
},
|
|
471
|
-
});
|
|
472
|
-
stdout.write(match + '\n');
|
|
473
|
-
linesPushed++;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
catch (_e) {
|
|
477
|
-
clearInterval(pushInterval);
|
|
478
|
-
}
|
|
479
|
-
}, 1);
|
|
480
|
-
mockProcess.kill = vi.fn().mockImplementation(() => {
|
|
481
|
-
clearInterval(pushInterval);
|
|
482
|
-
stdout.end();
|
|
483
|
-
// Emit close async to allow listeners to attach
|
|
484
|
-
setTimeout(() => mockProcess.emit('close', 0, 'SIGTERM'), 0);
|
|
485
|
-
return true;
|
|
486
|
-
});
|
|
487
|
-
return mockProcess;
|
|
488
|
-
});
|
|
489
|
-
const invocation = grepTool.build({
|
|
490
|
-
pattern: 'test',
|
|
491
|
-
dir_path: tempRootDir,
|
|
492
|
-
});
|
|
493
|
-
const result = await invocation.execute(abortSignal);
|
|
494
|
-
expect(result.returnDisplay).toContain('(limited)');
|
|
495
|
-
}, 10000);
|
|
496
|
-
it('should handle regex special characters correctly', async () => {
|
|
497
|
-
// Setup specific mock for this test - regex pattern 'foo.*bar' should match 'const foo = "bar";'
|
|
498
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
499
|
-
outputData: JSON.stringify({
|
|
500
|
-
type: 'match',
|
|
501
|
-
data: {
|
|
502
|
-
path: { text: 'fileB.js' },
|
|
503
|
-
line_number: 1,
|
|
504
|
-
lines: { text: 'const foo = "bar";\n' },
|
|
505
|
-
},
|
|
506
|
-
}) + '\n',
|
|
507
|
-
exitCode: 0,
|
|
508
|
-
}));
|
|
509
|
-
const params = { pattern: 'foo.*bar' }; // Matches 'const foo = "bar";'
|
|
510
|
-
const invocation = grepTool.build(params);
|
|
511
|
-
const result = await invocation.execute(abortSignal);
|
|
512
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "foo.*bar" in path ".":');
|
|
513
|
-
expect(result.llmContent).toContain('File: fileB.js');
|
|
514
|
-
expect(result.llmContent).toContain('L1: const foo = "bar";');
|
|
515
|
-
});
|
|
516
|
-
it('should be case-insensitive by default (JS fallback)', async () => {
|
|
517
|
-
// Setup specific mock for this test - case insensitive search for 'HELLO'
|
|
518
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
519
|
-
outputData: JSON.stringify({
|
|
520
|
-
type: 'match',
|
|
521
|
-
data: {
|
|
522
|
-
path: { text: 'fileA.txt' },
|
|
523
|
-
line_number: 1,
|
|
524
|
-
lines: { text: 'hello world\n' },
|
|
525
|
-
},
|
|
526
|
-
}) +
|
|
527
|
-
'\n' +
|
|
528
|
-
JSON.stringify({
|
|
529
|
-
type: 'match',
|
|
530
|
-
data: {
|
|
531
|
-
path: { text: 'fileB.js' },
|
|
532
|
-
line_number: 2,
|
|
533
|
-
lines: { text: 'function baz() { return "hello"; }\n' },
|
|
534
|
-
},
|
|
535
|
-
}) +
|
|
536
|
-
'\n',
|
|
537
|
-
exitCode: 0,
|
|
538
|
-
}));
|
|
539
|
-
const params = { pattern: 'HELLO' };
|
|
540
|
-
const invocation = grepTool.build(params);
|
|
541
|
-
const result = await invocation.execute(abortSignal);
|
|
542
|
-
expect(result.llmContent).toContain('Found 2 matches for pattern "HELLO" in path ".":');
|
|
543
|
-
expect(result.llmContent).toContain('File: fileA.txt');
|
|
544
|
-
expect(result.llmContent).toContain('L1: hello world');
|
|
545
|
-
expect(result.llmContent).toContain('File: fileB.js');
|
|
546
|
-
expect(result.llmContent).toContain('L2: function baz() { return "hello"; }');
|
|
547
|
-
});
|
|
548
|
-
it('should throw an error if params are invalid', async () => {
|
|
549
|
-
const params = { dir_path: '.' }; // Invalid: pattern missing
|
|
550
|
-
expect(() => grepTool.build(params)).toThrow(/params must have required property 'pattern'/);
|
|
551
|
-
});
|
|
552
|
-
it('should throw an error if ripgrep is not available', async () => {
|
|
553
|
-
await fs.rm(ripgrepBinaryPath, { force: true });
|
|
554
|
-
downloadRipGrepMock.mockResolvedValue(undefined);
|
|
555
|
-
const params = { pattern: 'world' };
|
|
556
|
-
const invocation = grepTool.build(params);
|
|
557
|
-
expect(await invocation.execute(abortSignal)).toStrictEqual({
|
|
558
|
-
llmContent: 'Error during grep search operation: Cannot use ripgrep.',
|
|
559
|
-
returnDisplay: 'Error: Cannot use ripgrep.',
|
|
560
|
-
});
|
|
561
|
-
});
|
|
562
|
-
});
|
|
563
|
-
describe('multi-directory workspace', () => {
|
|
564
|
-
it('should search only CWD when no path is specified (default behavior)', async () => {
|
|
565
|
-
// Create additional directory with test files
|
|
566
|
-
const secondDir = await fs.mkdtemp(path.join(os.tmpdir(), 'grep-tool-second-'));
|
|
567
|
-
await fs.writeFile(path.join(secondDir, 'other.txt'), 'hello from second directory\nworld in second');
|
|
568
|
-
await fs.writeFile(path.join(secondDir, 'another.js'), 'function world() { return "test"; }');
|
|
569
|
-
// Create a mock config with multiple directories
|
|
570
|
-
const multiDirConfig = {
|
|
571
|
-
getTargetDir: () => tempRootDir,
|
|
572
|
-
getWorkspaceContext: () => createMockWorkspaceContext(tempRootDir, [secondDir]),
|
|
573
|
-
getDebugMode: () => false,
|
|
574
|
-
getFileFilteringRespectGeminiIgnore: () => true,
|
|
575
|
-
};
|
|
576
|
-
// Setup specific mock for this test - multi-directory search for 'world'
|
|
577
|
-
// Mock will be called twice - once for each directory
|
|
578
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
579
|
-
outputData: JSON.stringify({
|
|
580
|
-
type: 'match',
|
|
581
|
-
data: {
|
|
582
|
-
path: { text: 'fileA.txt' },
|
|
583
|
-
line_number: 1,
|
|
584
|
-
lines: { text: 'hello world\n' },
|
|
585
|
-
},
|
|
586
|
-
}) +
|
|
587
|
-
'\n' +
|
|
588
|
-
JSON.stringify({
|
|
589
|
-
type: 'match',
|
|
590
|
-
data: {
|
|
591
|
-
path: { text: 'fileA.txt' },
|
|
592
|
-
line_number: 2,
|
|
593
|
-
lines: { text: 'second line with world\n' },
|
|
594
|
-
},
|
|
595
|
-
}) +
|
|
596
|
-
'\n' +
|
|
597
|
-
JSON.stringify({
|
|
598
|
-
type: 'match',
|
|
599
|
-
data: {
|
|
600
|
-
path: { text: 'sub/fileC.txt' },
|
|
601
|
-
line_number: 1,
|
|
602
|
-
lines: { text: 'another world in sub dir\n' },
|
|
603
|
-
},
|
|
604
|
-
}) +
|
|
605
|
-
'\n',
|
|
606
|
-
}));
|
|
607
|
-
const multiDirGrepTool = new RipGrepTool(multiDirConfig, createMockMessageBus());
|
|
608
|
-
const params = { pattern: 'world' };
|
|
609
|
-
const invocation = multiDirGrepTool.build(params);
|
|
610
|
-
const result = await invocation.execute(abortSignal);
|
|
611
|
-
// Should find matches in CWD only (default behavior now)
|
|
612
|
-
expect(result.llmContent).toContain('Found 3 matches for pattern "world" in path "."');
|
|
613
|
-
// Matches from first directory
|
|
614
|
-
expect(result.llmContent).toContain('fileA.txt');
|
|
615
|
-
expect(result.llmContent).toContain('L1: hello world');
|
|
616
|
-
expect(result.llmContent).toContain('L2: second line with world');
|
|
617
|
-
expect(result.llmContent).toContain('fileC.txt');
|
|
618
|
-
expect(result.llmContent).toContain('L1: another world in sub dir');
|
|
619
|
-
// Should NOT find matches from second directory
|
|
620
|
-
expect(result.llmContent).not.toContain('other.txt');
|
|
621
|
-
expect(result.llmContent).not.toContain('world in second');
|
|
622
|
-
expect(result.llmContent).not.toContain('another.js');
|
|
623
|
-
expect(result.llmContent).not.toContain('function world()');
|
|
624
|
-
// Clean up
|
|
625
|
-
await fs.rm(secondDir, { recursive: true, force: true });
|
|
626
|
-
mockSpawn.mockClear();
|
|
627
|
-
});
|
|
628
|
-
it('should search only specified path within workspace directories', async () => {
|
|
629
|
-
// Create additional directory
|
|
630
|
-
const secondDir = await fs.mkdtemp(path.join(os.tmpdir(), 'grep-tool-second-'));
|
|
631
|
-
await fs.mkdir(path.join(secondDir, 'sub'));
|
|
632
|
-
await fs.writeFile(path.join(secondDir, 'sub', 'test.txt'), 'hello from second sub directory');
|
|
633
|
-
// Create a mock config with multiple directories
|
|
634
|
-
const multiDirConfig = {
|
|
635
|
-
getTargetDir: () => tempRootDir,
|
|
636
|
-
getWorkspaceContext: () => createMockWorkspaceContext(tempRootDir, [secondDir]),
|
|
637
|
-
getDebugMode: () => false,
|
|
638
|
-
getFileFilteringRespectGeminiIgnore: () => true,
|
|
639
|
-
};
|
|
640
|
-
// Setup specific mock for this test - searching in 'sub' should only return matches from that directory
|
|
641
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
642
|
-
outputData: JSON.stringify({
|
|
643
|
-
type: 'match',
|
|
644
|
-
data: {
|
|
645
|
-
path: { text: 'fileC.txt' },
|
|
646
|
-
line_number: 1,
|
|
647
|
-
lines: { text: 'another world in sub dir\n' },
|
|
648
|
-
},
|
|
649
|
-
}) + '\n',
|
|
650
|
-
}));
|
|
651
|
-
const multiDirGrepTool = new RipGrepTool(multiDirConfig, createMockMessageBus());
|
|
652
|
-
// Search only in the 'sub' directory of the first workspace
|
|
653
|
-
const params = { pattern: 'world', dir_path: 'sub' };
|
|
654
|
-
const invocation = multiDirGrepTool.build(params);
|
|
655
|
-
const result = await invocation.execute(abortSignal);
|
|
656
|
-
// Should only find matches in the specified sub directory
|
|
657
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "world" in path "sub"');
|
|
658
|
-
expect(result.llmContent).toContain('File: fileC.txt');
|
|
659
|
-
expect(result.llmContent).toContain('L1: another world in sub dir');
|
|
660
|
-
// Should not contain matches from second directory
|
|
661
|
-
expect(result.llmContent).not.toContain('test.txt');
|
|
662
|
-
// Clean up
|
|
663
|
-
await fs.rm(secondDir, { recursive: true, force: true });
|
|
664
|
-
});
|
|
665
|
-
});
|
|
666
|
-
describe('abort signal handling', () => {
|
|
667
|
-
it('should handle AbortSignal during search', async () => {
|
|
668
|
-
const controller = new AbortController();
|
|
669
|
-
const params = { pattern: 'world' };
|
|
670
|
-
const invocation = grepTool.build(params);
|
|
671
|
-
controller.abort();
|
|
672
|
-
const result = await invocation.execute(controller.signal);
|
|
673
|
-
expect(result).toBeDefined();
|
|
674
|
-
});
|
|
675
|
-
it('should abort streaming search when signal is triggered', async () => {
|
|
676
|
-
// Setup specific mock for this test - simulate process being killed due to abort
|
|
677
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
678
|
-
exitCode: null,
|
|
679
|
-
signal: 'SIGTERM',
|
|
680
|
-
}));
|
|
681
|
-
const controller = new AbortController();
|
|
682
|
-
const params = { pattern: 'test' };
|
|
683
|
-
const invocation = grepTool.build(params);
|
|
684
|
-
// Abort immediately before starting the search
|
|
685
|
-
controller.abort();
|
|
686
|
-
const result = await invocation.execute(controller.signal);
|
|
687
|
-
expect(result.returnDisplay).toContain('No matches found');
|
|
688
|
-
});
|
|
689
|
-
});
|
|
690
|
-
describe('error handling and edge cases', () => {
|
|
691
|
-
it('should handle workspace boundary violations', () => {
|
|
692
|
-
const params = {
|
|
693
|
-
pattern: 'test',
|
|
694
|
-
dir_path: '../outside',
|
|
695
|
-
};
|
|
696
|
-
expect(() => grepTool.build(params)).toThrow(/Path validation failed/);
|
|
697
|
-
});
|
|
698
|
-
it.each([
|
|
699
|
-
{
|
|
700
|
-
name: 'empty directories',
|
|
701
|
-
setup: async () => {
|
|
702
|
-
const emptyDir = path.join(tempRootDir, 'empty');
|
|
703
|
-
await fs.mkdir(emptyDir);
|
|
704
|
-
return { pattern: 'test', dir_path: 'empty' };
|
|
705
|
-
},
|
|
706
|
-
},
|
|
707
|
-
{
|
|
708
|
-
name: 'empty files',
|
|
709
|
-
setup: async () => {
|
|
710
|
-
await fs.writeFile(path.join(tempRootDir, 'empty.txt'), '');
|
|
711
|
-
return { pattern: 'anything' };
|
|
712
|
-
},
|
|
713
|
-
},
|
|
714
|
-
])('should handle $name gracefully', async ({ setup }) => {
|
|
715
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({ exitCode: 1 }));
|
|
716
|
-
const params = await setup();
|
|
717
|
-
const invocation = grepTool.build(params);
|
|
718
|
-
const result = await invocation.execute(abortSignal);
|
|
719
|
-
expect(result.llmContent).toContain('No matches found');
|
|
720
|
-
});
|
|
721
|
-
it('should handle special characters in file names', async () => {
|
|
722
|
-
const specialFileName = 'file with spaces & symbols!.txt';
|
|
723
|
-
await fs.writeFile(path.join(tempRootDir, specialFileName), 'hello world with special chars');
|
|
724
|
-
// Setup specific mock for this test - searching for 'world' should find the file with special characters
|
|
725
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
726
|
-
outputData: JSON.stringify({
|
|
727
|
-
type: 'match',
|
|
728
|
-
data: {
|
|
729
|
-
path: { text: specialFileName },
|
|
730
|
-
line_number: 1,
|
|
731
|
-
lines: { text: 'hello world with special chars\n' },
|
|
732
|
-
},
|
|
733
|
-
}) + '\n',
|
|
734
|
-
}));
|
|
735
|
-
const params = { pattern: 'world' };
|
|
736
|
-
const invocation = grepTool.build(params);
|
|
737
|
-
const result = await invocation.execute(abortSignal);
|
|
738
|
-
expect(result.llmContent).toContain(specialFileName);
|
|
739
|
-
expect(result.llmContent).toContain('hello world with special chars');
|
|
740
|
-
});
|
|
741
|
-
it('should handle deeply nested directories', async () => {
|
|
742
|
-
const deepPath = path.join(tempRootDir, 'a', 'b', 'c', 'd', 'e');
|
|
743
|
-
await fs.mkdir(deepPath, { recursive: true });
|
|
744
|
-
await fs.writeFile(path.join(deepPath, 'deep.txt'), 'content in deep directory');
|
|
745
|
-
// Setup specific mock for this test - searching for 'deep' should find the deeply nested file
|
|
746
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
747
|
-
outputData: JSON.stringify({
|
|
748
|
-
type: 'match',
|
|
749
|
-
data: {
|
|
750
|
-
path: { text: 'a/b/c/d/e/deep.txt' },
|
|
751
|
-
line_number: 1,
|
|
752
|
-
lines: { text: 'content in deep directory\n' },
|
|
753
|
-
},
|
|
754
|
-
}) + '\n',
|
|
755
|
-
}));
|
|
756
|
-
const params = { pattern: 'deep' };
|
|
757
|
-
const invocation = grepTool.build(params);
|
|
758
|
-
const result = await invocation.execute(abortSignal);
|
|
759
|
-
expect(result.llmContent).toContain('deep.txt');
|
|
760
|
-
expect(result.llmContent).toContain('content in deep directory');
|
|
761
|
-
});
|
|
762
|
-
});
|
|
763
|
-
describe('regex pattern validation', () => {
|
|
764
|
-
it('should handle complex regex patterns', async () => {
|
|
765
|
-
await fs.writeFile(path.join(tempRootDir, 'code.js'), 'function getName() { return "test"; }\nconst getValue = () => "value";');
|
|
766
|
-
// Setup specific mock for this test - regex pattern should match function declarations
|
|
767
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
768
|
-
outputData: JSON.stringify({
|
|
769
|
-
type: 'match',
|
|
770
|
-
data: {
|
|
771
|
-
path: { text: 'code.js' },
|
|
772
|
-
line_number: 1,
|
|
773
|
-
lines: { text: 'function getName() { return "test"; }\n' },
|
|
774
|
-
},
|
|
775
|
-
}) + '\n',
|
|
776
|
-
}));
|
|
777
|
-
const params = { pattern: 'function\\s+\\w+\\s*\\(' };
|
|
778
|
-
const invocation = grepTool.build(params);
|
|
779
|
-
const result = await invocation.execute(abortSignal);
|
|
780
|
-
expect(result.llmContent).toContain('function getName()');
|
|
781
|
-
expect(result.llmContent).not.toContain('const getValue');
|
|
782
|
-
});
|
|
783
|
-
it('should handle case sensitivity correctly in JS fallback', async () => {
|
|
784
|
-
await fs.writeFile(path.join(tempRootDir, 'case.txt'), 'Hello World\nhello world\nHELLO WORLD');
|
|
785
|
-
// Setup specific mock for this test - case insensitive search should match all variants
|
|
786
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
787
|
-
outputData: JSON.stringify({
|
|
788
|
-
type: 'match',
|
|
789
|
-
data: {
|
|
790
|
-
path: { text: 'case.txt' },
|
|
791
|
-
line_number: 1,
|
|
792
|
-
lines: { text: 'Hello World\n' },
|
|
793
|
-
},
|
|
794
|
-
}) +
|
|
795
|
-
'\n' +
|
|
796
|
-
JSON.stringify({
|
|
797
|
-
type: 'match',
|
|
798
|
-
data: {
|
|
799
|
-
path: { text: 'case.txt' },
|
|
800
|
-
line_number: 2,
|
|
801
|
-
lines: { text: 'hello world\n' },
|
|
802
|
-
},
|
|
803
|
-
}) +
|
|
804
|
-
'\n' +
|
|
805
|
-
JSON.stringify({
|
|
806
|
-
type: 'match',
|
|
807
|
-
data: {
|
|
808
|
-
path: { text: 'case.txt' },
|
|
809
|
-
line_number: 3,
|
|
810
|
-
lines: { text: 'HELLO WORLD\n' },
|
|
811
|
-
},
|
|
812
|
-
}) +
|
|
813
|
-
'\n',
|
|
814
|
-
}));
|
|
815
|
-
const params = { pattern: 'hello' };
|
|
816
|
-
const invocation = grepTool.build(params);
|
|
817
|
-
const result = await invocation.execute(abortSignal);
|
|
818
|
-
expect(result.llmContent).toContain('Hello World');
|
|
819
|
-
expect(result.llmContent).toContain('hello world');
|
|
820
|
-
expect(result.llmContent).toContain('HELLO WORLD');
|
|
821
|
-
});
|
|
822
|
-
it('should handle escaped regex special characters', async () => {
|
|
823
|
-
await fs.writeFile(path.join(tempRootDir, 'special.txt'), 'Price: $19.99\nRegex: [a-z]+ pattern\nEmail: test@example.com');
|
|
824
|
-
// Setup specific mock for this test - escaped regex pattern should match price format
|
|
825
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
826
|
-
outputData: JSON.stringify({
|
|
827
|
-
type: 'match',
|
|
828
|
-
data: {
|
|
829
|
-
path: { text: 'special.txt' },
|
|
830
|
-
line_number: 1,
|
|
831
|
-
lines: { text: 'Price: $19.99\n' },
|
|
832
|
-
},
|
|
833
|
-
}) + '\n',
|
|
834
|
-
}));
|
|
835
|
-
const params = { pattern: '\\$\\d+\\.\\d+' };
|
|
836
|
-
const invocation = grepTool.build(params);
|
|
837
|
-
const result = await invocation.execute(abortSignal);
|
|
838
|
-
expect(result.llmContent).toContain('Price: $19.99');
|
|
839
|
-
expect(result.llmContent).not.toContain('Email: test@example.com');
|
|
840
|
-
});
|
|
841
|
-
});
|
|
842
|
-
describe('include pattern filtering', () => {
|
|
843
|
-
it('should handle multiple file extensions in include pattern', async () => {
|
|
844
|
-
await fs.writeFile(path.join(tempRootDir, 'test.ts'), 'typescript content');
|
|
845
|
-
await fs.writeFile(path.join(tempRootDir, 'test.tsx'), 'tsx content');
|
|
846
|
-
await fs.writeFile(path.join(tempRootDir, 'test.js'), 'javascript content');
|
|
847
|
-
await fs.writeFile(path.join(tempRootDir, 'test.txt'), 'text content');
|
|
848
|
-
// Setup specific mock for this test - include pattern should filter to only ts/tsx files
|
|
849
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
850
|
-
outputData: JSON.stringify({
|
|
851
|
-
type: 'match',
|
|
852
|
-
data: {
|
|
853
|
-
path: { text: 'test.ts' },
|
|
854
|
-
line_number: 1,
|
|
855
|
-
lines: { text: 'typescript content\n' },
|
|
856
|
-
},
|
|
857
|
-
}) +
|
|
858
|
-
'\n' +
|
|
859
|
-
JSON.stringify({
|
|
860
|
-
type: 'match',
|
|
861
|
-
data: {
|
|
862
|
-
path: { text: 'test.tsx' },
|
|
863
|
-
line_number: 1,
|
|
864
|
-
lines: { text: 'tsx content\n' },
|
|
865
|
-
},
|
|
866
|
-
}) +
|
|
867
|
-
'\n',
|
|
868
|
-
}));
|
|
869
|
-
const params = {
|
|
870
|
-
pattern: 'content',
|
|
871
|
-
include: '*.{ts,tsx}',
|
|
872
|
-
};
|
|
873
|
-
const invocation = grepTool.build(params);
|
|
874
|
-
const result = await invocation.execute(abortSignal);
|
|
875
|
-
expect(result.llmContent).toContain('test.ts');
|
|
876
|
-
expect(result.llmContent).toContain('test.tsx');
|
|
877
|
-
expect(result.llmContent).not.toContain('test.js');
|
|
878
|
-
expect(result.llmContent).not.toContain('test.txt');
|
|
879
|
-
});
|
|
880
|
-
it('should handle directory patterns in include', async () => {
|
|
881
|
-
await fs.mkdir(path.join(tempRootDir, 'src'), { recursive: true });
|
|
882
|
-
await fs.writeFile(path.join(tempRootDir, 'src', 'main.ts'), 'source code');
|
|
883
|
-
await fs.writeFile(path.join(tempRootDir, 'other.ts'), 'other code');
|
|
884
|
-
// Setup specific mock for this test - include pattern should filter to only src/** files
|
|
885
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
886
|
-
outputData: JSON.stringify({
|
|
887
|
-
type: 'match',
|
|
888
|
-
data: {
|
|
889
|
-
path: { text: 'src/main.ts' },
|
|
890
|
-
line_number: 1,
|
|
891
|
-
lines: { text: 'source code\n' },
|
|
892
|
-
},
|
|
893
|
-
}) + '\n',
|
|
894
|
-
}));
|
|
895
|
-
const params = {
|
|
896
|
-
pattern: 'code',
|
|
897
|
-
include: 'src/**',
|
|
898
|
-
};
|
|
899
|
-
const invocation = grepTool.build(params);
|
|
900
|
-
const result = await invocation.execute(abortSignal);
|
|
901
|
-
expect(result.llmContent).toContain('main.ts');
|
|
902
|
-
expect(result.llmContent).not.toContain('other.ts');
|
|
903
|
-
});
|
|
904
|
-
});
|
|
905
|
-
describe('advanced search options', () => {
|
|
906
|
-
it('should handle case_sensitive parameter', async () => {
|
|
907
|
-
// Case-insensitive search (default)
|
|
908
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
909
|
-
outputData: JSON.stringify({
|
|
910
|
-
type: 'match',
|
|
911
|
-
data: {
|
|
912
|
-
path: { text: 'fileA.txt' },
|
|
913
|
-
line_number: 1,
|
|
914
|
-
lines: { text: 'hello world\n' },
|
|
915
|
-
},
|
|
916
|
-
}) + '\n',
|
|
917
|
-
exitCode: 0,
|
|
918
|
-
}));
|
|
919
|
-
let params = { pattern: 'HELLO' };
|
|
920
|
-
let invocation = grepTool.build(params);
|
|
921
|
-
let result = await invocation.execute(abortSignal);
|
|
922
|
-
expect(mockSpawn).toHaveBeenLastCalledWith(expect.anything(), expect.arrayContaining(['--ignore-case']), expect.anything());
|
|
923
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "HELLO"');
|
|
924
|
-
expect(result.llmContent).toContain('L1: hello world');
|
|
925
|
-
// Case-sensitive search
|
|
926
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
927
|
-
outputData: JSON.stringify({
|
|
928
|
-
type: 'match',
|
|
929
|
-
data: {
|
|
930
|
-
path: { text: 'fileA.txt' },
|
|
931
|
-
line_number: 1,
|
|
932
|
-
lines: { text: 'HELLO world\n' },
|
|
933
|
-
},
|
|
934
|
-
}) + '\n',
|
|
935
|
-
exitCode: 0,
|
|
936
|
-
}));
|
|
937
|
-
params = { pattern: 'HELLO', case_sensitive: true };
|
|
938
|
-
invocation = grepTool.build(params);
|
|
939
|
-
result = await invocation.execute(abortSignal);
|
|
940
|
-
expect(mockSpawn).toHaveBeenLastCalledWith(expect.anything(), expect.not.arrayContaining(['--ignore-case']), expect.anything());
|
|
941
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "HELLO"');
|
|
942
|
-
expect(result.llmContent).toContain('L1: HELLO world');
|
|
943
|
-
});
|
|
944
|
-
it.each([
|
|
945
|
-
{
|
|
946
|
-
name: 'fixed_strings parameter',
|
|
947
|
-
params: { pattern: 'hello.world', fixed_strings: true },
|
|
948
|
-
mockOutput: {
|
|
949
|
-
path: { text: 'fileA.txt' },
|
|
950
|
-
line_number: 1,
|
|
951
|
-
lines: { text: 'hello.world\n' },
|
|
952
|
-
},
|
|
953
|
-
expectedArgs: ['--fixed-strings'],
|
|
954
|
-
expectedPattern: 'hello.world',
|
|
955
|
-
},
|
|
956
|
-
])('should handle $name', async ({ params, mockOutput, expectedArgs, expectedPattern }) => {
|
|
957
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
958
|
-
outputData: JSON.stringify({ type: 'match', data: mockOutput }) + '\n',
|
|
959
|
-
exitCode: 0,
|
|
960
|
-
}));
|
|
961
|
-
const invocation = grepTool.build(params);
|
|
962
|
-
const result = await invocation.execute(abortSignal);
|
|
963
|
-
expect(mockSpawn).toHaveBeenLastCalledWith(expect.anything(), expect.arrayContaining(expectedArgs), expect.anything());
|
|
964
|
-
expect(result.llmContent).toContain(`Found 1 match for pattern "${expectedPattern}"`);
|
|
965
|
-
});
|
|
966
|
-
it('should handle no_ignore parameter', async () => {
|
|
967
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
968
|
-
outputData: JSON.stringify({
|
|
969
|
-
type: 'match',
|
|
970
|
-
data: {
|
|
971
|
-
path: { text: 'ignored.log' },
|
|
972
|
-
line_number: 1,
|
|
973
|
-
lines: { text: 'secret log entry\n' },
|
|
974
|
-
},
|
|
975
|
-
}) + '\n',
|
|
976
|
-
exitCode: 0,
|
|
977
|
-
}));
|
|
978
|
-
const params = { pattern: 'secret', no_ignore: true };
|
|
979
|
-
const invocation = grepTool.build(params);
|
|
980
|
-
const result = await invocation.execute(abortSignal);
|
|
981
|
-
expect(mockSpawn).toHaveBeenLastCalledWith(expect.anything(), expect.arrayContaining(['--no-ignore']), expect.anything());
|
|
982
|
-
expect(mockSpawn).toHaveBeenLastCalledWith(expect.anything(), expect.not.arrayContaining(['--glob', '!node_modules']), expect.anything());
|
|
983
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "secret"');
|
|
984
|
-
expect(result.llmContent).toContain('File: ignored.log');
|
|
985
|
-
expect(result.llmContent).toContain('L1: secret log entry');
|
|
986
|
-
});
|
|
987
|
-
it('should add .geminiignore when enabled and patterns exist', async () => {
|
|
988
|
-
const geminiIgnorePath = path.join(tempRootDir, '.geminiignore');
|
|
989
|
-
await fs.writeFile(geminiIgnorePath, 'ignored.log');
|
|
990
|
-
const configWithGeminiIgnore = {
|
|
991
|
-
getTargetDir: () => tempRootDir,
|
|
992
|
-
getWorkspaceContext: () => createMockWorkspaceContext(tempRootDir),
|
|
993
|
-
getDebugMode: () => false,
|
|
994
|
-
getFileFilteringRespectGeminiIgnore: () => true,
|
|
995
|
-
};
|
|
996
|
-
const geminiIgnoreTool = new RipGrepTool(configWithGeminiIgnore, createMockMessageBus());
|
|
997
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
998
|
-
outputData: JSON.stringify({
|
|
999
|
-
type: 'match',
|
|
1000
|
-
data: {
|
|
1001
|
-
path: { text: 'ignored.log' },
|
|
1002
|
-
line_number: 1,
|
|
1003
|
-
lines: { text: 'secret log entry\n' },
|
|
1004
|
-
},
|
|
1005
|
-
}) + '\n',
|
|
1006
|
-
exitCode: 0,
|
|
1007
|
-
}));
|
|
1008
|
-
const params = { pattern: 'secret' };
|
|
1009
|
-
const invocation = geminiIgnoreTool.build(params);
|
|
1010
|
-
await invocation.execute(abortSignal);
|
|
1011
|
-
expect(mockSpawn).toHaveBeenLastCalledWith(expect.anything(), expect.arrayContaining(['--ignore-file', geminiIgnorePath]), expect.anything());
|
|
1012
|
-
});
|
|
1013
|
-
it('should skip .geminiignore when disabled', async () => {
|
|
1014
|
-
const geminiIgnorePath = path.join(tempRootDir, '.geminiignore');
|
|
1015
|
-
await fs.writeFile(geminiIgnorePath, 'ignored.log');
|
|
1016
|
-
const configWithoutGeminiIgnore = {
|
|
1017
|
-
getTargetDir: () => tempRootDir,
|
|
1018
|
-
getWorkspaceContext: () => createMockWorkspaceContext(tempRootDir),
|
|
1019
|
-
getDebugMode: () => false,
|
|
1020
|
-
getFileFilteringRespectGeminiIgnore: () => false,
|
|
1021
|
-
};
|
|
1022
|
-
const geminiIgnoreTool = new RipGrepTool(configWithoutGeminiIgnore, createMockMessageBus());
|
|
1023
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
1024
|
-
outputData: JSON.stringify({
|
|
1025
|
-
type: 'match',
|
|
1026
|
-
data: {
|
|
1027
|
-
path: { text: 'ignored.log' },
|
|
1028
|
-
line_number: 1,
|
|
1029
|
-
lines: { text: 'secret log entry\n' },
|
|
1030
|
-
},
|
|
1031
|
-
}) + '\n',
|
|
1032
|
-
exitCode: 0,
|
|
1033
|
-
}));
|
|
1034
|
-
const params = { pattern: 'secret' };
|
|
1035
|
-
const invocation = geminiIgnoreTool.build(params);
|
|
1036
|
-
await invocation.execute(abortSignal);
|
|
1037
|
-
expect(mockSpawn).toHaveBeenLastCalledWith(expect.anything(), expect.not.arrayContaining(['--ignore-file', geminiIgnorePath]), expect.anything());
|
|
1038
|
-
});
|
|
1039
|
-
it('should handle context parameters', async () => {
|
|
1040
|
-
mockSpawn.mockImplementationOnce(createMockSpawn({
|
|
1041
|
-
outputData: JSON.stringify({
|
|
1042
|
-
type: 'match',
|
|
1043
|
-
data: {
|
|
1044
|
-
path: { text: 'fileA.txt' },
|
|
1045
|
-
line_number: 2,
|
|
1046
|
-
lines: { text: 'second line with world\n' },
|
|
1047
|
-
lines_before: [{ text: 'hello world\n' }],
|
|
1048
|
-
lines_after: [
|
|
1049
|
-
{ text: 'third line\n' },
|
|
1050
|
-
{ text: 'fourth line\n' },
|
|
1051
|
-
],
|
|
1052
|
-
},
|
|
1053
|
-
}) + '\n',
|
|
1054
|
-
exitCode: 0,
|
|
1055
|
-
}));
|
|
1056
|
-
const params = {
|
|
1057
|
-
pattern: 'world',
|
|
1058
|
-
context: 1,
|
|
1059
|
-
after: 2,
|
|
1060
|
-
before: 1,
|
|
1061
|
-
};
|
|
1062
|
-
const invocation = grepTool.build(params);
|
|
1063
|
-
const result = await invocation.execute(abortSignal);
|
|
1064
|
-
expect(mockSpawn).toHaveBeenLastCalledWith(expect.anything(), expect.arrayContaining([
|
|
1065
|
-
'--context',
|
|
1066
|
-
'1',
|
|
1067
|
-
'--after-context',
|
|
1068
|
-
'2',
|
|
1069
|
-
'--before-context',
|
|
1070
|
-
'1',
|
|
1071
|
-
]), expect.anything());
|
|
1072
|
-
expect(result.llmContent).toContain('Found 1 match for pattern "world"');
|
|
1073
|
-
expect(result.llmContent).toContain('File: fileA.txt');
|
|
1074
|
-
expect(result.llmContent).toContain('L2: second line with world');
|
|
1075
|
-
// Note: Ripgrep JSON output for context lines doesn't include line numbers for context lines directly
|
|
1076
|
-
// The current parsing only extracts the matched line, so we only assert on that.
|
|
1077
|
-
});
|
|
1078
|
-
});
|
|
1079
|
-
describe('getDescription', () => {
|
|
1080
|
-
it.each([
|
|
1081
|
-
{
|
|
1082
|
-
name: 'pattern only',
|
|
1083
|
-
params: { pattern: 'testPattern' },
|
|
1084
|
-
expected: "'testPattern' within ./",
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
name: 'pattern and include',
|
|
1088
|
-
params: { pattern: 'testPattern', include: '*.ts' },
|
|
1089
|
-
expected: "'testPattern' in *.ts within ./",
|
|
1090
|
-
},
|
|
1091
|
-
{
|
|
1092
|
-
name: 'root path in description',
|
|
1093
|
-
params: { pattern: 'testPattern', dir_path: '.' },
|
|
1094
|
-
expected: "'testPattern' within ./",
|
|
1095
|
-
},
|
|
1096
|
-
])('should generate correct description with $name', ({ params, expected }) => {
|
|
1097
|
-
const invocation = grepTool.build(params);
|
|
1098
|
-
expect(invocation.getDescription()).toBe(expected);
|
|
1099
|
-
});
|
|
1100
|
-
it('should generate correct description with pattern and path', async () => {
|
|
1101
|
-
const dirPath = path.join(tempRootDir, 'src', 'app');
|
|
1102
|
-
await fs.mkdir(dirPath, { recursive: true });
|
|
1103
|
-
const params = {
|
|
1104
|
-
pattern: 'testPattern',
|
|
1105
|
-
dir_path: path.join('src', 'app'),
|
|
1106
|
-
};
|
|
1107
|
-
const invocation = grepTool.build(params);
|
|
1108
|
-
expect(invocation.getDescription()).toContain("'testPattern' within");
|
|
1109
|
-
expect(invocation.getDescription()).toContain(path.join('src', 'app'));
|
|
1110
|
-
});
|
|
1111
|
-
it('should use ./ when no path is specified (defaults to CWD)', () => {
|
|
1112
|
-
const multiDirConfig = {
|
|
1113
|
-
getTargetDir: () => tempRootDir,
|
|
1114
|
-
getWorkspaceContext: () => createMockWorkspaceContext(tempRootDir, ['/another/dir']),
|
|
1115
|
-
getDebugMode: () => false,
|
|
1116
|
-
};
|
|
1117
|
-
const multiDirGrepTool = new RipGrepTool(multiDirConfig, createMockMessageBus());
|
|
1118
|
-
const params = { pattern: 'testPattern' };
|
|
1119
|
-
const invocation = multiDirGrepTool.build(params);
|
|
1120
|
-
expect(invocation.getDescription()).toBe("'testPattern' within ./");
|
|
1121
|
-
});
|
|
1122
|
-
it('should generate correct description with pattern, include, and path', async () => {
|
|
1123
|
-
const dirPath = path.join(tempRootDir, 'src', 'app');
|
|
1124
|
-
await fs.mkdir(dirPath, { recursive: true });
|
|
1125
|
-
const params = {
|
|
1126
|
-
pattern: 'testPattern',
|
|
1127
|
-
include: '*.ts',
|
|
1128
|
-
dir_path: path.join('src', 'app'),
|
|
1129
|
-
};
|
|
1130
|
-
const invocation = grepTool.build(params);
|
|
1131
|
-
expect(invocation.getDescription()).toContain("'testPattern' in *.ts within");
|
|
1132
|
-
expect(invocation.getDescription()).toContain(path.join('src', 'app'));
|
|
1133
|
-
});
|
|
1134
|
-
});
|
|
1135
|
-
});
|
|
1136
|
-
afterAll(() => {
|
|
1137
|
-
storageSpy.mockRestore();
|
|
1138
|
-
});
|
|
1139
|
-
//# sourceMappingURL=ripGrep.test.js.map
|