@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,1176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
7
|
-
import { FileOperation, MemoryMetricType, ToolExecutionPhase, ApiRequestPhase, } from './metrics.js';
|
|
8
|
-
import { makeFakeConfig } from '../test-utils/config.js';
|
|
9
|
-
import { ModelRoutingEvent, AgentFinishEvent } from './types.js';
|
|
10
|
-
import { AgentTerminateMode } from '../agents/types.js';
|
|
11
|
-
const mockCounterAddFn = vi.fn();
|
|
12
|
-
const mockHistogramRecordFn = vi.fn();
|
|
13
|
-
const mockCreateCounterFn = vi.fn();
|
|
14
|
-
const mockCreateHistogramFn = vi.fn();
|
|
15
|
-
const mockCounterInstance = {
|
|
16
|
-
add: mockCounterAddFn,
|
|
17
|
-
};
|
|
18
|
-
const mockHistogramInstance = {
|
|
19
|
-
record: mockHistogramRecordFn,
|
|
20
|
-
};
|
|
21
|
-
const mockMeterInstance = {
|
|
22
|
-
createCounter: mockCreateCounterFn.mockReturnValue(mockCounterInstance),
|
|
23
|
-
createHistogram: mockCreateHistogramFn.mockReturnValue(mockHistogramInstance),
|
|
24
|
-
};
|
|
25
|
-
function originalOtelMockFactory() {
|
|
26
|
-
return {
|
|
27
|
-
metrics: {
|
|
28
|
-
getMeter: vi.fn(),
|
|
29
|
-
},
|
|
30
|
-
ValueType: {
|
|
31
|
-
INT: 1,
|
|
32
|
-
DOUBLE: 2,
|
|
33
|
-
},
|
|
34
|
-
diag: {
|
|
35
|
-
setLogger: vi.fn(),
|
|
36
|
-
warn: vi.fn(),
|
|
37
|
-
},
|
|
38
|
-
DiagConsoleLogger: vi.fn(),
|
|
39
|
-
DiagLogLevel: {
|
|
40
|
-
NONE: 0,
|
|
41
|
-
INFO: 1,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
vi.mock('@opentelemetry/api');
|
|
46
|
-
vi.mock('./telemetryAttributes.js');
|
|
47
|
-
describe('Telemetry Metrics', () => {
|
|
48
|
-
let initializeMetricsModule;
|
|
49
|
-
let recordTokenUsageMetricsModule;
|
|
50
|
-
let recordFileOperationMetricModule;
|
|
51
|
-
let recordChatCompressionMetricsModule;
|
|
52
|
-
let recordModelRoutingMetricsModule;
|
|
53
|
-
let recordStartupPerformanceModule;
|
|
54
|
-
let recordMemoryUsageModule;
|
|
55
|
-
let recordCpuUsageModule;
|
|
56
|
-
let recordToolQueueDepthModule;
|
|
57
|
-
let recordToolExecutionBreakdownModule;
|
|
58
|
-
let recordTokenEfficiencyModule;
|
|
59
|
-
let recordApiRequestBreakdownModule;
|
|
60
|
-
let recordPerformanceScoreModule;
|
|
61
|
-
let recordPerformanceRegressionModule;
|
|
62
|
-
let recordBaselineComparisonModule;
|
|
63
|
-
let recordGenAiClientTokenUsageModule;
|
|
64
|
-
let recordGenAiClientOperationDurationModule;
|
|
65
|
-
let recordFlickerFrameModule;
|
|
66
|
-
let recordExitFailModule;
|
|
67
|
-
let recordAgentRunMetricsModule;
|
|
68
|
-
let recordLinesChangedModule;
|
|
69
|
-
let recordSlowRenderModule;
|
|
70
|
-
beforeEach(async () => {
|
|
71
|
-
vi.resetModules();
|
|
72
|
-
vi.doMock('@opentelemetry/api', () => {
|
|
73
|
-
const actualApi = originalOtelMockFactory();
|
|
74
|
-
actualApi.metrics.getMeter.mockReturnValue(mockMeterInstance);
|
|
75
|
-
return actualApi;
|
|
76
|
-
});
|
|
77
|
-
const { getCommonAttributes } = await import('./telemetryAttributes.js');
|
|
78
|
-
getCommonAttributes.mockReturnValue({
|
|
79
|
-
'session.id': 'test-session-id',
|
|
80
|
-
'installation.id': 'test-installation-id',
|
|
81
|
-
'user.email': 'test@example.com',
|
|
82
|
-
});
|
|
83
|
-
const metricsJsModule = await import('./metrics.js');
|
|
84
|
-
initializeMetricsModule = metricsJsModule.initializeMetrics;
|
|
85
|
-
recordTokenUsageMetricsModule = metricsJsModule.recordTokenUsageMetrics;
|
|
86
|
-
recordFileOperationMetricModule = metricsJsModule.recordFileOperationMetric;
|
|
87
|
-
recordChatCompressionMetricsModule =
|
|
88
|
-
metricsJsModule.recordChatCompressionMetrics;
|
|
89
|
-
recordModelRoutingMetricsModule = metricsJsModule.recordModelRoutingMetrics;
|
|
90
|
-
recordStartupPerformanceModule = metricsJsModule.recordStartupPerformance;
|
|
91
|
-
recordMemoryUsageModule = metricsJsModule.recordMemoryUsage;
|
|
92
|
-
recordCpuUsageModule = metricsJsModule.recordCpuUsage;
|
|
93
|
-
recordToolQueueDepthModule = metricsJsModule.recordToolQueueDepth;
|
|
94
|
-
recordToolExecutionBreakdownModule =
|
|
95
|
-
metricsJsModule.recordToolExecutionBreakdown;
|
|
96
|
-
recordTokenEfficiencyModule = metricsJsModule.recordTokenEfficiency;
|
|
97
|
-
recordApiRequestBreakdownModule = metricsJsModule.recordApiRequestBreakdown;
|
|
98
|
-
recordPerformanceScoreModule = metricsJsModule.recordPerformanceScore;
|
|
99
|
-
recordPerformanceRegressionModule =
|
|
100
|
-
metricsJsModule.recordPerformanceRegression;
|
|
101
|
-
recordBaselineComparisonModule = metricsJsModule.recordBaselineComparison;
|
|
102
|
-
recordGenAiClientTokenUsageModule =
|
|
103
|
-
metricsJsModule.recordGenAiClientTokenUsage;
|
|
104
|
-
recordGenAiClientOperationDurationModule =
|
|
105
|
-
metricsJsModule.recordGenAiClientOperationDuration;
|
|
106
|
-
recordFlickerFrameModule = metricsJsModule.recordFlickerFrame;
|
|
107
|
-
recordExitFailModule = metricsJsModule.recordExitFail;
|
|
108
|
-
recordAgentRunMetricsModule = metricsJsModule.recordAgentRunMetrics;
|
|
109
|
-
recordLinesChangedModule = metricsJsModule.recordLinesChanged;
|
|
110
|
-
recordSlowRenderModule = metricsJsModule.recordSlowRender;
|
|
111
|
-
const otelApiModule = await import('@opentelemetry/api');
|
|
112
|
-
mockCounterAddFn.mockClear();
|
|
113
|
-
mockCreateCounterFn.mockClear();
|
|
114
|
-
mockCreateHistogramFn.mockClear();
|
|
115
|
-
mockHistogramRecordFn.mockClear();
|
|
116
|
-
otelApiModule.metrics.getMeter.mockClear();
|
|
117
|
-
otelApiModule.metrics.getMeter.mockReturnValue(mockMeterInstance);
|
|
118
|
-
mockCreateCounterFn.mockReturnValue(mockCounterInstance);
|
|
119
|
-
mockCreateHistogramFn.mockReturnValue(mockHistogramInstance);
|
|
120
|
-
});
|
|
121
|
-
describe('recordFlickerFrame', () => {
|
|
122
|
-
it('does not record metrics if not initialized', () => {
|
|
123
|
-
const config = makeFakeConfig({});
|
|
124
|
-
recordFlickerFrameModule(config);
|
|
125
|
-
expect(mockCounterAddFn).not.toHaveBeenCalled();
|
|
126
|
-
});
|
|
127
|
-
it('records a flicker frame event when initialized', () => {
|
|
128
|
-
const config = makeFakeConfig({});
|
|
129
|
-
initializeMetricsModule(config);
|
|
130
|
-
recordFlickerFrameModule(config);
|
|
131
|
-
// Called for session, then for flicker
|
|
132
|
-
expect(mockCounterAddFn).toHaveBeenCalledTimes(2);
|
|
133
|
-
expect(mockCounterAddFn).toHaveBeenNthCalledWith(2, 1, {
|
|
134
|
-
'session.id': 'test-session-id',
|
|
135
|
-
'installation.id': 'test-installation-id',
|
|
136
|
-
'user.email': 'test@example.com',
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
describe('recordExitFail', () => {
|
|
141
|
-
it('does not record metrics if not initialized', () => {
|
|
142
|
-
const config = makeFakeConfig({});
|
|
143
|
-
recordExitFailModule(config);
|
|
144
|
-
expect(mockCounterAddFn).not.toHaveBeenCalled();
|
|
145
|
-
});
|
|
146
|
-
it('records a exit fail event when initialized', () => {
|
|
147
|
-
const config = makeFakeConfig({});
|
|
148
|
-
initializeMetricsModule(config);
|
|
149
|
-
recordExitFailModule(config);
|
|
150
|
-
// Called for session, then for exit fail
|
|
151
|
-
expect(mockCounterAddFn).toHaveBeenCalledTimes(2);
|
|
152
|
-
expect(mockCounterAddFn).toHaveBeenNthCalledWith(2, 1, {
|
|
153
|
-
'session.id': 'test-session-id',
|
|
154
|
-
'installation.id': 'test-installation-id',
|
|
155
|
-
'user.email': 'test@example.com',
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
describe('recordSlowRender', () => {
|
|
160
|
-
it('does not record metrics if not initialized', () => {
|
|
161
|
-
const config = makeFakeConfig({});
|
|
162
|
-
recordSlowRenderModule(config, 123);
|
|
163
|
-
expect(mockHistogramRecordFn).not.toHaveBeenCalled();
|
|
164
|
-
});
|
|
165
|
-
it('records a slow render event when initialized', () => {
|
|
166
|
-
const config = makeFakeConfig({});
|
|
167
|
-
initializeMetricsModule(config);
|
|
168
|
-
recordSlowRenderModule(config, 123);
|
|
169
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(123, {
|
|
170
|
-
'session.id': 'test-session-id',
|
|
171
|
-
'installation.id': 'test-installation-id',
|
|
172
|
-
'user.email': 'test@example.com',
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
describe('initializeMetrics', () => {
|
|
177
|
-
const mockConfig = {
|
|
178
|
-
getSessionId: () => 'test-session-id',
|
|
179
|
-
getTelemetryEnabled: () => true,
|
|
180
|
-
};
|
|
181
|
-
it('should apply common attributes including email', () => {
|
|
182
|
-
initializeMetricsModule(mockConfig);
|
|
183
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(1, {
|
|
184
|
-
'session.id': 'test-session-id',
|
|
185
|
-
'installation.id': 'test-installation-id',
|
|
186
|
-
'user.email': 'test@example.com',
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
describe('recordChatCompressionMetrics', () => {
|
|
191
|
-
it('does not record metrics if not initialized', () => {
|
|
192
|
-
const lol = makeFakeConfig({});
|
|
193
|
-
recordChatCompressionMetricsModule(lol, {
|
|
194
|
-
tokens_after: 100,
|
|
195
|
-
tokens_before: 200,
|
|
196
|
-
});
|
|
197
|
-
expect(mockCounterAddFn).not.toHaveBeenCalled();
|
|
198
|
-
});
|
|
199
|
-
it('records token compression with the correct attributes', () => {
|
|
200
|
-
const config = makeFakeConfig({});
|
|
201
|
-
initializeMetricsModule(config);
|
|
202
|
-
recordChatCompressionMetricsModule(config, {
|
|
203
|
-
tokens_after: 100,
|
|
204
|
-
tokens_before: 200,
|
|
205
|
-
});
|
|
206
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(1, {
|
|
207
|
-
'session.id': 'test-session-id',
|
|
208
|
-
'installation.id': 'test-installation-id',
|
|
209
|
-
'user.email': 'test@example.com',
|
|
210
|
-
tokens_after: 100,
|
|
211
|
-
tokens_before: 200,
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
describe('recordTokenUsageMetrics', () => {
|
|
216
|
-
const mockConfig = {
|
|
217
|
-
getSessionId: () => 'test-session-id',
|
|
218
|
-
getTelemetryEnabled: () => true,
|
|
219
|
-
};
|
|
220
|
-
it('should not record metrics if not initialized', () => {
|
|
221
|
-
recordTokenUsageMetricsModule(mockConfig, 100, {
|
|
222
|
-
model: 'gemini-pro',
|
|
223
|
-
type: 'input',
|
|
224
|
-
});
|
|
225
|
-
expect(mockCounterAddFn).not.toHaveBeenCalled();
|
|
226
|
-
});
|
|
227
|
-
it.each([
|
|
228
|
-
{ type: 'input', tokens: 100, model: 'gemini-pro' },
|
|
229
|
-
{ type: 'output', tokens: 50, model: 'gemini-pro' },
|
|
230
|
-
{ type: 'thought', tokens: 25, model: 'gemini-pro' },
|
|
231
|
-
{ type: 'cache', tokens: 75, model: 'gemini-pro' },
|
|
232
|
-
{ type: 'tool', tokens: 125, model: 'gemini-pro' },
|
|
233
|
-
{ type: 'input', tokens: 200, model: 'gemini-different-model' },
|
|
234
|
-
])('should record token usage for $type type with $tokens tokens for model $model', ({ type, tokens, model }) => {
|
|
235
|
-
initializeMetricsModule(mockConfig);
|
|
236
|
-
mockCounterAddFn.mockClear();
|
|
237
|
-
recordTokenUsageMetricsModule(mockConfig, tokens, {
|
|
238
|
-
model,
|
|
239
|
-
type: type,
|
|
240
|
-
});
|
|
241
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(tokens, {
|
|
242
|
-
'session.id': 'test-session-id',
|
|
243
|
-
'installation.id': 'test-installation-id',
|
|
244
|
-
'user.email': 'test@example.com',
|
|
245
|
-
model,
|
|
246
|
-
type,
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
describe('recordLinesChanged metric', () => {
|
|
251
|
-
const mockConfig = {
|
|
252
|
-
getSessionId: () => 'test-session-id',
|
|
253
|
-
getTelemetryEnabled: () => true,
|
|
254
|
-
};
|
|
255
|
-
it('should not record lines added/removed if not initialized', () => {
|
|
256
|
-
recordLinesChangedModule(mockConfig, 10, 'added', {
|
|
257
|
-
function_name: 'fn',
|
|
258
|
-
});
|
|
259
|
-
recordLinesChangedModule(mockConfig, 5, 'removed', {
|
|
260
|
-
function_name: 'fn',
|
|
261
|
-
});
|
|
262
|
-
expect(mockCounterAddFn).not.toHaveBeenCalled();
|
|
263
|
-
});
|
|
264
|
-
it('should record lines added with function_name after initialization', () => {
|
|
265
|
-
initializeMetricsModule(mockConfig);
|
|
266
|
-
mockCounterAddFn.mockClear();
|
|
267
|
-
recordLinesChangedModule(mockConfig, 10, 'added', {
|
|
268
|
-
function_name: 'my-fn',
|
|
269
|
-
});
|
|
270
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(10, {
|
|
271
|
-
'session.id': 'test-session-id',
|
|
272
|
-
'installation.id': 'test-installation-id',
|
|
273
|
-
'user.email': 'test@example.com',
|
|
274
|
-
type: 'added',
|
|
275
|
-
function_name: 'my-fn',
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
it('should record lines removed with function_name after initialization', () => {
|
|
279
|
-
initializeMetricsModule(mockConfig);
|
|
280
|
-
mockCounterAddFn.mockClear();
|
|
281
|
-
recordLinesChangedModule(mockConfig, 7, 'removed', {
|
|
282
|
-
function_name: 'my-fn',
|
|
283
|
-
});
|
|
284
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(7, {
|
|
285
|
-
'session.id': 'test-session-id',
|
|
286
|
-
'installation.id': 'test-installation-id',
|
|
287
|
-
'user.email': 'test@example.com',
|
|
288
|
-
type: 'removed',
|
|
289
|
-
function_name: 'my-fn',
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
describe('recordFileOperationMetric', () => {
|
|
294
|
-
const mockConfig = {
|
|
295
|
-
getSessionId: () => 'test-session-id',
|
|
296
|
-
getTelemetryEnabled: () => true,
|
|
297
|
-
};
|
|
298
|
-
it.each([
|
|
299
|
-
{
|
|
300
|
-
name: 'should not record metrics if not initialized',
|
|
301
|
-
initialized: false,
|
|
302
|
-
attributes: {
|
|
303
|
-
operation: FileOperation.CREATE,
|
|
304
|
-
lines: 10,
|
|
305
|
-
mimetype: 'text/plain',
|
|
306
|
-
extension: 'txt',
|
|
307
|
-
},
|
|
308
|
-
shouldCall: false,
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
name: 'should record file creation with all attributes',
|
|
312
|
-
initialized: true,
|
|
313
|
-
attributes: {
|
|
314
|
-
operation: FileOperation.CREATE,
|
|
315
|
-
lines: 10,
|
|
316
|
-
mimetype: 'text/plain',
|
|
317
|
-
extension: 'txt',
|
|
318
|
-
},
|
|
319
|
-
shouldCall: true,
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
name: 'should record file read with minimal attributes',
|
|
323
|
-
initialized: true,
|
|
324
|
-
attributes: { operation: FileOperation.READ },
|
|
325
|
-
shouldCall: true,
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
name: 'should record file update with some attributes',
|
|
329
|
-
initialized: true,
|
|
330
|
-
attributes: {
|
|
331
|
-
operation: FileOperation.UPDATE,
|
|
332
|
-
mimetype: 'application/javascript',
|
|
333
|
-
},
|
|
334
|
-
shouldCall: true,
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
name: 'should record file update with no optional attributes',
|
|
338
|
-
initialized: true,
|
|
339
|
-
attributes: { operation: FileOperation.UPDATE },
|
|
340
|
-
shouldCall: true,
|
|
341
|
-
},
|
|
342
|
-
])('$name', ({ initialized, attributes, shouldCall }) => {
|
|
343
|
-
if (initialized) {
|
|
344
|
-
initializeMetricsModule(mockConfig);
|
|
345
|
-
// The session start event also calls the counter.
|
|
346
|
-
mockCounterAddFn.mockClear();
|
|
347
|
-
}
|
|
348
|
-
recordFileOperationMetricModule(mockConfig, attributes);
|
|
349
|
-
if (shouldCall) {
|
|
350
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(1, {
|
|
351
|
-
'session.id': 'test-session-id',
|
|
352
|
-
'installation.id': 'test-installation-id',
|
|
353
|
-
'user.email': 'test@example.com',
|
|
354
|
-
...attributes,
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
expect(mockCounterAddFn).not.toHaveBeenCalled();
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
});
|
|
362
|
-
describe('recordModelRoutingMetrics', () => {
|
|
363
|
-
const mockConfig = {
|
|
364
|
-
getSessionId: () => 'test-session-id',
|
|
365
|
-
getTelemetryEnabled: () => true,
|
|
366
|
-
};
|
|
367
|
-
it('should not record metrics if not initialized', () => {
|
|
368
|
-
const event = new ModelRoutingEvent('gemini-pro', 'default', 100, 'test-reason', false, undefined);
|
|
369
|
-
recordModelRoutingMetricsModule(mockConfig, event);
|
|
370
|
-
expect(mockHistogramRecordFn).not.toHaveBeenCalled();
|
|
371
|
-
expect(mockCounterAddFn).not.toHaveBeenCalled();
|
|
372
|
-
});
|
|
373
|
-
it('should record latency for a successful routing decision', () => {
|
|
374
|
-
initializeMetricsModule(mockConfig);
|
|
375
|
-
const event = new ModelRoutingEvent('gemini-pro', 'default', 150, 'test-reason', false, undefined);
|
|
376
|
-
recordModelRoutingMetricsModule(mockConfig, event);
|
|
377
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(150, {
|
|
378
|
-
'session.id': 'test-session-id',
|
|
379
|
-
'installation.id': 'test-installation-id',
|
|
380
|
-
'user.email': 'test@example.com',
|
|
381
|
-
'routing.decision_model': 'gemini-pro',
|
|
382
|
-
'routing.decision_source': 'default',
|
|
383
|
-
'routing.failed': false,
|
|
384
|
-
'routing.reasoning': 'test-reason',
|
|
385
|
-
});
|
|
386
|
-
// The session counter is called once on init
|
|
387
|
-
expect(mockCounterAddFn).toHaveBeenCalledTimes(1);
|
|
388
|
-
});
|
|
389
|
-
it('should record latency and failure for a failed routing decision', () => {
|
|
390
|
-
initializeMetricsModule(mockConfig);
|
|
391
|
-
const event = new ModelRoutingEvent('gemini-pro', 'classifier', 200, 'test-reason', true, 'test-error');
|
|
392
|
-
recordModelRoutingMetricsModule(mockConfig, event);
|
|
393
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(200, {
|
|
394
|
-
'session.id': 'test-session-id',
|
|
395
|
-
'installation.id': 'test-installation-id',
|
|
396
|
-
'user.email': 'test@example.com',
|
|
397
|
-
'routing.decision_model': 'gemini-pro',
|
|
398
|
-
'routing.decision_source': 'classifier',
|
|
399
|
-
'routing.failed': true,
|
|
400
|
-
'routing.reasoning': 'test-reason',
|
|
401
|
-
});
|
|
402
|
-
expect(mockCounterAddFn).toHaveBeenCalledTimes(2);
|
|
403
|
-
expect(mockCounterAddFn).toHaveBeenNthCalledWith(2, 1, {
|
|
404
|
-
'session.id': 'test-session-id',
|
|
405
|
-
'installation.id': 'test-installation-id',
|
|
406
|
-
'user.email': 'test@example.com',
|
|
407
|
-
'routing.decision_model': 'gemini-pro',
|
|
408
|
-
'routing.decision_source': 'classifier',
|
|
409
|
-
'routing.failed': true,
|
|
410
|
-
'routing.reasoning': 'test-reason',
|
|
411
|
-
'routing.error_message': 'test-error',
|
|
412
|
-
});
|
|
413
|
-
});
|
|
414
|
-
});
|
|
415
|
-
describe('recordAgentRunMetrics', () => {
|
|
416
|
-
const mockConfig = {
|
|
417
|
-
getSessionId: () => 'test-session-id',
|
|
418
|
-
getTelemetryEnabled: () => true,
|
|
419
|
-
};
|
|
420
|
-
it('should not record metrics if not initialized', () => {
|
|
421
|
-
const event = new AgentFinishEvent('agent-123', 'TestAgent', 1000, 5, AgentTerminateMode.GOAL);
|
|
422
|
-
recordAgentRunMetricsModule(mockConfig, event);
|
|
423
|
-
expect(mockCounterAddFn).not.toHaveBeenCalled();
|
|
424
|
-
expect(mockHistogramRecordFn).not.toHaveBeenCalled();
|
|
425
|
-
});
|
|
426
|
-
it('should record agent run metrics', () => {
|
|
427
|
-
initializeMetricsModule(mockConfig);
|
|
428
|
-
mockCounterAddFn.mockClear();
|
|
429
|
-
mockHistogramRecordFn.mockClear();
|
|
430
|
-
const event = new AgentFinishEvent('agent-123', 'TestAgent', 1000, 5, AgentTerminateMode.GOAL);
|
|
431
|
-
recordAgentRunMetricsModule(mockConfig, event);
|
|
432
|
-
// Verify agent run counter
|
|
433
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(1, {
|
|
434
|
-
'session.id': 'test-session-id',
|
|
435
|
-
'installation.id': 'test-installation-id',
|
|
436
|
-
'user.email': 'test@example.com',
|
|
437
|
-
agent_name: 'TestAgent',
|
|
438
|
-
terminate_reason: 'GOAL',
|
|
439
|
-
});
|
|
440
|
-
// Verify agent duration histogram
|
|
441
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(1000, {
|
|
442
|
-
'session.id': 'test-session-id',
|
|
443
|
-
'installation.id': 'test-installation-id',
|
|
444
|
-
'user.email': 'test@example.com',
|
|
445
|
-
agent_name: 'TestAgent',
|
|
446
|
-
});
|
|
447
|
-
// Verify agent turns histogram
|
|
448
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(5, {
|
|
449
|
-
'session.id': 'test-session-id',
|
|
450
|
-
'installation.id': 'test-installation-id',
|
|
451
|
-
'user.email': 'test@example.com',
|
|
452
|
-
agent_name: 'TestAgent',
|
|
453
|
-
});
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
describe('OpenTelemetry GenAI Semantic Convention Metrics', () => {
|
|
457
|
-
const mockConfig = {
|
|
458
|
-
getSessionId: () => 'test-session-id',
|
|
459
|
-
getTelemetryEnabled: () => true,
|
|
460
|
-
};
|
|
461
|
-
describe('recordGenAiClientTokenUsage', () => {
|
|
462
|
-
it('should not record metrics when not initialized', () => {
|
|
463
|
-
recordGenAiClientTokenUsageModule(mockConfig, 100, {
|
|
464
|
-
'gen_ai.operation.name': 'generate_content',
|
|
465
|
-
'gen_ai.provider.name': 'gcp.gen_ai',
|
|
466
|
-
'gen_ai.token.type': 'input',
|
|
467
|
-
});
|
|
468
|
-
expect(mockHistogramRecordFn).not.toHaveBeenCalled();
|
|
469
|
-
});
|
|
470
|
-
it('should record input token usage with correct attributes', () => {
|
|
471
|
-
initializeMetricsModule(mockConfig);
|
|
472
|
-
mockHistogramRecordFn.mockClear();
|
|
473
|
-
recordGenAiClientTokenUsageModule(mockConfig, 150, {
|
|
474
|
-
'gen_ai.operation.name': 'generate_content',
|
|
475
|
-
'gen_ai.provider.name': 'gcp.gen_ai',
|
|
476
|
-
'gen_ai.token.type': 'input',
|
|
477
|
-
'gen_ai.request.model': 'gemini-2.0-flash',
|
|
478
|
-
'gen_ai.response.model': 'gemini-2.0-flash',
|
|
479
|
-
});
|
|
480
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(150, {
|
|
481
|
-
'session.id': 'test-session-id',
|
|
482
|
-
'installation.id': 'test-installation-id',
|
|
483
|
-
'user.email': 'test@example.com',
|
|
484
|
-
'gen_ai.operation.name': 'generate_content',
|
|
485
|
-
'gen_ai.provider.name': 'gcp.gen_ai',
|
|
486
|
-
'gen_ai.token.type': 'input',
|
|
487
|
-
'gen_ai.request.model': 'gemini-2.0-flash',
|
|
488
|
-
'gen_ai.response.model': 'gemini-2.0-flash',
|
|
489
|
-
});
|
|
490
|
-
});
|
|
491
|
-
it('should record output token usage with correct attributes', () => {
|
|
492
|
-
initializeMetricsModule(mockConfig);
|
|
493
|
-
mockHistogramRecordFn.mockClear();
|
|
494
|
-
recordGenAiClientTokenUsageModule(mockConfig, 75, {
|
|
495
|
-
'gen_ai.operation.name': 'generate_content',
|
|
496
|
-
'gen_ai.provider.name': 'gcp.vertex_ai',
|
|
497
|
-
'gen_ai.token.type': 'output',
|
|
498
|
-
'gen_ai.request.model': 'gemini-pro',
|
|
499
|
-
});
|
|
500
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(75, {
|
|
501
|
-
'session.id': 'test-session-id',
|
|
502
|
-
'installation.id': 'test-installation-id',
|
|
503
|
-
'user.email': 'test@example.com',
|
|
504
|
-
'gen_ai.operation.name': 'generate_content',
|
|
505
|
-
'gen_ai.provider.name': 'gcp.vertex_ai',
|
|
506
|
-
'gen_ai.token.type': 'output',
|
|
507
|
-
'gen_ai.request.model': 'gemini-pro',
|
|
508
|
-
});
|
|
509
|
-
});
|
|
510
|
-
it('should record token usage with optional attributes', () => {
|
|
511
|
-
initializeMetricsModule(mockConfig);
|
|
512
|
-
mockHistogramRecordFn.mockClear();
|
|
513
|
-
recordGenAiClientTokenUsageModule(mockConfig, 200, {
|
|
514
|
-
'gen_ai.operation.name': 'generate_content',
|
|
515
|
-
'gen_ai.provider.name': 'gcp.vertex_ai',
|
|
516
|
-
'gen_ai.token.type': 'input',
|
|
517
|
-
'gen_ai.request.model': 'text-embedding-004',
|
|
518
|
-
'server.address': 'aiplatform.googleapis.com',
|
|
519
|
-
'server.port': 443,
|
|
520
|
-
});
|
|
521
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(200, {
|
|
522
|
-
'session.id': 'test-session-id',
|
|
523
|
-
'installation.id': 'test-installation-id',
|
|
524
|
-
'user.email': 'test@example.com',
|
|
525
|
-
'gen_ai.operation.name': 'generate_content',
|
|
526
|
-
'gen_ai.provider.name': 'gcp.vertex_ai',
|
|
527
|
-
'gen_ai.token.type': 'input',
|
|
528
|
-
'gen_ai.request.model': 'text-embedding-004',
|
|
529
|
-
'server.address': 'aiplatform.googleapis.com',
|
|
530
|
-
'server.port': 443,
|
|
531
|
-
});
|
|
532
|
-
});
|
|
533
|
-
});
|
|
534
|
-
describe('recordGenAiClientOperationDuration', () => {
|
|
535
|
-
it('should not record metrics when not initialized', () => {
|
|
536
|
-
recordGenAiClientOperationDurationModule(mockConfig, 2.5, {
|
|
537
|
-
'gen_ai.operation.name': 'generate_content',
|
|
538
|
-
'gen_ai.provider.name': 'gcp.gen_ai',
|
|
539
|
-
});
|
|
540
|
-
expect(mockHistogramRecordFn).not.toHaveBeenCalled();
|
|
541
|
-
});
|
|
542
|
-
it('should record successful operation duration with correct attributes', () => {
|
|
543
|
-
initializeMetricsModule(mockConfig);
|
|
544
|
-
mockHistogramRecordFn.mockClear();
|
|
545
|
-
recordGenAiClientOperationDurationModule(mockConfig, 1.25, {
|
|
546
|
-
'gen_ai.operation.name': 'generate_content',
|
|
547
|
-
'gen_ai.provider.name': 'gcp.gen_ai',
|
|
548
|
-
'gen_ai.request.model': 'gemini-2.0-flash',
|
|
549
|
-
'gen_ai.response.model': 'gemini-2.0-flash',
|
|
550
|
-
});
|
|
551
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(1.25, {
|
|
552
|
-
'session.id': 'test-session-id',
|
|
553
|
-
'installation.id': 'test-installation-id',
|
|
554
|
-
'user.email': 'test@example.com',
|
|
555
|
-
'gen_ai.operation.name': 'generate_content',
|
|
556
|
-
'gen_ai.provider.name': 'gcp.gen_ai',
|
|
557
|
-
'gen_ai.request.model': 'gemini-2.0-flash',
|
|
558
|
-
'gen_ai.response.model': 'gemini-2.0-flash',
|
|
559
|
-
});
|
|
560
|
-
});
|
|
561
|
-
it('should record failed operation duration with error type', () => {
|
|
562
|
-
initializeMetricsModule(mockConfig);
|
|
563
|
-
mockHistogramRecordFn.mockClear();
|
|
564
|
-
recordGenAiClientOperationDurationModule(mockConfig, 3.75, {
|
|
565
|
-
'gen_ai.operation.name': 'generate_content',
|
|
566
|
-
'gen_ai.provider.name': 'gcp.vertex_ai',
|
|
567
|
-
'gen_ai.request.model': 'gemini-pro',
|
|
568
|
-
'error.type': 'quota_exceeded',
|
|
569
|
-
});
|
|
570
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(3.75, {
|
|
571
|
-
'session.id': 'test-session-id',
|
|
572
|
-
'installation.id': 'test-installation-id',
|
|
573
|
-
'user.email': 'test@example.com',
|
|
574
|
-
'gen_ai.operation.name': 'generate_content',
|
|
575
|
-
'gen_ai.provider.name': 'gcp.vertex_ai',
|
|
576
|
-
'gen_ai.request.model': 'gemini-pro',
|
|
577
|
-
'error.type': 'quota_exceeded',
|
|
578
|
-
});
|
|
579
|
-
});
|
|
580
|
-
it('should record operation duration with server details', () => {
|
|
581
|
-
initializeMetricsModule(mockConfig);
|
|
582
|
-
mockHistogramRecordFn.mockClear();
|
|
583
|
-
recordGenAiClientOperationDurationModule(mockConfig, 0.95, {
|
|
584
|
-
'gen_ai.operation.name': 'generate_content',
|
|
585
|
-
'gen_ai.provider.name': 'gcp.vertex_ai',
|
|
586
|
-
'gen_ai.request.model': 'gemini-1.5-pro',
|
|
587
|
-
'gen_ai.response.model': 'gemini-1.5-pro-001',
|
|
588
|
-
'server.address': 'us-central1-aiplatform.googleapis.com',
|
|
589
|
-
'server.port': 443,
|
|
590
|
-
});
|
|
591
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(0.95, {
|
|
592
|
-
'session.id': 'test-session-id',
|
|
593
|
-
'installation.id': 'test-installation-id',
|
|
594
|
-
'user.email': 'test@example.com',
|
|
595
|
-
'gen_ai.operation.name': 'generate_content',
|
|
596
|
-
'gen_ai.provider.name': 'gcp.vertex_ai',
|
|
597
|
-
'gen_ai.request.model': 'gemini-1.5-pro',
|
|
598
|
-
'gen_ai.response.model': 'gemini-1.5-pro-001',
|
|
599
|
-
'server.address': 'us-central1-aiplatform.googleapis.com',
|
|
600
|
-
'server.port': 443,
|
|
601
|
-
});
|
|
602
|
-
});
|
|
603
|
-
it('should handle minimal required attributes', () => {
|
|
604
|
-
initializeMetricsModule(mockConfig);
|
|
605
|
-
mockHistogramRecordFn.mockClear();
|
|
606
|
-
recordGenAiClientOperationDurationModule(mockConfig, 2.1, {
|
|
607
|
-
'gen_ai.operation.name': 'generate_content',
|
|
608
|
-
'gen_ai.provider.name': 'gcp.gen_ai',
|
|
609
|
-
});
|
|
610
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(2.1, {
|
|
611
|
-
'session.id': 'test-session-id',
|
|
612
|
-
'installation.id': 'test-installation-id',
|
|
613
|
-
'user.email': 'test@example.com',
|
|
614
|
-
'gen_ai.operation.name': 'generate_content',
|
|
615
|
-
'gen_ai.provider.name': 'gcp.gen_ai',
|
|
616
|
-
});
|
|
617
|
-
});
|
|
618
|
-
});
|
|
619
|
-
});
|
|
620
|
-
describe('Performance Monitoring Metrics', () => {
|
|
621
|
-
const mockConfig = {
|
|
622
|
-
getSessionId: () => 'test-session-id',
|
|
623
|
-
getTelemetryEnabled: () => true,
|
|
624
|
-
};
|
|
625
|
-
describe('recordStartupPerformance', () => {
|
|
626
|
-
it('should not record metrics when performance monitoring is disabled', async () => {
|
|
627
|
-
// Re-import with performance monitoring disabled by mocking the config
|
|
628
|
-
const mockConfigDisabled = {
|
|
629
|
-
getSessionId: () => 'test-session-id',
|
|
630
|
-
getTelemetryEnabled: () => false, // Disable telemetry to disable performance monitoring
|
|
631
|
-
};
|
|
632
|
-
initializeMetricsModule(mockConfigDisabled);
|
|
633
|
-
mockHistogramRecordFn.mockClear();
|
|
634
|
-
recordStartupPerformanceModule(mockConfigDisabled, 100, {
|
|
635
|
-
phase: 'settings_loading',
|
|
636
|
-
details: {
|
|
637
|
-
auth_type: 'gemini',
|
|
638
|
-
},
|
|
639
|
-
});
|
|
640
|
-
expect(mockHistogramRecordFn).not.toHaveBeenCalled();
|
|
641
|
-
});
|
|
642
|
-
it('should record startup performance with phase and details', () => {
|
|
643
|
-
initializeMetricsModule(mockConfig);
|
|
644
|
-
mockHistogramRecordFn.mockClear();
|
|
645
|
-
recordStartupPerformanceModule(mockConfig, 150, {
|
|
646
|
-
phase: 'settings_loading',
|
|
647
|
-
details: {
|
|
648
|
-
auth_type: 'gemini',
|
|
649
|
-
telemetry_enabled: true,
|
|
650
|
-
settings_sources: 2,
|
|
651
|
-
},
|
|
652
|
-
});
|
|
653
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(150, {
|
|
654
|
-
'session.id': 'test-session-id',
|
|
655
|
-
'installation.id': 'test-installation-id',
|
|
656
|
-
'user.email': 'test@example.com',
|
|
657
|
-
phase: 'settings_loading',
|
|
658
|
-
auth_type: 'gemini',
|
|
659
|
-
telemetry_enabled: true,
|
|
660
|
-
settings_sources: 2,
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
it('should record startup performance without details', () => {
|
|
664
|
-
initializeMetricsModule(mockConfig);
|
|
665
|
-
mockHistogramRecordFn.mockClear();
|
|
666
|
-
recordStartupPerformanceModule(mockConfig, 50, { phase: 'cleanup' });
|
|
667
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(50, {
|
|
668
|
-
'session.id': 'test-session-id',
|
|
669
|
-
'installation.id': 'test-installation-id',
|
|
670
|
-
'user.email': 'test@example.com',
|
|
671
|
-
phase: 'cleanup',
|
|
672
|
-
});
|
|
673
|
-
});
|
|
674
|
-
it('should handle floating-point duration values from performance.now()', () => {
|
|
675
|
-
initializeMetricsModule(mockConfig);
|
|
676
|
-
mockHistogramRecordFn.mockClear();
|
|
677
|
-
// Test with realistic floating-point values that performance.now() would return
|
|
678
|
-
const floatingPointDuration = 123.45678;
|
|
679
|
-
recordStartupPerformanceModule(mockConfig, floatingPointDuration, {
|
|
680
|
-
phase: 'total_startup',
|
|
681
|
-
details: {
|
|
682
|
-
is_tty: true,
|
|
683
|
-
has_question: false,
|
|
684
|
-
},
|
|
685
|
-
});
|
|
686
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(floatingPointDuration, {
|
|
687
|
-
'session.id': 'test-session-id',
|
|
688
|
-
'installation.id': 'test-installation-id',
|
|
689
|
-
'user.email': 'test@example.com',
|
|
690
|
-
phase: 'total_startup',
|
|
691
|
-
is_tty: true,
|
|
692
|
-
has_question: false,
|
|
693
|
-
});
|
|
694
|
-
});
|
|
695
|
-
});
|
|
696
|
-
describe('recordMemoryUsage', () => {
|
|
697
|
-
it.each([
|
|
698
|
-
{
|
|
699
|
-
memory_type: MemoryMetricType.HEAP_USED,
|
|
700
|
-
component: 'startup',
|
|
701
|
-
value: 15728640,
|
|
702
|
-
},
|
|
703
|
-
{
|
|
704
|
-
memory_type: MemoryMetricType.HEAP_TOTAL,
|
|
705
|
-
component: 'api_call',
|
|
706
|
-
value: 31457280,
|
|
707
|
-
},
|
|
708
|
-
{
|
|
709
|
-
memory_type: MemoryMetricType.EXTERNAL,
|
|
710
|
-
component: 'tool_execution',
|
|
711
|
-
value: 2097152,
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
memory_type: MemoryMetricType.RSS,
|
|
715
|
-
component: 'memory_monitor',
|
|
716
|
-
value: 41943040,
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
memory_type: MemoryMetricType.HEAP_USED,
|
|
720
|
-
component: undefined,
|
|
721
|
-
value: 15728640,
|
|
722
|
-
},
|
|
723
|
-
])('should record memory usage for $memory_type', ({ memory_type, component, value }) => {
|
|
724
|
-
initializeMetricsModule(mockConfig);
|
|
725
|
-
mockHistogramRecordFn.mockClear();
|
|
726
|
-
recordMemoryUsageModule(mockConfig, value, {
|
|
727
|
-
memory_type,
|
|
728
|
-
component,
|
|
729
|
-
});
|
|
730
|
-
const expectedAttributes = {
|
|
731
|
-
'session.id': 'test-session-id',
|
|
732
|
-
'installation.id': 'test-installation-id',
|
|
733
|
-
'user.email': 'test@example.com',
|
|
734
|
-
memory_type,
|
|
735
|
-
};
|
|
736
|
-
if (component) {
|
|
737
|
-
expectedAttributes['component'] = component;
|
|
738
|
-
}
|
|
739
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(value, expectedAttributes);
|
|
740
|
-
});
|
|
741
|
-
});
|
|
742
|
-
describe('recordCpuUsage', () => {
|
|
743
|
-
it('should record CPU usage percentage', () => {
|
|
744
|
-
initializeMetricsModule(mockConfig);
|
|
745
|
-
mockHistogramRecordFn.mockClear();
|
|
746
|
-
recordCpuUsageModule(mockConfig, 85.5, {
|
|
747
|
-
component: 'tool_execution',
|
|
748
|
-
});
|
|
749
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(85.5, {
|
|
750
|
-
'session.id': 'test-session-id',
|
|
751
|
-
'installation.id': 'test-installation-id',
|
|
752
|
-
'user.email': 'test@example.com',
|
|
753
|
-
component: 'tool_execution',
|
|
754
|
-
});
|
|
755
|
-
});
|
|
756
|
-
it('should record CPU usage without component', () => {
|
|
757
|
-
initializeMetricsModule(mockConfig);
|
|
758
|
-
mockHistogramRecordFn.mockClear();
|
|
759
|
-
recordCpuUsageModule(mockConfig, 42.3, {});
|
|
760
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(42.3, {
|
|
761
|
-
'session.id': 'test-session-id',
|
|
762
|
-
'installation.id': 'test-installation-id',
|
|
763
|
-
'user.email': 'test@example.com',
|
|
764
|
-
});
|
|
765
|
-
});
|
|
766
|
-
});
|
|
767
|
-
describe('recordToolQueueDepth', () => {
|
|
768
|
-
it('should record tool queue depth', () => {
|
|
769
|
-
initializeMetricsModule(mockConfig);
|
|
770
|
-
mockHistogramRecordFn.mockClear();
|
|
771
|
-
recordToolQueueDepthModule(mockConfig, 3);
|
|
772
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(3, {
|
|
773
|
-
'session.id': 'test-session-id',
|
|
774
|
-
'installation.id': 'test-installation-id',
|
|
775
|
-
'user.email': 'test@example.com',
|
|
776
|
-
});
|
|
777
|
-
});
|
|
778
|
-
it('should record zero queue depth', () => {
|
|
779
|
-
initializeMetricsModule(mockConfig);
|
|
780
|
-
mockHistogramRecordFn.mockClear();
|
|
781
|
-
recordToolQueueDepthModule(mockConfig, 0);
|
|
782
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(0, {
|
|
783
|
-
'session.id': 'test-session-id',
|
|
784
|
-
'installation.id': 'test-installation-id',
|
|
785
|
-
'user.email': 'test@example.com',
|
|
786
|
-
});
|
|
787
|
-
});
|
|
788
|
-
});
|
|
789
|
-
describe('recordToolExecutionBreakdown', () => {
|
|
790
|
-
it('should record tool execution breakdown for all phases', () => {
|
|
791
|
-
initializeMetricsModule(mockConfig);
|
|
792
|
-
mockHistogramRecordFn.mockClear();
|
|
793
|
-
recordToolExecutionBreakdownModule(mockConfig, 25, {
|
|
794
|
-
function_name: 'Read',
|
|
795
|
-
phase: ToolExecutionPhase.VALIDATION,
|
|
796
|
-
});
|
|
797
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(25, {
|
|
798
|
-
'session.id': 'test-session-id',
|
|
799
|
-
'installation.id': 'test-installation-id',
|
|
800
|
-
'user.email': 'test@example.com',
|
|
801
|
-
function_name: 'Read',
|
|
802
|
-
phase: 'validation',
|
|
803
|
-
});
|
|
804
|
-
});
|
|
805
|
-
it('should record execution breakdown for different phases', () => {
|
|
806
|
-
initializeMetricsModule(mockConfig);
|
|
807
|
-
mockHistogramRecordFn.mockClear();
|
|
808
|
-
recordToolExecutionBreakdownModule(mockConfig, 50, {
|
|
809
|
-
function_name: 'Bash',
|
|
810
|
-
phase: ToolExecutionPhase.PREPARATION,
|
|
811
|
-
});
|
|
812
|
-
recordToolExecutionBreakdownModule(mockConfig, 1500, {
|
|
813
|
-
function_name: 'Bash',
|
|
814
|
-
phase: ToolExecutionPhase.EXECUTION,
|
|
815
|
-
});
|
|
816
|
-
recordToolExecutionBreakdownModule(mockConfig, 75, {
|
|
817
|
-
function_name: 'Bash',
|
|
818
|
-
phase: ToolExecutionPhase.RESULT_PROCESSING,
|
|
819
|
-
});
|
|
820
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledTimes(3); // One for each call
|
|
821
|
-
expect(mockHistogramRecordFn).toHaveBeenNthCalledWith(1, 50, {
|
|
822
|
-
'session.id': 'test-session-id',
|
|
823
|
-
'installation.id': 'test-installation-id',
|
|
824
|
-
'user.email': 'test@example.com',
|
|
825
|
-
function_name: 'Bash',
|
|
826
|
-
phase: 'preparation',
|
|
827
|
-
});
|
|
828
|
-
expect(mockHistogramRecordFn).toHaveBeenNthCalledWith(2, 1500, {
|
|
829
|
-
'session.id': 'test-session-id',
|
|
830
|
-
'installation.id': 'test-installation-id',
|
|
831
|
-
'user.email': 'test@example.com',
|
|
832
|
-
function_name: 'Bash',
|
|
833
|
-
phase: 'execution',
|
|
834
|
-
});
|
|
835
|
-
expect(mockHistogramRecordFn).toHaveBeenNthCalledWith(3, 75, {
|
|
836
|
-
'session.id': 'test-session-id',
|
|
837
|
-
'installation.id': 'test-installation-id',
|
|
838
|
-
'user.email': 'test@example.com',
|
|
839
|
-
function_name: 'Bash',
|
|
840
|
-
phase: 'result_processing',
|
|
841
|
-
});
|
|
842
|
-
});
|
|
843
|
-
});
|
|
844
|
-
describe('recordTokenEfficiency', () => {
|
|
845
|
-
it('should record token efficiency metrics', () => {
|
|
846
|
-
initializeMetricsModule(mockConfig);
|
|
847
|
-
mockHistogramRecordFn.mockClear();
|
|
848
|
-
recordTokenEfficiencyModule(mockConfig, 0.85, {
|
|
849
|
-
model: 'gemini-pro',
|
|
850
|
-
metric: 'cache_hit_rate',
|
|
851
|
-
context: 'api_request',
|
|
852
|
-
});
|
|
853
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(0.85, {
|
|
854
|
-
'session.id': 'test-session-id',
|
|
855
|
-
'installation.id': 'test-installation-id',
|
|
856
|
-
'user.email': 'test@example.com',
|
|
857
|
-
model: 'gemini-pro',
|
|
858
|
-
metric: 'cache_hit_rate',
|
|
859
|
-
context: 'api_request',
|
|
860
|
-
});
|
|
861
|
-
});
|
|
862
|
-
it('should record token efficiency without context', () => {
|
|
863
|
-
initializeMetricsModule(mockConfig);
|
|
864
|
-
mockHistogramRecordFn.mockClear();
|
|
865
|
-
recordTokenEfficiencyModule(mockConfig, 125.5, {
|
|
866
|
-
model: 'gemini-pro',
|
|
867
|
-
metric: 'tokens_per_operation',
|
|
868
|
-
});
|
|
869
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(125.5, {
|
|
870
|
-
'session.id': 'test-session-id',
|
|
871
|
-
'installation.id': 'test-installation-id',
|
|
872
|
-
'user.email': 'test@example.com',
|
|
873
|
-
model: 'gemini-pro',
|
|
874
|
-
metric: 'tokens_per_operation',
|
|
875
|
-
});
|
|
876
|
-
});
|
|
877
|
-
});
|
|
878
|
-
describe('recordApiRequestBreakdown', () => {
|
|
879
|
-
it('should record API request breakdown for all phases', () => {
|
|
880
|
-
initializeMetricsModule(mockConfig);
|
|
881
|
-
mockHistogramRecordFn.mockClear();
|
|
882
|
-
recordApiRequestBreakdownModule(mockConfig, 15, {
|
|
883
|
-
model: 'gemini-pro',
|
|
884
|
-
phase: ApiRequestPhase.REQUEST_PREPARATION,
|
|
885
|
-
});
|
|
886
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(15, {
|
|
887
|
-
'session.id': 'test-session-id',
|
|
888
|
-
'installation.id': 'test-installation-id',
|
|
889
|
-
'user.email': 'test@example.com',
|
|
890
|
-
model: 'gemini-pro',
|
|
891
|
-
phase: 'request_preparation',
|
|
892
|
-
});
|
|
893
|
-
});
|
|
894
|
-
it('should record API request breakdown for different phases', () => {
|
|
895
|
-
initializeMetricsModule(mockConfig);
|
|
896
|
-
mockHistogramRecordFn.mockClear();
|
|
897
|
-
recordApiRequestBreakdownModule(mockConfig, 250, {
|
|
898
|
-
model: 'gemini-pro',
|
|
899
|
-
phase: ApiRequestPhase.NETWORK_LATENCY,
|
|
900
|
-
});
|
|
901
|
-
recordApiRequestBreakdownModule(mockConfig, 100, {
|
|
902
|
-
model: 'gemini-pro',
|
|
903
|
-
phase: ApiRequestPhase.RESPONSE_PROCESSING,
|
|
904
|
-
});
|
|
905
|
-
recordApiRequestBreakdownModule(mockConfig, 50, {
|
|
906
|
-
model: 'gemini-pro',
|
|
907
|
-
phase: ApiRequestPhase.TOKEN_PROCESSING,
|
|
908
|
-
});
|
|
909
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledTimes(3); // One for each call
|
|
910
|
-
expect(mockHistogramRecordFn).toHaveBeenNthCalledWith(1, 250, {
|
|
911
|
-
'session.id': 'test-session-id',
|
|
912
|
-
'installation.id': 'test-installation-id',
|
|
913
|
-
'user.email': 'test@example.com',
|
|
914
|
-
model: 'gemini-pro',
|
|
915
|
-
phase: 'network_latency',
|
|
916
|
-
});
|
|
917
|
-
expect(mockHistogramRecordFn).toHaveBeenNthCalledWith(2, 100, {
|
|
918
|
-
'session.id': 'test-session-id',
|
|
919
|
-
'installation.id': 'test-installation-id',
|
|
920
|
-
'user.email': 'test@example.com',
|
|
921
|
-
model: 'gemini-pro',
|
|
922
|
-
phase: 'response_processing',
|
|
923
|
-
});
|
|
924
|
-
expect(mockHistogramRecordFn).toHaveBeenNthCalledWith(3, 50, {
|
|
925
|
-
'session.id': 'test-session-id',
|
|
926
|
-
'installation.id': 'test-installation-id',
|
|
927
|
-
'user.email': 'test@example.com',
|
|
928
|
-
model: 'gemini-pro',
|
|
929
|
-
phase: 'token_processing',
|
|
930
|
-
});
|
|
931
|
-
});
|
|
932
|
-
});
|
|
933
|
-
describe('recordPerformanceScore', () => {
|
|
934
|
-
it('should record performance score with category and baseline', () => {
|
|
935
|
-
initializeMetricsModule(mockConfig);
|
|
936
|
-
mockHistogramRecordFn.mockClear();
|
|
937
|
-
recordPerformanceScoreModule(mockConfig, 85.5, {
|
|
938
|
-
category: 'memory_efficiency',
|
|
939
|
-
baseline: 80.0,
|
|
940
|
-
});
|
|
941
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(85.5, {
|
|
942
|
-
'session.id': 'test-session-id',
|
|
943
|
-
'installation.id': 'test-installation-id',
|
|
944
|
-
'user.email': 'test@example.com',
|
|
945
|
-
category: 'memory_efficiency',
|
|
946
|
-
baseline: 80.0,
|
|
947
|
-
});
|
|
948
|
-
});
|
|
949
|
-
it('should record performance score without baseline', () => {
|
|
950
|
-
initializeMetricsModule(mockConfig);
|
|
951
|
-
mockHistogramRecordFn.mockClear();
|
|
952
|
-
recordPerformanceScoreModule(mockConfig, 92.3, {
|
|
953
|
-
category: 'overall_performance',
|
|
954
|
-
});
|
|
955
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(92.3, {
|
|
956
|
-
'session.id': 'test-session-id',
|
|
957
|
-
'installation.id': 'test-installation-id',
|
|
958
|
-
'user.email': 'test@example.com',
|
|
959
|
-
category: 'overall_performance',
|
|
960
|
-
});
|
|
961
|
-
});
|
|
962
|
-
});
|
|
963
|
-
describe('recordPerformanceRegression', () => {
|
|
964
|
-
it('should record performance regression with baseline comparison', () => {
|
|
965
|
-
initializeMetricsModule(mockConfig);
|
|
966
|
-
mockCounterAddFn.mockClear();
|
|
967
|
-
mockHistogramRecordFn.mockClear();
|
|
968
|
-
recordPerformanceRegressionModule(mockConfig, {
|
|
969
|
-
metric: 'startup_time',
|
|
970
|
-
current_value: 1200,
|
|
971
|
-
baseline_value: 1000,
|
|
972
|
-
severity: 'medium',
|
|
973
|
-
});
|
|
974
|
-
// Verify regression counter
|
|
975
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(1, {
|
|
976
|
-
'session.id': 'test-session-id',
|
|
977
|
-
'installation.id': 'test-installation-id',
|
|
978
|
-
'user.email': 'test@example.com',
|
|
979
|
-
metric: 'startup_time',
|
|
980
|
-
severity: 'medium',
|
|
981
|
-
current_value: 1200,
|
|
982
|
-
baseline_value: 1000,
|
|
983
|
-
});
|
|
984
|
-
// Verify baseline comparison histogram (20% increase)
|
|
985
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(20, {
|
|
986
|
-
'session.id': 'test-session-id',
|
|
987
|
-
'installation.id': 'test-installation-id',
|
|
988
|
-
'user.email': 'test@example.com',
|
|
989
|
-
metric: 'startup_time',
|
|
990
|
-
severity: 'medium',
|
|
991
|
-
current_value: 1200,
|
|
992
|
-
baseline_value: 1000,
|
|
993
|
-
});
|
|
994
|
-
});
|
|
995
|
-
it('should handle zero baseline value gracefully', () => {
|
|
996
|
-
initializeMetricsModule(mockConfig);
|
|
997
|
-
mockCounterAddFn.mockClear();
|
|
998
|
-
mockHistogramRecordFn.mockClear();
|
|
999
|
-
recordPerformanceRegressionModule(mockConfig, {
|
|
1000
|
-
metric: 'memory_usage',
|
|
1001
|
-
current_value: 100,
|
|
1002
|
-
baseline_value: 0,
|
|
1003
|
-
severity: 'high',
|
|
1004
|
-
});
|
|
1005
|
-
// Verify regression counter still recorded
|
|
1006
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(1, {
|
|
1007
|
-
'session.id': 'test-session-id',
|
|
1008
|
-
'installation.id': 'test-installation-id',
|
|
1009
|
-
'user.email': 'test@example.com',
|
|
1010
|
-
metric: 'memory_usage',
|
|
1011
|
-
severity: 'high',
|
|
1012
|
-
current_value: 100,
|
|
1013
|
-
baseline_value: 0,
|
|
1014
|
-
});
|
|
1015
|
-
// Verify no baseline comparison due to zero baseline
|
|
1016
|
-
expect(mockHistogramRecordFn).not.toHaveBeenCalled();
|
|
1017
|
-
});
|
|
1018
|
-
it('should record different severity levels', () => {
|
|
1019
|
-
initializeMetricsModule(mockConfig);
|
|
1020
|
-
mockCounterAddFn.mockClear();
|
|
1021
|
-
recordPerformanceRegressionModule(mockConfig, {
|
|
1022
|
-
metric: 'api_latency',
|
|
1023
|
-
current_value: 500,
|
|
1024
|
-
baseline_value: 400,
|
|
1025
|
-
severity: 'low',
|
|
1026
|
-
});
|
|
1027
|
-
recordPerformanceRegressionModule(mockConfig, {
|
|
1028
|
-
metric: 'cpu_usage',
|
|
1029
|
-
current_value: 90,
|
|
1030
|
-
baseline_value: 70,
|
|
1031
|
-
severity: 'high',
|
|
1032
|
-
});
|
|
1033
|
-
expect(mockCounterAddFn).toHaveBeenNthCalledWith(1, 1, {
|
|
1034
|
-
'session.id': 'test-session-id',
|
|
1035
|
-
'installation.id': 'test-installation-id',
|
|
1036
|
-
'user.email': 'test@example.com',
|
|
1037
|
-
metric: 'api_latency',
|
|
1038
|
-
severity: 'low',
|
|
1039
|
-
current_value: 500,
|
|
1040
|
-
baseline_value: 400,
|
|
1041
|
-
});
|
|
1042
|
-
expect(mockCounterAddFn).toHaveBeenNthCalledWith(2, 1, {
|
|
1043
|
-
'session.id': 'test-session-id',
|
|
1044
|
-
'installation.id': 'test-installation-id',
|
|
1045
|
-
'user.email': 'test@example.com',
|
|
1046
|
-
metric: 'cpu_usage',
|
|
1047
|
-
severity: 'high',
|
|
1048
|
-
current_value: 90,
|
|
1049
|
-
baseline_value: 70,
|
|
1050
|
-
});
|
|
1051
|
-
});
|
|
1052
|
-
});
|
|
1053
|
-
describe('recordBaselineComparison', () => {
|
|
1054
|
-
it('should record baseline comparison with percentage change', () => {
|
|
1055
|
-
initializeMetricsModule(mockConfig);
|
|
1056
|
-
mockHistogramRecordFn.mockClear();
|
|
1057
|
-
recordBaselineComparisonModule(mockConfig, {
|
|
1058
|
-
metric: 'memory_usage',
|
|
1059
|
-
current_value: 120,
|
|
1060
|
-
baseline_value: 100,
|
|
1061
|
-
category: 'performance_tracking',
|
|
1062
|
-
});
|
|
1063
|
-
// 20% increase: (120 - 100) / 100 * 100 = 20%
|
|
1064
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(20, {
|
|
1065
|
-
'session.id': 'test-session-id',
|
|
1066
|
-
'installation.id': 'test-installation-id',
|
|
1067
|
-
'user.email': 'test@example.com',
|
|
1068
|
-
metric: 'memory_usage',
|
|
1069
|
-
category: 'performance_tracking',
|
|
1070
|
-
current_value: 120,
|
|
1071
|
-
baseline_value: 100,
|
|
1072
|
-
});
|
|
1073
|
-
});
|
|
1074
|
-
it('should handle negative percentage change (improvement)', () => {
|
|
1075
|
-
initializeMetricsModule(mockConfig);
|
|
1076
|
-
mockHistogramRecordFn.mockClear();
|
|
1077
|
-
recordBaselineComparisonModule(mockConfig, {
|
|
1078
|
-
metric: 'startup_time',
|
|
1079
|
-
current_value: 800,
|
|
1080
|
-
baseline_value: 1000,
|
|
1081
|
-
category: 'optimization',
|
|
1082
|
-
});
|
|
1083
|
-
// 20% decrease: (800 - 1000) / 1000 * 100 = -20%
|
|
1084
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(-20, {
|
|
1085
|
-
'session.id': 'test-session-id',
|
|
1086
|
-
'installation.id': 'test-installation-id',
|
|
1087
|
-
'user.email': 'test@example.com',
|
|
1088
|
-
metric: 'startup_time',
|
|
1089
|
-
category: 'optimization',
|
|
1090
|
-
current_value: 800,
|
|
1091
|
-
baseline_value: 1000,
|
|
1092
|
-
});
|
|
1093
|
-
});
|
|
1094
|
-
it('should skip recording when baseline is zero', async () => {
|
|
1095
|
-
// Access the actual mocked module
|
|
1096
|
-
const mockedModule = (await vi.importMock('@opentelemetry/api'));
|
|
1097
|
-
const diagSpy = vi.spyOn(mockedModule.diag, 'warn');
|
|
1098
|
-
initializeMetricsModule(mockConfig);
|
|
1099
|
-
mockHistogramRecordFn.mockClear();
|
|
1100
|
-
recordBaselineComparisonModule(mockConfig, {
|
|
1101
|
-
metric: 'new_metric',
|
|
1102
|
-
current_value: 50,
|
|
1103
|
-
baseline_value: 0,
|
|
1104
|
-
category: 'testing',
|
|
1105
|
-
});
|
|
1106
|
-
expect(diagSpy).toHaveBeenCalledWith('Baseline value is zero, skipping comparison.');
|
|
1107
|
-
expect(mockHistogramRecordFn).not.toHaveBeenCalled();
|
|
1108
|
-
});
|
|
1109
|
-
});
|
|
1110
|
-
describe('recordHookCallMetrics', () => {
|
|
1111
|
-
let recordHookCallMetricsModule;
|
|
1112
|
-
beforeEach(async () => {
|
|
1113
|
-
recordHookCallMetricsModule = (await import('./metrics.js'))
|
|
1114
|
-
.recordHookCallMetrics;
|
|
1115
|
-
});
|
|
1116
|
-
it('should record hook call metrics with counter and histogram', () => {
|
|
1117
|
-
initializeMetricsModule(mockConfig);
|
|
1118
|
-
mockCounterAddFn.mockClear();
|
|
1119
|
-
mockHistogramRecordFn.mockClear();
|
|
1120
|
-
recordHookCallMetricsModule(mockConfig, 'BeforeTool', 'test-hook', 150, true);
|
|
1121
|
-
// Verify counter recorded
|
|
1122
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(1, {
|
|
1123
|
-
'session.id': 'test-session-id',
|
|
1124
|
-
'installation.id': 'test-installation-id',
|
|
1125
|
-
'user.email': 'test@example.com',
|
|
1126
|
-
hook_event_name: 'BeforeTool',
|
|
1127
|
-
hook_name: 'test-hook',
|
|
1128
|
-
success: true,
|
|
1129
|
-
});
|
|
1130
|
-
// Verify histogram recorded
|
|
1131
|
-
expect(mockHistogramRecordFn).toHaveBeenCalledWith(150, {
|
|
1132
|
-
'session.id': 'test-session-id',
|
|
1133
|
-
'installation.id': 'test-installation-id',
|
|
1134
|
-
'user.email': 'test@example.com',
|
|
1135
|
-
hook_event_name: 'BeforeTool',
|
|
1136
|
-
hook_name: 'test-hook',
|
|
1137
|
-
success: true,
|
|
1138
|
-
});
|
|
1139
|
-
});
|
|
1140
|
-
it('should always sanitize hook names regardless of content', () => {
|
|
1141
|
-
initializeMetricsModule(mockConfig);
|
|
1142
|
-
mockCounterAddFn.mockClear();
|
|
1143
|
-
// Test with a command that has sensitive information
|
|
1144
|
-
recordHookCallMetricsModule(mockConfig, 'BeforeTool', '/path/to/.gemini/hooks/check-secrets.sh --api-key=abc123', 150, true);
|
|
1145
|
-
// Verify hook name is sanitized (detailed sanitization tested in hook-call-event.test.ts)
|
|
1146
|
-
expect(mockCounterAddFn).toHaveBeenCalledWith(1, {
|
|
1147
|
-
'session.id': 'test-session-id',
|
|
1148
|
-
'installation.id': 'test-installation-id',
|
|
1149
|
-
'user.email': 'test@example.com',
|
|
1150
|
-
hook_event_name: 'BeforeTool',
|
|
1151
|
-
hook_name: 'check-secrets.sh', // Sanitized
|
|
1152
|
-
success: true,
|
|
1153
|
-
});
|
|
1154
|
-
});
|
|
1155
|
-
it('should track both success and failure', () => {
|
|
1156
|
-
initializeMetricsModule(mockConfig);
|
|
1157
|
-
mockCounterAddFn.mockClear();
|
|
1158
|
-
// Success case
|
|
1159
|
-
recordHookCallMetricsModule(mockConfig, 'BeforeTool', 'test-hook', 100, true);
|
|
1160
|
-
expect(mockCounterAddFn).toHaveBeenNthCalledWith(1, 1, expect.objectContaining({
|
|
1161
|
-
hook_event_name: 'BeforeTool',
|
|
1162
|
-
hook_name: 'test-hook',
|
|
1163
|
-
success: true,
|
|
1164
|
-
}));
|
|
1165
|
-
// Failure case
|
|
1166
|
-
recordHookCallMetricsModule(mockConfig, 'AfterTool', 'test-hook', 150, false);
|
|
1167
|
-
expect(mockCounterAddFn).toHaveBeenNthCalledWith(2, 1, expect.objectContaining({
|
|
1168
|
-
hook_event_name: 'AfterTool',
|
|
1169
|
-
hook_name: 'test-hook',
|
|
1170
|
-
success: false,
|
|
1171
|
-
}));
|
|
1172
|
-
});
|
|
1173
|
-
});
|
|
1174
|
-
});
|
|
1175
|
-
});
|
|
1176
|
-
//# sourceMappingURL=metrics.test.js.map
|