@didim365/agent-cli-core 0.1.1 → 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,681 +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, vi, } from 'vitest';
|
|
7
|
-
import { getCorrectedFileContent, WriteFileTool } from './write-file.js';
|
|
8
|
-
import { ToolErrorType } from './tool-error.js';
|
|
9
|
-
import { ToolConfirmationOutcome } from './tools.js';
|
|
10
|
-
import {} from './edit.js';
|
|
11
|
-
import { ApprovalMode } from '../policy/types.js';
|
|
12
|
-
import path from 'node:path';
|
|
13
|
-
import fs from 'node:fs';
|
|
14
|
-
import os from 'node:os';
|
|
15
|
-
import { GeminiClient } from '../core/client.js';
|
|
16
|
-
import { ensureCorrectEdit, ensureCorrectFileContent, } from '../utils/editCorrector.js';
|
|
17
|
-
import { StandardFileSystemService } from '../services/fileSystemService.js';
|
|
18
|
-
import { IdeClient } from '../ide/ide-client.js';
|
|
19
|
-
import { WorkspaceContext } from '../utils/workspaceContext.js';
|
|
20
|
-
import { createMockMessageBus, getMockMessageBusInstance, } from '../test-utils/mock-message-bus.js';
|
|
21
|
-
const rootDir = path.resolve(os.tmpdir(), 'gemini-cli-test-root');
|
|
22
|
-
const plansDir = path.resolve(os.tmpdir(), 'gemini-cli-test-plans');
|
|
23
|
-
// --- MOCKS ---
|
|
24
|
-
vi.mock('../core/client.js');
|
|
25
|
-
vi.mock('../utils/editCorrector.js');
|
|
26
|
-
vi.mock('../ide/ide-client.js', () => ({
|
|
27
|
-
IdeClient: {
|
|
28
|
-
getInstance: vi.fn(),
|
|
29
|
-
},
|
|
30
|
-
}));
|
|
31
|
-
let mockGeminiClientInstance;
|
|
32
|
-
let mockBaseLlmClientInstance;
|
|
33
|
-
const mockEnsureCorrectEdit = vi.fn();
|
|
34
|
-
const mockEnsureCorrectFileContent = vi.fn();
|
|
35
|
-
const mockIdeClient = {
|
|
36
|
-
openDiff: vi.fn(),
|
|
37
|
-
isDiffingEnabled: vi.fn(),
|
|
38
|
-
};
|
|
39
|
-
// Wire up the mocked functions to be used by the actual module imports
|
|
40
|
-
vi.mocked(ensureCorrectEdit).mockImplementation(mockEnsureCorrectEdit);
|
|
41
|
-
vi.mocked(ensureCorrectFileContent).mockImplementation(mockEnsureCorrectFileContent);
|
|
42
|
-
vi.mocked(IdeClient.getInstance).mockResolvedValue(mockIdeClient);
|
|
43
|
-
// Mock Config
|
|
44
|
-
const fsService = new StandardFileSystemService();
|
|
45
|
-
const mockConfigInternal = {
|
|
46
|
-
getTargetDir: () => rootDir,
|
|
47
|
-
getApprovalMode: vi.fn(() => ApprovalMode.DEFAULT),
|
|
48
|
-
setApprovalMode: vi.fn(),
|
|
49
|
-
getGeminiClient: vi.fn(), // Initialize as a plain mock function
|
|
50
|
-
getBaseLlmClient: vi.fn(), // Initialize as a plain mock function
|
|
51
|
-
getFileSystemService: () => fsService,
|
|
52
|
-
getIdeMode: vi.fn(() => false),
|
|
53
|
-
getWorkspaceContext: () => new WorkspaceContext(rootDir, [plansDir]),
|
|
54
|
-
getApiKey: () => 'test-key',
|
|
55
|
-
getModel: () => 'test-model',
|
|
56
|
-
getSandbox: () => false,
|
|
57
|
-
getDebugMode: () => false,
|
|
58
|
-
getQuestion: () => undefined,
|
|
59
|
-
getToolDiscoveryCommand: () => undefined,
|
|
60
|
-
getToolCallCommand: () => undefined,
|
|
61
|
-
getMcpServerCommand: () => undefined,
|
|
62
|
-
getMcpServers: () => undefined,
|
|
63
|
-
getUserAgent: () => 'test-agent',
|
|
64
|
-
getUserMemory: () => '',
|
|
65
|
-
setUserMemory: vi.fn(),
|
|
66
|
-
getGeminiMdFileCount: () => 0,
|
|
67
|
-
setGeminiMdFileCount: vi.fn(),
|
|
68
|
-
getToolRegistry: () => ({
|
|
69
|
-
registerTool: vi.fn(),
|
|
70
|
-
discoverTools: vi.fn(),
|
|
71
|
-
}),
|
|
72
|
-
isInteractive: () => false,
|
|
73
|
-
getDisableLLMCorrection: vi.fn(() => true),
|
|
74
|
-
};
|
|
75
|
-
const mockConfig = mockConfigInternal;
|
|
76
|
-
vi.mock('../telemetry/loggers.js', () => ({
|
|
77
|
-
logFileOperation: vi.fn(),
|
|
78
|
-
}));
|
|
79
|
-
// --- END MOCKS ---
|
|
80
|
-
describe('WriteFileTool', () => {
|
|
81
|
-
let tool;
|
|
82
|
-
let tempDir;
|
|
83
|
-
beforeEach(() => {
|
|
84
|
-
vi.clearAllMocks();
|
|
85
|
-
// Create a unique temporary directory for files created outside the root
|
|
86
|
-
tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'write-file-test-external-'));
|
|
87
|
-
// Ensure the rootDir and plansDir for the tool exists
|
|
88
|
-
if (!fs.existsSync(rootDir)) {
|
|
89
|
-
fs.mkdirSync(rootDir, { recursive: true });
|
|
90
|
-
}
|
|
91
|
-
if (!fs.existsSync(plansDir)) {
|
|
92
|
-
fs.mkdirSync(plansDir, { recursive: true });
|
|
93
|
-
}
|
|
94
|
-
// Setup GeminiClient mock
|
|
95
|
-
mockGeminiClientInstance = new (vi.mocked(GeminiClient))(mockConfig);
|
|
96
|
-
vi.mocked(GeminiClient).mockImplementation(() => mockGeminiClientInstance);
|
|
97
|
-
// Setup BaseLlmClient mock
|
|
98
|
-
mockBaseLlmClientInstance = {
|
|
99
|
-
generateJson: vi.fn(),
|
|
100
|
-
};
|
|
101
|
-
vi.mocked(ensureCorrectEdit).mockImplementation(mockEnsureCorrectEdit);
|
|
102
|
-
vi.mocked(ensureCorrectFileContent).mockImplementation(mockEnsureCorrectFileContent);
|
|
103
|
-
// Now that mock instances are initialized, set the mock implementations for config getters
|
|
104
|
-
mockConfigInternal.getGeminiClient.mockReturnValue(mockGeminiClientInstance);
|
|
105
|
-
mockConfigInternal.getBaseLlmClient.mockReturnValue(mockBaseLlmClientInstance);
|
|
106
|
-
const bus = createMockMessageBus();
|
|
107
|
-
getMockMessageBusInstance(bus).defaultToolDecision = 'ask_user';
|
|
108
|
-
tool = new WriteFileTool(mockConfig, bus);
|
|
109
|
-
// Reset mocks before each test
|
|
110
|
-
mockConfigInternal.getApprovalMode.mockReturnValue(ApprovalMode.DEFAULT);
|
|
111
|
-
mockConfigInternal.setApprovalMode.mockClear();
|
|
112
|
-
mockEnsureCorrectEdit.mockReset();
|
|
113
|
-
mockEnsureCorrectFileContent.mockReset();
|
|
114
|
-
// Default mock implementations that return valid structures
|
|
115
|
-
mockEnsureCorrectEdit.mockImplementation(async (filePath, _currentContent, params, _client, _baseClient, signal) => {
|
|
116
|
-
if (signal?.aborted) {
|
|
117
|
-
return Promise.reject(new Error('Aborted'));
|
|
118
|
-
}
|
|
119
|
-
return Promise.resolve({
|
|
120
|
-
params: { ...params, new_string: params.new_string ?? '' },
|
|
121
|
-
occurrences: 1,
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
mockEnsureCorrectFileContent.mockImplementation(async (content, _baseClient, signal) => {
|
|
125
|
-
if (signal?.aborted) {
|
|
126
|
-
return Promise.reject(new Error('Aborted'));
|
|
127
|
-
}
|
|
128
|
-
return Promise.resolve(content ?? '');
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
afterEach(() => {
|
|
132
|
-
// Clean up the temporary directories
|
|
133
|
-
if (fs.existsSync(tempDir)) {
|
|
134
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
135
|
-
}
|
|
136
|
-
if (fs.existsSync(rootDir)) {
|
|
137
|
-
fs.rmSync(rootDir, { recursive: true, force: true });
|
|
138
|
-
}
|
|
139
|
-
if (fs.existsSync(plansDir)) {
|
|
140
|
-
fs.rmSync(plansDir, { recursive: true, force: true });
|
|
141
|
-
}
|
|
142
|
-
vi.clearAllMocks();
|
|
143
|
-
});
|
|
144
|
-
describe('build', () => {
|
|
145
|
-
it('should return an invocation for a valid absolute path within root', () => {
|
|
146
|
-
const params = {
|
|
147
|
-
file_path: path.join(rootDir, 'test.txt'),
|
|
148
|
-
content: 'hello',
|
|
149
|
-
};
|
|
150
|
-
const invocation = tool.build(params);
|
|
151
|
-
expect(invocation).toBeDefined();
|
|
152
|
-
expect(invocation.params).toEqual(params);
|
|
153
|
-
});
|
|
154
|
-
it('should return an invocation for a valid relative path within root', () => {
|
|
155
|
-
const params = {
|
|
156
|
-
file_path: 'test.txt',
|
|
157
|
-
content: 'hello',
|
|
158
|
-
};
|
|
159
|
-
const invocation = tool.build(params);
|
|
160
|
-
expect(invocation).toBeDefined();
|
|
161
|
-
expect(invocation.params).toEqual(params);
|
|
162
|
-
});
|
|
163
|
-
it('should throw an error for a path outside root', () => {
|
|
164
|
-
const outsidePath = path.resolve(tempDir, 'outside-root.txt');
|
|
165
|
-
const params = {
|
|
166
|
-
file_path: outsidePath,
|
|
167
|
-
content: 'hello',
|
|
168
|
-
};
|
|
169
|
-
expect(() => tool.build(params)).toThrow(/File path must be within one of the workspace directories/);
|
|
170
|
-
});
|
|
171
|
-
it('should throw an error if path is a directory', () => {
|
|
172
|
-
const dirAsFilePath = path.join(rootDir, 'a_directory');
|
|
173
|
-
fs.mkdirSync(dirAsFilePath);
|
|
174
|
-
const params = {
|
|
175
|
-
file_path: dirAsFilePath,
|
|
176
|
-
content: 'hello',
|
|
177
|
-
};
|
|
178
|
-
expect(() => tool.build(params)).toThrow(`Path is a directory, not a file: ${dirAsFilePath}`);
|
|
179
|
-
});
|
|
180
|
-
it('should throw an error if the content is null', () => {
|
|
181
|
-
const dirAsFilePath = path.join(rootDir, 'a_directory');
|
|
182
|
-
fs.mkdirSync(dirAsFilePath);
|
|
183
|
-
const params = {
|
|
184
|
-
file_path: dirAsFilePath,
|
|
185
|
-
content: null,
|
|
186
|
-
}; // Intentionally non-conforming
|
|
187
|
-
expect(() => tool.build(params)).toThrow('params/content must be string');
|
|
188
|
-
});
|
|
189
|
-
it('should throw error if the file_path is empty', () => {
|
|
190
|
-
const dirAsFilePath = path.join(rootDir, 'a_directory');
|
|
191
|
-
fs.mkdirSync(dirAsFilePath);
|
|
192
|
-
const params = {
|
|
193
|
-
file_path: '',
|
|
194
|
-
content: '',
|
|
195
|
-
};
|
|
196
|
-
expect(() => tool.build(params)).toThrow(`Missing or empty "file_path"`);
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
describe('getCorrectedFileContent', () => {
|
|
200
|
-
it('should call ensureCorrectFileContent for a new file', async () => {
|
|
201
|
-
const filePath = path.join(rootDir, 'new_corrected_file.txt');
|
|
202
|
-
const proposedContent = 'Proposed new content.';
|
|
203
|
-
const correctedContent = 'Corrected new content.';
|
|
204
|
-
const abortSignal = new AbortController().signal;
|
|
205
|
-
// Ensure the mock is set for this specific test case if needed, or rely on beforeEach
|
|
206
|
-
mockEnsureCorrectFileContent.mockResolvedValue(correctedContent);
|
|
207
|
-
const result = await getCorrectedFileContent(mockConfig, filePath, proposedContent, abortSignal);
|
|
208
|
-
expect(mockEnsureCorrectFileContent).toHaveBeenCalledWith(proposedContent, mockBaseLlmClientInstance, abortSignal, true);
|
|
209
|
-
expect(mockEnsureCorrectEdit).not.toHaveBeenCalled();
|
|
210
|
-
expect(result.correctedContent).toBe(correctedContent);
|
|
211
|
-
expect(result.originalContent).toBe('');
|
|
212
|
-
expect(result.fileExists).toBe(false);
|
|
213
|
-
expect(result.error).toBeUndefined();
|
|
214
|
-
});
|
|
215
|
-
it('should call ensureCorrectEdit for an existing file', async () => {
|
|
216
|
-
const filePath = path.join(rootDir, 'existing_corrected_file.txt');
|
|
217
|
-
const originalContent = 'Original existing content.';
|
|
218
|
-
const proposedContent = 'Proposed replacement content.';
|
|
219
|
-
const correctedProposedContent = 'Corrected replacement content.';
|
|
220
|
-
const abortSignal = new AbortController().signal;
|
|
221
|
-
fs.writeFileSync(filePath, originalContent, 'utf8');
|
|
222
|
-
// Ensure this mock is active and returns the correct structure
|
|
223
|
-
mockEnsureCorrectEdit.mockResolvedValue({
|
|
224
|
-
params: {
|
|
225
|
-
file_path: filePath,
|
|
226
|
-
old_string: originalContent,
|
|
227
|
-
new_string: correctedProposedContent,
|
|
228
|
-
},
|
|
229
|
-
occurrences: 1,
|
|
230
|
-
});
|
|
231
|
-
const result = await getCorrectedFileContent(mockConfig, filePath, proposedContent, abortSignal);
|
|
232
|
-
expect(mockEnsureCorrectEdit).toHaveBeenCalledWith(filePath, originalContent, {
|
|
233
|
-
old_string: originalContent,
|
|
234
|
-
new_string: proposedContent,
|
|
235
|
-
file_path: filePath,
|
|
236
|
-
}, mockGeminiClientInstance, mockBaseLlmClientInstance, abortSignal, true);
|
|
237
|
-
expect(mockEnsureCorrectFileContent).not.toHaveBeenCalled();
|
|
238
|
-
expect(result.correctedContent).toBe(correctedProposedContent);
|
|
239
|
-
expect(result.originalContent).toBe(originalContent);
|
|
240
|
-
expect(result.fileExists).toBe(true);
|
|
241
|
-
expect(result.error).toBeUndefined();
|
|
242
|
-
});
|
|
243
|
-
it('should return error if reading an existing file fails (e.g. permissions)', async () => {
|
|
244
|
-
const filePath = path.join(rootDir, 'unreadable_file.txt');
|
|
245
|
-
const proposedContent = 'some content';
|
|
246
|
-
const abortSignal = new AbortController().signal;
|
|
247
|
-
fs.writeFileSync(filePath, 'content', { mode: 0o000 });
|
|
248
|
-
const readError = new Error('Permission denied');
|
|
249
|
-
vi.spyOn(fsService, 'readTextFile').mockImplementationOnce(() => Promise.reject(readError));
|
|
250
|
-
const result = await getCorrectedFileContent(mockConfig, filePath, proposedContent, abortSignal);
|
|
251
|
-
expect(fsService.readTextFile).toHaveBeenCalledWith(filePath);
|
|
252
|
-
expect(mockEnsureCorrectEdit).not.toHaveBeenCalled();
|
|
253
|
-
expect(mockEnsureCorrectFileContent).not.toHaveBeenCalled();
|
|
254
|
-
expect(result.correctedContent).toBe(proposedContent);
|
|
255
|
-
expect(result.originalContent).toBe('');
|
|
256
|
-
expect(result.fileExists).toBe(true);
|
|
257
|
-
expect(result.error).toEqual({
|
|
258
|
-
message: 'Permission denied',
|
|
259
|
-
code: undefined,
|
|
260
|
-
});
|
|
261
|
-
fs.chmodSync(filePath, 0o600);
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
describe('shouldConfirmExecute', () => {
|
|
265
|
-
const abortSignal = new AbortController().signal;
|
|
266
|
-
it('should return false if _getCorrectedFileContent returns an error', async () => {
|
|
267
|
-
const filePath = path.join(rootDir, 'confirm_error_file.txt');
|
|
268
|
-
const params = { file_path: filePath, content: 'test content' };
|
|
269
|
-
fs.writeFileSync(filePath, 'original', { mode: 0o000 });
|
|
270
|
-
const readError = new Error('Simulated read error for confirmation');
|
|
271
|
-
vi.spyOn(fsService, 'readTextFile').mockImplementationOnce(() => Promise.reject(readError));
|
|
272
|
-
const invocation = tool.build(params);
|
|
273
|
-
const confirmation = await invocation.shouldConfirmExecute(abortSignal);
|
|
274
|
-
expect(confirmation).toBe(false);
|
|
275
|
-
fs.chmodSync(filePath, 0o600);
|
|
276
|
-
});
|
|
277
|
-
it('should request confirmation with diff for a new file (with corrected content)', async () => {
|
|
278
|
-
const filePath = path.join(rootDir, 'confirm_new_file.txt');
|
|
279
|
-
const proposedContent = 'Proposed new content for confirmation.';
|
|
280
|
-
const correctedContent = 'Corrected new content for confirmation.';
|
|
281
|
-
mockEnsureCorrectFileContent.mockResolvedValue(correctedContent); // Ensure this mock is active
|
|
282
|
-
const params = { file_path: filePath, content: proposedContent };
|
|
283
|
-
const invocation = tool.build(params);
|
|
284
|
-
const confirmation = (await invocation.shouldConfirmExecute(abortSignal));
|
|
285
|
-
expect(mockEnsureCorrectFileContent).toHaveBeenCalledWith(proposedContent, mockBaseLlmClientInstance, abortSignal, true);
|
|
286
|
-
expect(confirmation).toEqual(expect.objectContaining({
|
|
287
|
-
title: `Confirm Write: ${path.basename(filePath)}`,
|
|
288
|
-
fileName: 'confirm_new_file.txt',
|
|
289
|
-
fileDiff: expect.stringContaining(correctedContent),
|
|
290
|
-
}));
|
|
291
|
-
expect(confirmation.fileDiff).toMatch(/--- confirm_new_file.txt\tCurrent/);
|
|
292
|
-
expect(confirmation.fileDiff).toMatch(/\+\+\+ confirm_new_file.txt\tProposed/);
|
|
293
|
-
});
|
|
294
|
-
it('should request confirmation with diff for an existing file (with corrected content)', async () => {
|
|
295
|
-
const filePath = path.join(rootDir, 'confirm_existing_file.txt');
|
|
296
|
-
const originalContent = 'Original content for confirmation.';
|
|
297
|
-
const proposedContent = 'Proposed replacement for confirmation.';
|
|
298
|
-
const correctedProposedContent = 'Corrected replacement for confirmation.';
|
|
299
|
-
fs.writeFileSync(filePath, originalContent, 'utf8');
|
|
300
|
-
mockEnsureCorrectEdit.mockResolvedValue({
|
|
301
|
-
params: {
|
|
302
|
-
file_path: filePath,
|
|
303
|
-
old_string: originalContent,
|
|
304
|
-
new_string: correctedProposedContent,
|
|
305
|
-
},
|
|
306
|
-
occurrences: 1,
|
|
307
|
-
});
|
|
308
|
-
const params = { file_path: filePath, content: proposedContent };
|
|
309
|
-
const invocation = tool.build(params);
|
|
310
|
-
const confirmation = (await invocation.shouldConfirmExecute(abortSignal));
|
|
311
|
-
expect(mockEnsureCorrectEdit).toHaveBeenCalledWith(filePath, originalContent, {
|
|
312
|
-
old_string: originalContent,
|
|
313
|
-
new_string: proposedContent,
|
|
314
|
-
file_path: filePath,
|
|
315
|
-
}, mockGeminiClientInstance, mockBaseLlmClientInstance, abortSignal, true);
|
|
316
|
-
expect(confirmation).toEqual(expect.objectContaining({
|
|
317
|
-
title: `Confirm Write: ${path.basename(filePath)}`,
|
|
318
|
-
fileName: 'confirm_existing_file.txt',
|
|
319
|
-
fileDiff: expect.stringContaining(correctedProposedContent),
|
|
320
|
-
}));
|
|
321
|
-
expect(confirmation.fileDiff).toMatch(originalContent.replace(/[.*+?^${}()|[\\]\\]/g, '\\$&'));
|
|
322
|
-
});
|
|
323
|
-
describe('with IDE integration', () => {
|
|
324
|
-
beforeEach(() => {
|
|
325
|
-
// Enable IDE mode and set connection status for these tests
|
|
326
|
-
mockConfigInternal.getIdeMode.mockReturnValue(true);
|
|
327
|
-
mockIdeClient.isDiffingEnabled.mockReturnValue(true);
|
|
328
|
-
mockIdeClient.openDiff.mockResolvedValue({
|
|
329
|
-
status: 'accepted',
|
|
330
|
-
content: 'ide-modified-content',
|
|
331
|
-
});
|
|
332
|
-
});
|
|
333
|
-
it('should call openDiff and await it when in IDE mode and connected', async () => {
|
|
334
|
-
const filePath = path.join(rootDir, 'ide_confirm_file.txt');
|
|
335
|
-
const params = { file_path: filePath, content: 'test' };
|
|
336
|
-
const invocation = tool.build(params);
|
|
337
|
-
const confirmation = (await invocation.shouldConfirmExecute(abortSignal));
|
|
338
|
-
expect(mockIdeClient.openDiff).toHaveBeenCalledWith(filePath, 'test');
|
|
339
|
-
// Ensure the promise is awaited by checking the result
|
|
340
|
-
expect(confirmation.ideConfirmation).toBeDefined();
|
|
341
|
-
await confirmation.ideConfirmation; // Should resolve
|
|
342
|
-
});
|
|
343
|
-
it('should not call openDiff if not in IDE mode', async () => {
|
|
344
|
-
mockConfigInternal.getIdeMode.mockReturnValue(false);
|
|
345
|
-
const filePath = path.join(rootDir, 'ide_disabled_file.txt');
|
|
346
|
-
const params = { file_path: filePath, content: 'test' };
|
|
347
|
-
const invocation = tool.build(params);
|
|
348
|
-
await invocation.shouldConfirmExecute(abortSignal);
|
|
349
|
-
expect(mockIdeClient.openDiff).not.toHaveBeenCalled();
|
|
350
|
-
});
|
|
351
|
-
it('should not call openDiff if IDE is not connected', async () => {
|
|
352
|
-
mockIdeClient.isDiffingEnabled.mockReturnValue(false);
|
|
353
|
-
const filePath = path.join(rootDir, 'ide_disconnected_file.txt');
|
|
354
|
-
const params = { file_path: filePath, content: 'test' };
|
|
355
|
-
const invocation = tool.build(params);
|
|
356
|
-
await invocation.shouldConfirmExecute(abortSignal);
|
|
357
|
-
expect(mockIdeClient.openDiff).not.toHaveBeenCalled();
|
|
358
|
-
});
|
|
359
|
-
it('should update params.content with IDE content when onConfirm is called', async () => {
|
|
360
|
-
const filePath = path.join(rootDir, 'ide_onconfirm_file.txt');
|
|
361
|
-
const params = { file_path: filePath, content: 'original-content' };
|
|
362
|
-
const invocation = tool.build(params);
|
|
363
|
-
// This is the key part: get the confirmation details
|
|
364
|
-
const confirmation = (await invocation.shouldConfirmExecute(abortSignal));
|
|
365
|
-
// The `onConfirm` function should exist on the details object
|
|
366
|
-
expect(confirmation.onConfirm).toBeDefined();
|
|
367
|
-
// Call `onConfirm` to trigger the logic that updates the content
|
|
368
|
-
await confirmation.onConfirm(ToolConfirmationOutcome.ProceedOnce);
|
|
369
|
-
// Now, check if the original `params` object (captured by the invocation) was modified
|
|
370
|
-
expect(invocation.params.content).toBe('ide-modified-content');
|
|
371
|
-
});
|
|
372
|
-
it('should not await ideConfirmation promise', async () => {
|
|
373
|
-
const IDE_DIFF_DELAY_MS = 50;
|
|
374
|
-
const filePath = path.join(rootDir, 'ide_no_await_file.txt');
|
|
375
|
-
const params = { file_path: filePath, content: 'test' };
|
|
376
|
-
const invocation = tool.build(params);
|
|
377
|
-
let diffPromiseResolved = false;
|
|
378
|
-
const diffPromise = new Promise((resolve) => {
|
|
379
|
-
setTimeout(() => {
|
|
380
|
-
diffPromiseResolved = true;
|
|
381
|
-
resolve({ status: 'accepted', content: 'ide-modified-content' });
|
|
382
|
-
}, IDE_DIFF_DELAY_MS);
|
|
383
|
-
});
|
|
384
|
-
mockIdeClient.openDiff.mockReturnValue(diffPromise);
|
|
385
|
-
const confirmation = (await invocation.shouldConfirmExecute(abortSignal));
|
|
386
|
-
// This is the key check: the confirmation details should be returned
|
|
387
|
-
// *before* the diffPromise is resolved.
|
|
388
|
-
expect(diffPromiseResolved).toBe(false);
|
|
389
|
-
expect(confirmation).toBeDefined();
|
|
390
|
-
expect(confirmation.ideConfirmation).toBe(diffPromise);
|
|
391
|
-
// Now, we can await the promise to let the test finish cleanly.
|
|
392
|
-
await diffPromise;
|
|
393
|
-
expect(diffPromiseResolved).toBe(true);
|
|
394
|
-
});
|
|
395
|
-
});
|
|
396
|
-
});
|
|
397
|
-
describe('execute', () => {
|
|
398
|
-
const abortSignal = new AbortController().signal;
|
|
399
|
-
async function confirmExecution(invocation, signal = abortSignal) {
|
|
400
|
-
const confirmDetails = await invocation.shouldConfirmExecute(signal);
|
|
401
|
-
if (typeof confirmDetails === 'object' &&
|
|
402
|
-
'onConfirm' in confirmDetails &&
|
|
403
|
-
confirmDetails.onConfirm) {
|
|
404
|
-
await confirmDetails.onConfirm(ToolConfirmationOutcome.ProceedOnce);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
it('should write a new file with a relative path', async () => {
|
|
408
|
-
const relativePath = 'execute_relative_new_file.txt';
|
|
409
|
-
const filePath = path.join(rootDir, relativePath);
|
|
410
|
-
const content = 'Content for relative path file.';
|
|
411
|
-
mockEnsureCorrectFileContent.mockResolvedValue(content);
|
|
412
|
-
const params = { file_path: relativePath, content };
|
|
413
|
-
const invocation = tool.build(params);
|
|
414
|
-
const result = await invocation.execute(abortSignal);
|
|
415
|
-
expect(result.llmContent).toMatch(/Successfully created and wrote to new file/);
|
|
416
|
-
expect(fs.existsSync(filePath)).toBe(true);
|
|
417
|
-
const writtenContent = await fsService.readTextFile(filePath);
|
|
418
|
-
expect(writtenContent).toBe(content);
|
|
419
|
-
});
|
|
420
|
-
it('should return error if _getCorrectedFileContent returns an error during execute', async () => {
|
|
421
|
-
const filePath = path.join(rootDir, 'execute_error_file.txt');
|
|
422
|
-
const params = { file_path: filePath, content: 'test content' };
|
|
423
|
-
fs.writeFileSync(filePath, 'original', { mode: 0o000 });
|
|
424
|
-
vi.spyOn(fsService, 'readTextFile').mockImplementationOnce(() => {
|
|
425
|
-
const readError = new Error('Simulated read error for execute');
|
|
426
|
-
return Promise.reject(readError);
|
|
427
|
-
});
|
|
428
|
-
const invocation = tool.build(params);
|
|
429
|
-
const result = await invocation.execute(abortSignal);
|
|
430
|
-
expect(result.llmContent).toContain('Error checking existing file');
|
|
431
|
-
expect(result.returnDisplay).toMatch(/Error checking existing file: Simulated read error for execute/);
|
|
432
|
-
expect(result.error).toEqual({
|
|
433
|
-
message: 'Error checking existing file: Simulated read error for execute',
|
|
434
|
-
type: ToolErrorType.FILE_WRITE_FAILURE,
|
|
435
|
-
});
|
|
436
|
-
fs.chmodSync(filePath, 0o600);
|
|
437
|
-
});
|
|
438
|
-
it('should write a new file with corrected content and return diff', async () => {
|
|
439
|
-
const filePath = path.join(rootDir, 'execute_new_corrected_file.txt');
|
|
440
|
-
const proposedContent = 'Proposed new content for execute.';
|
|
441
|
-
const correctedContent = 'Corrected new content for execute.';
|
|
442
|
-
mockEnsureCorrectFileContent.mockResolvedValue(correctedContent);
|
|
443
|
-
const params = { file_path: filePath, content: proposedContent };
|
|
444
|
-
const invocation = tool.build(params);
|
|
445
|
-
await confirmExecution(invocation);
|
|
446
|
-
const result = await invocation.execute(abortSignal);
|
|
447
|
-
expect(mockEnsureCorrectFileContent).toHaveBeenCalledWith(proposedContent, mockBaseLlmClientInstance, abortSignal, true);
|
|
448
|
-
expect(result.llmContent).toMatch(/Successfully created and wrote to new file/);
|
|
449
|
-
expect(fs.existsSync(filePath)).toBe(true);
|
|
450
|
-
const writtenContent = await fsService.readTextFile(filePath);
|
|
451
|
-
expect(writtenContent).toBe(correctedContent);
|
|
452
|
-
const display = result.returnDisplay;
|
|
453
|
-
expect(display.fileName).toBe('execute_new_corrected_file.txt');
|
|
454
|
-
expect(display.fileDiff).toMatch(/--- execute_new_corrected_file.txt\tOriginal/);
|
|
455
|
-
expect(display.fileDiff).toMatch(/\+\+\+ execute_new_corrected_file.txt\tWritten/);
|
|
456
|
-
expect(display.fileDiff).toMatch(correctedContent.replace(/[.*+?^${}()|[\\]\\]/g, '\\$&'));
|
|
457
|
-
});
|
|
458
|
-
it('should overwrite an existing file with corrected content and return diff', async () => {
|
|
459
|
-
const filePath = path.join(rootDir, 'execute_existing_corrected_file.txt');
|
|
460
|
-
const initialContent = 'Initial content for execute.';
|
|
461
|
-
const proposedContent = 'Proposed overwrite for execute.';
|
|
462
|
-
const correctedProposedContent = 'Corrected overwrite for execute.';
|
|
463
|
-
fs.writeFileSync(filePath, initialContent, 'utf8');
|
|
464
|
-
mockEnsureCorrectEdit.mockResolvedValue({
|
|
465
|
-
params: {
|
|
466
|
-
file_path: filePath,
|
|
467
|
-
old_string: initialContent,
|
|
468
|
-
new_string: correctedProposedContent,
|
|
469
|
-
},
|
|
470
|
-
occurrences: 1,
|
|
471
|
-
});
|
|
472
|
-
const params = { file_path: filePath, content: proposedContent };
|
|
473
|
-
const invocation = tool.build(params);
|
|
474
|
-
await confirmExecution(invocation);
|
|
475
|
-
const result = await invocation.execute(abortSignal);
|
|
476
|
-
expect(mockEnsureCorrectEdit).toHaveBeenCalledWith(filePath, initialContent, {
|
|
477
|
-
old_string: initialContent,
|
|
478
|
-
new_string: proposedContent,
|
|
479
|
-
file_path: filePath,
|
|
480
|
-
}, mockGeminiClientInstance, mockBaseLlmClientInstance, abortSignal, true);
|
|
481
|
-
expect(result.llmContent).toMatch(/Successfully overwrote file/);
|
|
482
|
-
const writtenContent = await fsService.readTextFile(filePath);
|
|
483
|
-
expect(writtenContent).toBe(correctedProposedContent);
|
|
484
|
-
const display = result.returnDisplay;
|
|
485
|
-
expect(display.fileName).toBe('execute_existing_corrected_file.txt');
|
|
486
|
-
expect(display.fileDiff).toMatch(initialContent.replace(/[.*+?^${}()|[\\]\\]/g, '\\$&'));
|
|
487
|
-
expect(display.fileDiff).toMatch(correctedProposedContent.replace(/[.*+?^${}()|[\\]\\]/g, '\\$&'));
|
|
488
|
-
});
|
|
489
|
-
it('should create directory if it does not exist', async () => {
|
|
490
|
-
const dirPath = path.join(rootDir, 'new_dir_for_write');
|
|
491
|
-
const filePath = path.join(dirPath, 'file_in_new_dir.txt');
|
|
492
|
-
const content = 'Content in new directory';
|
|
493
|
-
mockEnsureCorrectFileContent.mockResolvedValue(content); // Ensure this mock is active
|
|
494
|
-
const params = { file_path: filePath, content };
|
|
495
|
-
const invocation = tool.build(params);
|
|
496
|
-
await confirmExecution(invocation);
|
|
497
|
-
await invocation.execute(abortSignal);
|
|
498
|
-
expect(fs.existsSync(dirPath)).toBe(true);
|
|
499
|
-
expect(fs.statSync(dirPath).isDirectory()).toBe(true);
|
|
500
|
-
expect(fs.existsSync(filePath)).toBe(true);
|
|
501
|
-
expect(fs.readFileSync(filePath, 'utf8')).toBe(content);
|
|
502
|
-
});
|
|
503
|
-
it.each([
|
|
504
|
-
{
|
|
505
|
-
modified_by_user: true,
|
|
506
|
-
shouldIncludeMessage: true,
|
|
507
|
-
testCase: 'when modified_by_user is true',
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
modified_by_user: false,
|
|
511
|
-
shouldIncludeMessage: false,
|
|
512
|
-
testCase: 'when modified_by_user is false',
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
modified_by_user: undefined,
|
|
516
|
-
shouldIncludeMessage: false,
|
|
517
|
-
testCase: 'when modified_by_user is not provided',
|
|
518
|
-
},
|
|
519
|
-
])('should $testCase include modification message', async ({ modified_by_user, shouldIncludeMessage }) => {
|
|
520
|
-
const filePath = path.join(rootDir, `new_file_${modified_by_user}.txt`);
|
|
521
|
-
const content = 'New file content';
|
|
522
|
-
mockEnsureCorrectFileContent.mockResolvedValue(content);
|
|
523
|
-
const params = {
|
|
524
|
-
file_path: filePath,
|
|
525
|
-
content,
|
|
526
|
-
...(modified_by_user !== undefined && { modified_by_user }),
|
|
527
|
-
};
|
|
528
|
-
const invocation = tool.build(params);
|
|
529
|
-
const result = await invocation.execute(abortSignal);
|
|
530
|
-
if (shouldIncludeMessage) {
|
|
531
|
-
expect(result.llmContent).toMatch(/User modified the `content`/);
|
|
532
|
-
}
|
|
533
|
-
else {
|
|
534
|
-
expect(result.llmContent).not.toMatch(/User modified the `content`/);
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
});
|
|
538
|
-
describe('workspace boundary validation', () => {
|
|
539
|
-
it('should validate paths are within workspace root', () => {
|
|
540
|
-
const params = {
|
|
541
|
-
file_path: path.join(rootDir, 'file.txt'),
|
|
542
|
-
content: 'test content',
|
|
543
|
-
};
|
|
544
|
-
expect(() => tool.build(params)).not.toThrow();
|
|
545
|
-
});
|
|
546
|
-
it('should reject paths outside workspace root', () => {
|
|
547
|
-
const params = {
|
|
548
|
-
file_path: '/etc/passwd',
|
|
549
|
-
content: 'malicious',
|
|
550
|
-
};
|
|
551
|
-
expect(() => tool.build(params)).toThrow(/File path must be within one of the workspace directories/);
|
|
552
|
-
});
|
|
553
|
-
it('should allow paths within the plans directory', () => {
|
|
554
|
-
const params = {
|
|
555
|
-
file_path: path.join(plansDir, 'my-plan.md'),
|
|
556
|
-
content: '# My Plan',
|
|
557
|
-
};
|
|
558
|
-
expect(() => tool.build(params)).not.toThrow();
|
|
559
|
-
});
|
|
560
|
-
it('should reject paths that try to escape the plans directory', () => {
|
|
561
|
-
const params = {
|
|
562
|
-
file_path: path.join(plansDir, '..', 'escaped.txt'),
|
|
563
|
-
content: 'malicious',
|
|
564
|
-
};
|
|
565
|
-
expect(() => tool.build(params)).toThrow(/File path must be within one of the workspace directories/);
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
describe('specific error types for write failures', () => {
|
|
569
|
-
const abortSignal = new AbortController().signal;
|
|
570
|
-
it.each([
|
|
571
|
-
{
|
|
572
|
-
errorCode: 'EACCES',
|
|
573
|
-
errorType: ToolErrorType.PERMISSION_DENIED,
|
|
574
|
-
errorMessage: 'Permission denied',
|
|
575
|
-
expectedMessagePrefix: 'Permission denied writing to file',
|
|
576
|
-
mockFsExistsSync: false,
|
|
577
|
-
restoreAllMocks: false,
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
errorCode: 'ENOSPC',
|
|
581
|
-
errorType: ToolErrorType.NO_SPACE_LEFT,
|
|
582
|
-
errorMessage: 'No space left on device',
|
|
583
|
-
expectedMessagePrefix: 'No space left on device',
|
|
584
|
-
mockFsExistsSync: false,
|
|
585
|
-
restoreAllMocks: false,
|
|
586
|
-
},
|
|
587
|
-
{
|
|
588
|
-
errorCode: 'EISDIR',
|
|
589
|
-
errorType: ToolErrorType.TARGET_IS_DIRECTORY,
|
|
590
|
-
errorMessage: 'Is a directory',
|
|
591
|
-
expectedMessagePrefix: 'Target is a directory, not a file',
|
|
592
|
-
mockFsExistsSync: true,
|
|
593
|
-
restoreAllMocks: false,
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
errorCode: undefined,
|
|
597
|
-
errorType: ToolErrorType.FILE_WRITE_FAILURE,
|
|
598
|
-
errorMessage: 'Generic write error',
|
|
599
|
-
expectedMessagePrefix: 'Error writing to file',
|
|
600
|
-
mockFsExistsSync: false,
|
|
601
|
-
restoreAllMocks: true,
|
|
602
|
-
},
|
|
603
|
-
])('should return $errorType error when write fails with $errorCode', async ({ errorCode, errorType, errorMessage, expectedMessagePrefix, mockFsExistsSync, restoreAllMocks, }) => {
|
|
604
|
-
const filePath = path.join(rootDir, `${errorType}_file.txt`);
|
|
605
|
-
const content = 'test content';
|
|
606
|
-
if (restoreAllMocks) {
|
|
607
|
-
vi.restoreAllMocks();
|
|
608
|
-
}
|
|
609
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
610
|
-
let existsSyncSpy;
|
|
611
|
-
try {
|
|
612
|
-
if (mockFsExistsSync) {
|
|
613
|
-
const originalExistsSync = fs.existsSync;
|
|
614
|
-
existsSyncSpy = vi
|
|
615
|
-
.spyOn(fs, 'existsSync')
|
|
616
|
-
.mockImplementation((path) => path === filePath ? false : originalExistsSync(path));
|
|
617
|
-
}
|
|
618
|
-
vi.spyOn(fsService, 'writeTextFile').mockImplementationOnce(() => {
|
|
619
|
-
const error = new Error(errorMessage);
|
|
620
|
-
if (errorCode)
|
|
621
|
-
error.code = errorCode;
|
|
622
|
-
return Promise.reject(error);
|
|
623
|
-
});
|
|
624
|
-
const params = { file_path: filePath, content };
|
|
625
|
-
const invocation = tool.build(params);
|
|
626
|
-
const result = await invocation.execute(abortSignal);
|
|
627
|
-
expect(result.error?.type).toBe(errorType);
|
|
628
|
-
const errorSuffix = errorCode ? ` (${errorCode})` : '';
|
|
629
|
-
const expectedMessage = errorCode
|
|
630
|
-
? `${expectedMessagePrefix}: ${filePath}${errorSuffix}`
|
|
631
|
-
: `${expectedMessagePrefix}: ${errorMessage}`;
|
|
632
|
-
expect(result.llmContent).toContain(expectedMessage);
|
|
633
|
-
expect(result.returnDisplay).toContain(expectedMessage);
|
|
634
|
-
}
|
|
635
|
-
finally {
|
|
636
|
-
if (existsSyncSpy) {
|
|
637
|
-
existsSyncSpy.mockRestore();
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
});
|
|
641
|
-
});
|
|
642
|
-
describe('disableLLMCorrection', () => {
|
|
643
|
-
const abortSignal = new AbortController().signal;
|
|
644
|
-
it('should call ensureCorrectFileContent with disableLLMCorrection=true for a new file when disabled', async () => {
|
|
645
|
-
const filePath = path.join(rootDir, 'new_file_no_correction.txt');
|
|
646
|
-
const proposedContent = 'Proposed content.';
|
|
647
|
-
mockConfigInternal.getDisableLLMCorrection.mockReturnValue(true);
|
|
648
|
-
// Ensure the mock returns the content passed to it (simulating no change or unescaped change)
|
|
649
|
-
mockEnsureCorrectFileContent.mockResolvedValue(proposedContent);
|
|
650
|
-
const result = await getCorrectedFileContent(mockConfig, filePath, proposedContent, abortSignal);
|
|
651
|
-
expect(mockEnsureCorrectFileContent).toHaveBeenCalledWith(proposedContent, mockBaseLlmClientInstance, abortSignal, true);
|
|
652
|
-
expect(mockEnsureCorrectEdit).not.toHaveBeenCalled();
|
|
653
|
-
expect(result.correctedContent).toBe(proposedContent);
|
|
654
|
-
expect(result.fileExists).toBe(false);
|
|
655
|
-
});
|
|
656
|
-
it('should call ensureCorrectEdit with disableLLMCorrection=true for an existing file when disabled', async () => {
|
|
657
|
-
const filePath = path.join(rootDir, 'existing_file_no_correction.txt');
|
|
658
|
-
const originalContent = 'Original content.';
|
|
659
|
-
const proposedContent = 'Proposed content.';
|
|
660
|
-
fs.writeFileSync(filePath, originalContent, 'utf8');
|
|
661
|
-
mockConfigInternal.getDisableLLMCorrection.mockReturnValue(true);
|
|
662
|
-
// Ensure the mock returns the content passed to it
|
|
663
|
-
mockEnsureCorrectEdit.mockResolvedValue({
|
|
664
|
-
params: {
|
|
665
|
-
file_path: filePath,
|
|
666
|
-
old_string: originalContent,
|
|
667
|
-
new_string: proposedContent,
|
|
668
|
-
},
|
|
669
|
-
occurrences: 1,
|
|
670
|
-
});
|
|
671
|
-
const result = await getCorrectedFileContent(mockConfig, filePath, proposedContent, abortSignal);
|
|
672
|
-
expect(mockEnsureCorrectEdit).toHaveBeenCalledWith(filePath, originalContent, expect.anything(), // params object
|
|
673
|
-
mockGeminiClientInstance, mockBaseLlmClientInstance, abortSignal, true);
|
|
674
|
-
expect(mockEnsureCorrectFileContent).not.toHaveBeenCalled();
|
|
675
|
-
expect(result.correctedContent).toBe(proposedContent);
|
|
676
|
-
expect(result.originalContent).toBe(originalContent);
|
|
677
|
-
expect(result.fileExists).toBe(true);
|
|
678
|
-
});
|
|
679
|
-
});
|
|
680
|
-
});
|
|
681
|
-
//# sourceMappingURL=write-file.test.js.map
|