@office-ai/aioncli-core 0.8.1 → 0.18.5
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/dist/index.d.ts +8 -2
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/src/agents/codebase-investigator.d.ts +36 -1
- package/dist/src/agents/codebase-investigator.js +93 -34
- package/dist/src/agents/codebase-investigator.js.map +1 -1
- package/dist/src/agents/codebase-investigator.test.d.ts +6 -0
- package/dist/src/agents/codebase-investigator.test.js +35 -0
- package/dist/src/agents/codebase-investigator.test.js.map +1 -0
- package/dist/src/agents/executor.d.ts +37 -11
- package/dist/src/agents/executor.js +512 -150
- package/dist/src/agents/executor.js.map +1 -1
- package/dist/src/agents/executor.test.js +1188 -245
- package/dist/src/agents/executor.test.js.map +1 -1
- package/dist/src/agents/invocation.d.ts +5 -2
- package/dist/src/agents/invocation.js +4 -2
- package/dist/src/agents/invocation.js.map +1 -1
- package/dist/src/agents/invocation.test.js +9 -0
- package/dist/src/agents/invocation.test.js.map +1 -1
- package/dist/src/agents/registry.d.ts +6 -1
- package/dist/src/agents/registry.js +51 -4
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +30 -16
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/agents/subagent-tool-wrapper.d.ts +3 -1
- package/dist/src/agents/subagent-tool-wrapper.js +4 -3
- package/dist/src/agents/subagent-tool-wrapper.js.map +1 -1
- package/dist/src/agents/subagent-tool-wrapper.test.js +9 -4
- package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -1
- package/dist/src/agents/types.d.ts +37 -7
- package/dist/src/agents/types.js +2 -0
- package/dist/src/agents/types.js.map +1 -1
- package/dist/src/code_assist/codeAssist.js +1 -1
- package/dist/src/code_assist/codeAssist.test.d.ts +6 -0
- package/dist/src/code_assist/codeAssist.test.js +99 -0
- package/dist/src/code_assist/codeAssist.test.js.map +1 -0
- package/dist/src/code_assist/converter.d.ts +1 -0
- package/dist/src/code_assist/converter.js +1 -0
- package/dist/src/code_assist/converter.js.map +1 -1
- package/dist/src/code_assist/converter.test.js +19 -0
- package/dist/src/code_assist/converter.test.js.map +1 -1
- package/dist/src/code_assist/experiments/client_metadata.d.ts +12 -0
- package/dist/src/code_assist/experiments/client_metadata.js +50 -0
- package/dist/src/code_assist/experiments/client_metadata.js.map +1 -0
- package/dist/src/code_assist/experiments/client_metadata.test.d.ts +6 -0
- package/dist/src/code_assist/experiments/client_metadata.test.js +99 -0
- package/dist/src/code_assist/experiments/client_metadata.test.js.map +1 -0
- package/dist/src/code_assist/experiments/experiments.d.ts +17 -0
- package/dist/src/code_assist/experiments/experiments.js +36 -0
- package/dist/src/code_assist/experiments/experiments.js.map +1 -0
- package/dist/src/code_assist/experiments/experiments.test.d.ts +6 -0
- package/dist/src/code_assist/experiments/experiments.test.js +92 -0
- package/dist/src/code_assist/experiments/experiments.test.js.map +1 -0
- package/dist/src/code_assist/experiments/flagNames.d.ts +13 -0
- package/dist/src/code_assist/experiments/flagNames.js +13 -0
- package/dist/src/code_assist/experiments/flagNames.js.map +1 -0
- package/dist/src/code_assist/experiments/types.d.ts +35 -0
- package/dist/src/code_assist/experiments/types.js +7 -0
- package/dist/src/code_assist/experiments/types.js.map +1 -0
- package/dist/src/code_assist/oauth-credential-storage.js +6 -5
- package/dist/src/code_assist/oauth-credential-storage.js.map +1 -1
- package/dist/src/code_assist/oauth-credential-storage.test.js +65 -3
- package/dist/src/code_assist/oauth-credential-storage.test.js.map +1 -1
- package/dist/src/code_assist/oauth2.d.ts +2 -2
- package/dist/src/code_assist/oauth2.js +161 -93
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +103 -57
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/server.d.ts +6 -4
- package/dist/src/code_assist/server.js +16 -8
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +126 -28
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/setup.d.ts +2 -2
- package/dist/src/code_assist/setup.js +4 -2
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/code_assist/types.d.ts +1 -1
- package/dist/src/code_assist/types.js.map +1 -1
- package/dist/src/commands/extensions.d.ts +7 -0
- package/dist/src/commands/extensions.js +9 -0
- package/dist/src/commands/extensions.js.map +1 -0
- package/dist/src/commands/extensions.test.d.ts +6 -0
- package/dist/src/commands/extensions.test.js +19 -0
- package/dist/src/commands/extensions.test.js.map +1 -0
- package/dist/src/config/config.d.ts +169 -43
- package/dist/src/config/config.js +418 -79
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +684 -49
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/defaultModelConfigs.d.ts +7 -0
- package/dist/src/config/defaultModelConfigs.js +185 -0
- package/dist/src/config/defaultModelConfigs.js.map +1 -0
- package/dist/src/config/models.d.ts +23 -2
- package/dist/src/config/models.js +50 -7
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/models.test.js +71 -10
- package/dist/src/config/models.test.js.map +1 -1
- package/dist/src/config/storage.d.ts +3 -1
- package/dist/src/config/storage.js +22 -2
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/config/storage.test.js +7 -6
- package/dist/src/config/storage.test.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.d.ts +3 -2
- package/dist/src/confirmation-bus/message-bus.js +9 -3
- package/dist/src/confirmation-bus/message-bus.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.test.js +30 -24
- package/dist/src/confirmation-bus/message-bus.test.js.map +1 -1
- package/dist/src/confirmation-bus/types.d.ts +13 -2
- package/dist/src/confirmation-bus/types.js +1 -0
- package/dist/src/confirmation-bus/types.js.map +1 -1
- package/dist/src/core/apiKeyCredentialStorage.d.ts +17 -0
- package/dist/src/core/apiKeyCredentialStorage.js +64 -0
- package/dist/src/core/apiKeyCredentialStorage.js.map +1 -0
- package/dist/src/core/apiKeyCredentialStorage.test.d.ts +6 -0
- package/dist/src/core/apiKeyCredentialStorage.test.js +71 -0
- package/dist/src/core/apiKeyCredentialStorage.test.js.map +1 -0
- package/dist/src/core/baseLlmClient.d.ts +4 -8
- package/dist/src/core/baseLlmClient.js +6 -11
- package/dist/src/core/baseLlmClient.js.map +1 -1
- package/dist/src/core/baseLlmClient.test.js +22 -27
- package/dist/src/core/baseLlmClient.test.js.map +1 -1
- package/dist/src/core/client.d.ts +12 -19
- package/dist/src/core/client.js +104 -206
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +329 -452
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/contentGenerator.d.ts +3 -2
- package/dist/src/core/contentGenerator.js +56 -41
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +49 -1
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/coreToolScheduler.d.ts +8 -4
- package/dist/src/core/coreToolScheduler.js +348 -179
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +575 -219
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/fakeContentGenerator.d.ts +33 -0
- package/dist/src/core/fakeContentGenerator.js +58 -0
- package/dist/src/core/fakeContentGenerator.js.map +1 -0
- package/dist/src/core/fakeContentGenerator.test.d.ts +6 -0
- package/dist/src/core/fakeContentGenerator.test.js +127 -0
- package/dist/src/core/fakeContentGenerator.test.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +23 -18
- package/dist/src/core/geminiChat.js +186 -108
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +581 -270
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/logger.d.ts +7 -2
- package/dist/src/core/logger.js +35 -27
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/logger.test.js +45 -29
- package/dist/src/core/logger.test.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.d.ts +1 -0
- package/dist/src/core/loggingContentGenerator.js +113 -33
- package/dist/src/core/loggingContentGenerator.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.test.d.ts +6 -0
- package/dist/src/core/loggingContentGenerator.test.js +180 -0
- package/dist/src/core/loggingContentGenerator.test.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.d.ts +3 -2
- package/dist/src/core/nonInteractiveToolExecutor.js +12 -7
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +12 -8
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/openaiContentGenerator.d.ts +15 -1
- package/dist/src/core/openaiContentGenerator.js +139 -22
- package/dist/src/core/openaiContentGenerator.js.map +1 -1
- package/dist/src/core/prompts.d.ts +2 -1
- package/dist/src/core/prompts.js +135 -154
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/prompts.test.js +128 -189
- package/dist/src/core/prompts.test.js.map +1 -1
- package/dist/src/core/recordingContentGenerator.d.ts +18 -0
- package/dist/src/core/recordingContentGenerator.js +77 -0
- package/dist/src/core/recordingContentGenerator.js.map +1 -0
- package/dist/src/core/recordingContentGenerator.test.d.ts +6 -0
- package/dist/src/core/recordingContentGenerator.test.js +101 -0
- package/dist/src/core/recordingContentGenerator.test.js.map +1 -0
- package/dist/src/core/tokenLimits.test.d.ts +6 -0
- package/dist/src/core/tokenLimits.test.js +26 -0
- package/dist/src/core/tokenLimits.test.js.map +1 -0
- package/dist/src/core/turn.d.ts +23 -3
- package/dist/src/core/turn.js +18 -9
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +98 -104
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/fallback/handler.js +60 -8
- package/dist/src/fallback/handler.js.map +1 -1
- package/dist/src/fallback/handler.test.js +132 -17
- package/dist/src/fallback/handler.test.js.map +1 -1
- package/dist/src/fallback/types.d.ts +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/hooks/hookAggregator.d.ts +68 -0
- package/dist/src/hooks/hookAggregator.js +262 -0
- package/dist/src/hooks/hookAggregator.js.map +1 -0
- package/dist/src/hooks/hookAggregator.test.d.ts +6 -0
- package/dist/src/hooks/hookAggregator.test.js +387 -0
- package/dist/src/hooks/hookAggregator.test.js.map +1 -0
- package/dist/src/hooks/hookPlanner.d.ts +46 -0
- package/dist/src/hooks/hookPlanner.js +108 -0
- package/dist/src/hooks/hookPlanner.js.map +1 -0
- package/dist/src/hooks/hookPlanner.test.d.ts +6 -0
- package/dist/src/hooks/hookPlanner.test.js +255 -0
- package/dist/src/hooks/hookPlanner.test.js.map +1 -0
- package/dist/src/hooks/hookRegistry.d.ts +87 -0
- package/dist/src/hooks/hookRegistry.js +198 -0
- package/dist/src/hooks/hookRegistry.js.map +1 -0
- package/dist/src/hooks/hookRegistry.test.d.ts +6 -0
- package/dist/src/hooks/hookRegistry.test.js +341 -0
- package/dist/src/hooks/hookRegistry.test.js.map +1 -0
- package/dist/src/hooks/hookRunner.d.ts +42 -0
- package/dist/src/hooks/hookRunner.js +272 -0
- package/dist/src/hooks/hookRunner.js.map +1 -0
- package/dist/src/hooks/hookRunner.test.d.ts +6 -0
- package/dist/src/hooks/hookRunner.test.js +468 -0
- package/dist/src/hooks/hookRunner.test.js.map +1 -0
- package/dist/src/hooks/hookTranslator.d.ts +113 -0
- package/dist/src/hooks/hookTranslator.js +232 -0
- package/dist/src/hooks/hookTranslator.js.map +1 -0
- package/dist/src/hooks/hookTranslator.test.d.ts +6 -0
- package/dist/src/hooks/hookTranslator.test.js +192 -0
- package/dist/src/hooks/hookTranslator.test.js.map +1 -0
- package/dist/src/hooks/types.d.ts +384 -0
- package/dist/src/hooks/types.js +284 -0
- package/dist/src/hooks/types.js.map +1 -0
- package/dist/src/hooks/types.test.d.ts +6 -0
- package/dist/src/hooks/types.test.js +313 -0
- package/dist/src/hooks/types.test.js.map +1 -0
- package/dist/src/ide/detect-ide.d.ts +4 -0
- package/dist/src/ide/detect-ide.js +6 -1
- package/dist/src/ide/detect-ide.js.map +1 -1
- package/dist/src/ide/detect-ide.test.js +16 -0
- package/dist/src/ide/detect-ide.test.js.map +1 -1
- package/dist/src/ide/ide-client.d.ts +3 -1
- package/dist/src/ide/ide-client.js +12 -10
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-client.test.js +163 -4
- package/dist/src/ide/ide-client.test.js.map +1 -1
- package/dist/src/ide/ide-installer.js +66 -21
- package/dist/src/ide/ide-installer.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +54 -1
- package/dist/src/ide/ide-installer.test.js.map +1 -1
- package/dist/src/ide/process-utils.js +85 -75
- package/dist/src/ide/process-utils.js.map +1 -1
- package/dist/src/ide/process-utils.test.js +83 -90
- package/dist/src/ide/process-utils.test.js.map +1 -1
- package/dist/src/ide/types.d.ts +5 -5
- package/dist/src/ide/types.js +1 -1
- package/dist/src/index.d.ts +21 -0
- package/dist/src/index.js +24 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.d.ts +2 -0
- package/dist/src/mcp/google-auth-provider.js +21 -3
- package/dist/src/mcp/google-auth-provider.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.test.js +42 -9
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-provider.d.ts +8 -5
- package/dist/src/mcp/oauth-provider.js +140 -55
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +369 -2
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.js +5 -4
- package/dist/src/mcp/oauth-token-storage.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.test.js +17 -11
- package/dist/src/mcp/oauth-token-storage.test.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +7 -0
- package/dist/src/mcp/oauth-utils.js +28 -8
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +45 -2
- package/dist/src/mcp/oauth-utils.test.js.map +1 -1
- package/dist/src/mcp/sa-impersonation-provider.d.ts +0 -6
- package/dist/src/mcp/sa-impersonation-provider.js +6 -23
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -1
- package/dist/src/mcp/token-storage/base-token-storage.test.js +75 -84
- package/dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -1
- package/dist/src/mcp/token-storage/file-token-storage.js +3 -2
- package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -1
- package/dist/src/mcp/token-storage/file-token-storage.test.js +11 -8
- package/dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.d.ts +6 -2
- package/dist/src/mcp/token-storage/keychain-token-storage.js +63 -7
- package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js +54 -3
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -1
- package/dist/src/mcp/token-storage/types.d.ts +6 -0
- package/dist/src/mcp/token-storage/types.js.map +1 -1
- package/dist/src/output/stream-json-formatter.d.ts +32 -0
- package/dist/src/output/stream-json-formatter.js +52 -0
- package/dist/src/output/stream-json-formatter.js.map +1 -0
- package/dist/src/output/stream-json-formatter.test.d.ts +6 -0
- package/dist/src/output/stream-json-formatter.test.js +479 -0
- package/dist/src/output/stream-json-formatter.test.js.map +1 -0
- package/dist/src/output/types.d.ts +63 -1
- package/dist/src/output/types.js +11 -0
- package/dist/src/output/types.js.map +1 -1
- package/dist/src/policy/config.d.ts +31 -0
- package/dist/src/policy/config.js +199 -0
- package/dist/src/policy/config.js.map +1 -0
- package/dist/src/policy/config.test.d.ts +6 -0
- package/dist/src/policy/config.test.js +538 -0
- package/dist/src/policy/config.test.js.map +1 -0
- package/dist/src/policy/index.d.ts +2 -0
- package/dist/src/policy/index.js +2 -0
- package/dist/src/policy/index.js.map +1 -1
- package/dist/src/policy/policies/discovered.toml +8 -0
- package/dist/src/policy/policies/read-only.toml +56 -0
- package/dist/src/policy/policies/write.toml +73 -0
- package/dist/src/policy/policies/yolo.toml +31 -0
- package/dist/src/policy/policy-engine.d.ts +12 -3
- package/dist/src/policy/policy-engine.js +74 -8
- package/dist/src/policy/policy-engine.js.map +1 -1
- package/dist/src/policy/policy-engine.test.js +460 -76
- package/dist/src/policy/policy-engine.test.js.map +1 -1
- package/dist/src/policy/toml-loader.d.ts +47 -0
- package/dist/src/policy/toml-loader.js +411 -0
- package/dist/src/policy/toml-loader.js.map +1 -0
- package/dist/src/policy/toml-loader.test.d.ts +6 -0
- package/dist/src/policy/toml-loader.test.js +376 -0
- package/dist/src/policy/toml-loader.test.js.map +1 -0
- package/dist/src/policy/types.d.ts +83 -0
- package/dist/src/policy/types.js +10 -0
- package/dist/src/policy/types.js.map +1 -1
- package/dist/src/prompts/mcp-prompts.test.d.ts +6 -0
- package/dist/src/prompts/mcp-prompts.test.js +39 -0
- package/dist/src/prompts/mcp-prompts.test.js.map +1 -0
- package/dist/src/prompts/prompt-registry.js +2 -1
- package/dist/src/prompts/prompt-registry.js.map +1 -1
- package/dist/src/prompts/prompt-registry.test.d.ts +6 -0
- package/dist/src/prompts/prompt-registry.test.js +96 -0
- package/dist/src/prompts/prompt-registry.test.js.map +1 -0
- package/dist/src/routing/modelRouterService.js +15 -0
- package/dist/src/routing/modelRouterService.js.map +1 -1
- package/dist/src/routing/modelRouterService.test.js +62 -0
- package/dist/src/routing/modelRouterService.test.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.d.ts +1 -1
- package/dist/src/routing/strategies/classifierStrategy.js +9 -16
- package/dist/src/routing/strategies/classifierStrategy.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.test.js +17 -13
- package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.test.js +4 -0
- package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/overrideStrategy.js +2 -2
- package/dist/src/routing/strategies/overrideStrategy.js.map +1 -1
- package/dist/src/routing/strategies/overrideStrategy.test.js +3 -0
- package/dist/src/routing/strategies/overrideStrategy.test.js.map +1 -1
- package/dist/src/safety/built-in.d.ts +21 -0
- package/dist/src/safety/built-in.js +106 -0
- package/dist/src/safety/built-in.js.map +1 -0
- package/dist/src/safety/built-in.test.d.ts +6 -0
- package/dist/src/safety/built-in.test.js +199 -0
- package/dist/src/safety/built-in.test.js.map +1 -0
- package/dist/src/safety/checker-runner.d.ts +48 -0
- package/dist/src/safety/checker-runner.js +208 -0
- package/dist/src/safety/checker-runner.js.map +1 -0
- package/dist/src/safety/checker-runner.test.d.ts +6 -0
- package/dist/src/safety/checker-runner.test.js +238 -0
- package/dist/src/safety/checker-runner.test.js.map +1 -0
- package/dist/src/safety/context-builder.d.ts +23 -0
- package/dist/src/safety/context-builder.js +47 -0
- package/dist/src/safety/context-builder.js.map +1 -0
- package/dist/src/safety/context-builder.test.d.ts +6 -0
- package/dist/src/safety/context-builder.test.js +49 -0
- package/dist/src/safety/context-builder.test.js.map +1 -0
- package/dist/src/safety/protocol.d.ts +88 -0
- package/dist/src/safety/protocol.js +15 -0
- package/dist/src/safety/protocol.js.map +1 -0
- package/dist/src/safety/registry.d.ts +26 -0
- package/dist/src/safety/registry.js +65 -0
- package/dist/src/safety/registry.js.map +1 -0
- package/dist/src/safety/registry.test.d.ts +6 -0
- package/dist/src/safety/registry.test.js +31 -0
- package/dist/src/safety/registry.test.js.map +1 -0
- package/dist/src/services/chatCompressionService.d.ts +32 -0
- package/dist/src/services/chatCompressionService.js +162 -0
- package/dist/src/services/chatCompressionService.js.map +1 -0
- package/dist/src/services/chatCompressionService.test.d.ts +6 -0
- package/dist/src/services/chatCompressionService.test.js +210 -0
- package/dist/src/services/chatCompressionService.test.js.map +1 -0
- package/dist/src/services/chatRecordingService.d.ts +3 -2
- package/dist/src/services/chatRecordingService.js +11 -9
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.d.ts +2 -14
- package/dist/src/services/fileDiscoveryService.js +19 -55
- package/dist/src/services/fileDiscoveryService.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.test.js +91 -11
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -1
- package/dist/src/services/loopDetectionService.d.ts +4 -1
- package/dist/src/services/loopDetectionService.js +95 -42
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +220 -12
- package/dist/src/services/loopDetectionService.test.js.map +1 -1
- package/dist/src/services/modelConfig.golden.test.d.ts +6 -0
- package/dist/src/services/modelConfig.golden.test.js +42 -0
- package/dist/src/services/modelConfig.golden.test.js.map +1 -0
- package/dist/src/services/modelConfig.integration.test.d.ts +6 -0
- package/dist/src/services/modelConfig.integration.test.js +247 -0
- package/dist/src/services/modelConfig.integration.test.js.map +1 -0
- package/dist/src/services/modelConfigService.d.ts +48 -0
- package/dist/src/services/modelConfigService.js +151 -0
- package/dist/src/services/modelConfigService.js.map +1 -0
- package/dist/src/services/modelConfigService.test.d.ts +6 -0
- package/dist/src/services/modelConfigService.test.js +531 -0
- package/dist/src/services/modelConfigService.test.js.map +1 -0
- package/dist/src/services/shellExecutionService.d.ts +1 -0
- package/dist/src/services/shellExecutionService.js +195 -92
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +137 -14
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/services/test-data/resolved-aliases.golden.json +202 -0
- package/dist/src/telemetry/activity-monitor.d.ts +116 -0
- package/dist/src/telemetry/activity-monitor.js +209 -0
- package/dist/src/telemetry/activity-monitor.js.map +1 -0
- package/dist/src/telemetry/activity-monitor.test.d.ts +6 -0
- package/dist/src/telemetry/activity-monitor.test.js +251 -0
- package/dist/src/telemetry/activity-monitor.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +25 -7
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +294 -76
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +192 -66
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +25 -3
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +59 -5
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/constants.d.ts +0 -28
- package/dist/src/telemetry/constants.js +0 -29
- package/dist/src/telemetry/constants.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.js +0 -1
- package/dist/src/telemetry/gcp-exporters.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.test.js +1 -1
- package/dist/src/telemetry/gcp-exporters.test.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +7 -3
- package/dist/src/telemetry/index.js +13 -4
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +14 -7
- package/dist/src/telemetry/loggers.js +197 -320
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +0 -1
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +460 -59
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/memory-monitor.d.ts +149 -0
- package/dist/src/telemetry/memory-monitor.js +335 -0
- package/dist/src/telemetry/memory-monitor.js.map +1 -0
- package/dist/src/telemetry/memory-monitor.test.d.ts +6 -0
- package/dist/src/telemetry/memory-monitor.test.js +472 -0
- package/dist/src/telemetry/memory-monitor.test.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +180 -4
- package/dist/src/telemetry/metrics.js +270 -6
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +502 -184
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/sdk.js +3 -2
- package/dist/src/telemetry/sdk.js.map +1 -1
- package/dist/src/telemetry/semantic.d.ts +82 -0
- package/dist/src/telemetry/semantic.js +269 -0
- package/dist/src/telemetry/semantic.js.map +1 -0
- package/dist/src/telemetry/semantic.test.d.ts +6 -0
- package/dist/src/telemetry/semantic.test.js +387 -0
- package/dist/src/telemetry/semantic.test.js.map +1 -0
- package/dist/src/telemetry/telemetry-utils.test.js +29 -28
- package/dist/src/telemetry/telemetry-utils.test.js.map +1 -1
- package/dist/src/telemetry/telemetryAttributes.d.ts +8 -0
- package/dist/src/telemetry/telemetryAttributes.js +19 -0
- package/dist/src/telemetry/telemetryAttributes.js.map +1 -0
- package/dist/src/telemetry/trace.d.ts +46 -0
- package/dist/src/telemetry/trace.js +121 -0
- package/dist/src/telemetry/trace.js.map +1 -0
- package/dist/src/telemetry/types.d.ts +227 -29
- package/dist/src/telemetry/types.js +858 -72
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +1 -1
- package/dist/src/telemetry/uiTelemetry.js +7 -7
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +89 -67
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/config.d.ts +1 -1
- package/dist/src/test-utils/config.js +1 -1
- package/dist/src/tools/base-tool-invocation.test.d.ts +6 -0
- package/dist/src/tools/base-tool-invocation.test.js +85 -0
- package/dist/src/tools/base-tool-invocation.test.js.map +1 -0
- package/dist/src/tools/edit.d.ts +4 -3
- package/dist/src/tools/edit.js +50 -47
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +306 -216
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/glob.d.ts +4 -3
- package/dist/src/tools/glob.js +24 -27
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/glob.test.js +212 -205
- package/dist/src/tools/glob.test.js.map +1 -1
- package/dist/src/tools/grep.d.ts +4 -3
- package/dist/src/tools/grep.js +31 -25
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/grep.test.js +15 -12
- package/dist/src/tools/grep.test.js.map +1 -1
- package/dist/src/tools/ls.d.ts +4 -3
- package/dist/src/tools/ls.js +29 -35
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/ls.test.js +34 -42
- package/dist/src/tools/ls.test.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.d.ts +49 -11
- package/dist/src/tools/mcp-client-manager.js +191 -31
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +132 -25
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +12 -5
- package/dist/src/tools/mcp-client.js +287 -267
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +352 -45
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/mcp-tool.d.ts +6 -2
- package/dist/src/tools/mcp-tool.js +19 -8
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/mcp-tool.test.js +186 -273
- package/dist/src/tools/mcp-tool.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +7 -5
- package/dist/src/tools/memoryTool.js +14 -12
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +10 -9
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/message-bus-integration.test.js +14 -1
- package/dist/src/tools/message-bus-integration.test.js.map +1 -1
- package/dist/src/tools/modifiable-tool.d.ts +5 -1
- package/dist/src/tools/modifiable-tool.js +38 -16
- package/dist/src/tools/modifiable-tool.js.map +1 -1
- package/dist/src/tools/modifiable-tool.test.js +66 -31
- package/dist/src/tools/modifiable-tool.test.js.map +1 -1
- package/dist/src/tools/read-file.d.ts +6 -5
- package/dist/src/tools/read-file.js +26 -32
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js +68 -33
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.d.ts +6 -12
- package/dist/src/tools/read-many-files.js +28 -57
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/read-many-files.test.js +37 -36
- package/dist/src/tools/read-many-files.test.js.map +1 -1
- package/dist/src/tools/ripGrep.d.ts +28 -10
- package/dist/src/tools/ripGrep.js +195 -193
- package/dist/src/tools/ripGrep.js.map +1 -1
- package/dist/src/tools/ripGrep.test.js +533 -204
- package/dist/src/tools/ripGrep.test.js.map +1 -1
- package/dist/src/tools/shell.d.ts +8 -6
- package/dist/src/tools/shell.js +64 -38
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +134 -43
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/smart-edit.d.ts +10 -23
- package/dist/src/tools/smart-edit.js +100 -85
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/smart-edit.test.js +229 -179
- package/dist/src/tools/smart-edit.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +21 -0
- package/dist/src/tools/tool-error.js +27 -0
- package/dist/src/tools/tool-error.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +17 -0
- package/dist/src/tools/tool-names.js +21 -0
- package/dist/src/tools/tool-names.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +32 -20
- package/dist/src/tools/tool-registry.js +122 -78
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +167 -90
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +23 -8
- package/dist/src/tools/tools.js +69 -37
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/web-fetch.d.ts +11 -3
- package/dist/src/tools/web-fetch.js +80 -38
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +338 -9
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/web-search.d.ts +4 -3
- package/dist/src/tools/web-search.js +11 -9
- package/dist/src/tools/web-search.js.map +1 -1
- package/dist/src/tools/web-search.test.js +6 -0
- package/dist/src/tools/web-search.test.js.map +1 -1
- package/dist/src/tools/write-file.d.ts +3 -2
- package/dist/src/tools/write-file.js +41 -40
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +130 -123
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/tools/write-todos.d.ts +34 -9
- package/dist/src/tools/write-todos.js +54 -11
- package/dist/src/tools/write-todos.js.map +1 -1
- package/dist/src/tools/write-todos.test.js +2 -2
- package/dist/src/tools/write-todos.test.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.js +3 -2
- package/dist/src/utils/bfsFileSearch.js.map +1 -1
- package/dist/src/utils/channel.d.ts +19 -0
- package/dist/src/utils/channel.js +49 -0
- package/dist/src/utils/channel.js.map +1 -0
- package/dist/src/utils/channel.test.d.ts +6 -0
- package/dist/src/utils/channel.test.js +170 -0
- package/dist/src/utils/channel.test.js.map +1 -0
- package/dist/src/utils/debugLogger.d.ts +25 -0
- package/dist/src/utils/debugLogger.js +33 -0
- package/dist/src/utils/debugLogger.js.map +1 -0
- package/dist/src/utils/debugLogger.test.d.ts +6 -0
- package/dist/src/utils/debugLogger.test.js +69 -0
- package/dist/src/utils/debugLogger.test.js.map +1 -0
- package/dist/src/utils/delay.d.ts +16 -0
- package/dist/src/utils/delay.js +43 -0
- package/dist/src/utils/delay.js.map +1 -0
- package/dist/src/utils/delay.test.d.ts +6 -0
- package/dist/src/utils/delay.test.js +88 -0
- package/dist/src/utils/delay.test.js.map +1 -0
- package/dist/src/utils/editCorrector.js +10 -25
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editCorrector.test.js +19 -5
- package/dist/src/utils/editCorrector.test.js.map +1 -1
- package/dist/src/utils/editor.d.ts +4 -2
- package/dist/src/utils/editor.js +53 -39
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/editor.test.js +18 -45
- package/dist/src/utils/editor.test.js.map +1 -1
- package/dist/src/utils/environmentContext.d.ts +2 -1
- package/dist/src/utils/environmentContext.js +20 -33
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/environmentContext.test.js +6 -34
- package/dist/src/utils/environmentContext.test.js.map +1 -1
- package/dist/src/utils/errorParsing.d.ts +1 -1
- package/dist/src/utils/errorParsing.js +5 -33
- package/dist/src/utils/errorParsing.js.map +1 -1
- package/dist/src/utils/errorParsing.test.js +0 -88
- package/dist/src/utils/errorParsing.test.js.map +1 -1
- package/dist/src/utils/errors.d.ts +3 -0
- package/dist/src/utils/errors.js +6 -0
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/events.d.ts +121 -0
- package/dist/src/utils/events.js +84 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/events.test.d.ts +6 -0
- package/dist/src/utils/events.test.js +212 -0
- package/dist/src/utils/events.test.js.map +1 -0
- package/dist/src/utils/extensionLoader.d.ts +86 -0
- package/dist/src/utils/extensionLoader.js +208 -0
- package/dist/src/utils/extensionLoader.js.map +1 -0
- package/dist/src/utils/extensionLoader.test.d.ts +6 -0
- package/dist/src/utils/extensionLoader.test.js +154 -0
- package/dist/src/utils/extensionLoader.test.js.map +1 -0
- package/dist/src/utils/fetch.d.ts +1 -0
- package/dist/src/utils/fetch.js +4 -0
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/fileUtils.d.ts +4 -0
- package/dist/src/utils/fileUtils.js +34 -2
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +87 -61
- package/dist/src/utils/fileUtils.test.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.js +1 -1
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
- package/dist/src/utils/flashFallback.test.js +28 -47
- package/dist/src/utils/flashFallback.test.js.map +1 -1
- package/dist/src/utils/formatters.d.ts +1 -0
- package/dist/src/utils/formatters.js +2 -1
- package/dist/src/utils/formatters.js.map +1 -1
- package/dist/src/utils/formatters.test.d.ts +6 -0
- package/dist/src/utils/formatters.test.js +26 -0
- package/dist/src/utils/formatters.test.js.map +1 -0
- package/dist/src/utils/getFolderStructure.js +9 -17
- package/dist/src/utils/getFolderStructure.js.map +1 -1
- package/dist/src/utils/getFolderStructure.test.js +7 -6
- package/dist/src/utils/getFolderStructure.test.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.d.ts +4 -1
- package/dist/src/utils/gitIgnoreParser.js +28 -10
- package/dist/src/utils/gitIgnoreParser.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.test.js +58 -0
- package/dist/src/utils/gitIgnoreParser.test.js.map +1 -1
- package/dist/src/utils/googleErrors.d.ts +104 -0
- package/dist/src/utils/googleErrors.js +152 -0
- package/dist/src/utils/googleErrors.js.map +1 -0
- package/dist/src/utils/googleErrors.test.d.ts +6 -0
- package/dist/src/utils/googleErrors.test.js +301 -0
- package/dist/src/utils/googleErrors.test.js.map +1 -0
- package/dist/src/utils/googleQuotaErrors.d.ts +37 -0
- package/dist/src/utils/googleQuotaErrors.js +157 -0
- package/dist/src/utils/googleQuotaErrors.js.map +1 -0
- package/dist/src/utils/googleQuotaErrors.test.d.ts +6 -0
- package/dist/src/utils/googleQuotaErrors.test.js +311 -0
- package/dist/src/utils/googleQuotaErrors.test.js.map +1 -0
- package/dist/src/utils/httpErrors.d.ts +18 -0
- package/dist/src/utils/httpErrors.js +36 -0
- package/dist/src/utils/httpErrors.js.map +1 -0
- package/dist/src/utils/ignorePatterns.test.js +26 -30
- package/dist/src/utils/ignorePatterns.test.js.map +1 -1
- package/dist/src/utils/installationManager.js +2 -1
- package/dist/src/utils/installationManager.js.map +1 -1
- package/dist/src/utils/installationManager.test.js +6 -4
- package/dist/src/utils/installationManager.test.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.d.ts +1 -1
- package/dist/src/utils/llm-edit-fixer.js +33 -9
- package/dist/src/utils/llm-edit-fixer.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.test.js +38 -1
- package/dist/src/utils/llm-edit-fixer.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +20 -1
- package/dist/src/utils/memoryDiscovery.js +176 -12
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +299 -40
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.js +4 -3
- package/dist/src/utils/memoryImportProcessor.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.test.js +8 -14
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.js +3 -3
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.test.js +13 -5
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -1
- package/dist/src/utils/package.d.ts +12 -0
- package/dist/src/utils/package.js +15 -0
- package/dist/src/utils/package.js.map +1 -0
- package/dist/src/utils/pathCorrector.d.ts +25 -0
- package/dist/src/utils/pathCorrector.js +33 -0
- package/dist/src/utils/pathCorrector.js.map +1 -0
- package/dist/src/utils/pathCorrector.test.d.ts +6 -0
- package/dist/src/utils/pathCorrector.test.js +83 -0
- package/dist/src/utils/pathCorrector.test.js.map +1 -0
- package/dist/src/utils/pathReader.js +4 -4
- package/dist/src/utils/pathReader.js.map +1 -1
- package/dist/src/utils/pathReader.test.js +44 -1
- package/dist/src/utils/pathReader.test.js.map +1 -1
- package/dist/src/utils/paths.d.ts +1 -1
- package/dist/src/utils/paths.js +131 -29
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/paths.test.js +200 -68
- package/dist/src/utils/paths.test.js.map +1 -1
- package/dist/src/utils/quotaErrorDetection.d.ts +0 -2
- package/dist/src/utils/quotaErrorDetection.js +0 -46
- package/dist/src/utils/quotaErrorDetection.js.map +1 -1
- package/dist/src/utils/retry.d.ts +3 -10
- package/dist/src/utils/retry.js +97 -195
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +179 -145
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/safeJsonStringify.d.ts +4 -4
- package/dist/src/utils/safeJsonStringify.js +31 -7
- package/dist/src/utils/safeJsonStringify.js.map +1 -1
- package/dist/src/utils/shell-utils.d.ts +15 -2
- package/dist/src/utils/shell-utils.js +387 -140
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +244 -62
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/src/utils/stdio.d.ts +32 -0
- package/dist/src/utils/stdio.js +85 -0
- package/dist/src/utils/stdio.js.map +1 -0
- package/dist/src/utils/stdio.test.d.ts +6 -0
- package/dist/src/utils/stdio.test.js +47 -0
- package/dist/src/utils/stdio.test.js.map +1 -0
- package/dist/src/utils/summarizer.d.ts +4 -2
- package/dist/src/utils/summarizer.js +8 -9
- package/dist/src/utils/summarizer.js.map +1 -1
- package/dist/src/utils/summarizer.test.js +32 -12
- package/dist/src/utils/summarizer.test.js.map +1 -1
- package/dist/src/utils/systemEncoding.js +5 -4
- package/dist/src/utils/systemEncoding.js.map +1 -1
- package/dist/src/utils/systemEncoding.test.js +2 -1
- package/dist/src/utils/systemEncoding.test.js.map +1 -1
- package/dist/src/utils/terminal.d.ts +14 -0
- package/dist/src/utils/terminal.js +38 -0
- package/dist/src/utils/terminal.js.map +1 -0
- package/dist/src/utils/tool-utils.d.ts +2 -2
- package/dist/src/utils/tool-utils.js +15 -6
- package/dist/src/utils/tool-utils.js.map +1 -1
- package/dist/src/utils/tool-utils.test.js +8 -0
- package/dist/src/utils/tool-utils.test.js.map +1 -1
- package/dist/src/utils/userAccountManager.js +5 -4
- package/dist/src/utils/userAccountManager.js.map +1 -1
- package/dist/src/utils/userAccountManager.test.js +9 -7
- package/dist/src/utils/userAccountManager.test.js.map +1 -1
- package/dist/src/utils/workspaceContext.d.ts +4 -3
- package/dist/src/utils/workspaceContext.js +13 -13
- package/dist/src/utils/workspaceContext.js.map +1 -1
- package/dist/src/utils/workspaceContext.test.js +8 -7
- package/dist/src/utils/workspaceContext.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -7
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
import { DiscoveredMCPTool } from '../tools/mcp-tool.js';
|
|
7
7
|
import { AuthType } from '../core/contentGenerator.js';
|
|
8
8
|
import { getDecisionFromOutcome, ToolCallDecision, } from './tool-call-decision.js';
|
|
9
|
+
import { getConventionAttributes } from './metrics.js';
|
|
9
10
|
export { ToolCallDecision };
|
|
11
|
+
import { getCommonAttributes } from './telemetryAttributes.js';
|
|
12
|
+
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
|
|
13
|
+
import { safeJsonStringify } from '../utils/safeJsonStringify.js';
|
|
14
|
+
import { toInputMessages, toOutputMessages, toFinishReasons, toOutputType, toSystemInstruction, } from './semantic.js';
|
|
15
|
+
export const EVENT_CLI_CONFIG = 'gemini_cli.config';
|
|
10
16
|
export class StartSessionEvent {
|
|
11
17
|
'event.name';
|
|
12
18
|
'event.timestamp';
|
|
@@ -26,9 +32,13 @@ export class StartSessionEvent {
|
|
|
26
32
|
mcp_tools_count;
|
|
27
33
|
mcp_tools;
|
|
28
34
|
output_format;
|
|
35
|
+
extensions_count;
|
|
36
|
+
extensions;
|
|
37
|
+
extension_ids;
|
|
38
|
+
auth_type;
|
|
29
39
|
constructor(config, toolRegistry) {
|
|
30
40
|
const generatorConfig = config.getContentGeneratorConfig();
|
|
31
|
-
const mcpServers = config.getMcpServers();
|
|
41
|
+
const mcpServers = config.getMcpClientManager()?.getMcpServers() ?? config.getMcpServers();
|
|
32
42
|
let useGemini = false;
|
|
33
43
|
let useVertex = false;
|
|
34
44
|
if (generatorConfig && generatorConfig.authType) {
|
|
@@ -36,6 +46,7 @@ export class StartSessionEvent {
|
|
|
36
46
|
useVertex = generatorConfig.authType === AuthType.USE_VERTEX_AI;
|
|
37
47
|
}
|
|
38
48
|
this['event.name'] = 'cli_config';
|
|
49
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
39
50
|
this.model = config.getModel();
|
|
40
51
|
this.embedding_model = config.getEmbeddingModel();
|
|
41
52
|
this.sandbox_enabled =
|
|
@@ -53,6 +64,11 @@ export class StartSessionEvent {
|
|
|
53
64
|
config.getFileFilteringRespectGitIgnore();
|
|
54
65
|
this.mcp_servers_count = mcpServers ? Object.keys(mcpServers).length : 0;
|
|
55
66
|
this.output_format = config.getOutputFormat();
|
|
67
|
+
const extensions = config.getExtensions();
|
|
68
|
+
this.extensions_count = extensions.length;
|
|
69
|
+
this.extensions = extensions.map((e) => e.name).join(',');
|
|
70
|
+
this.extension_ids = extensions.map((e) => e.id).join(',');
|
|
71
|
+
this.auth_type = generatorConfig?.authType;
|
|
56
72
|
if (toolRegistry) {
|
|
57
73
|
const mcpTools = toolRegistry
|
|
58
74
|
.getAllTools()
|
|
@@ -63,6 +79,35 @@ export class StartSessionEvent {
|
|
|
63
79
|
.join(',');
|
|
64
80
|
}
|
|
65
81
|
}
|
|
82
|
+
toOpenTelemetryAttributes(config) {
|
|
83
|
+
return {
|
|
84
|
+
...getCommonAttributes(config),
|
|
85
|
+
'event.name': EVENT_CLI_CONFIG,
|
|
86
|
+
'event.timestamp': this['event.timestamp'],
|
|
87
|
+
model: this.model,
|
|
88
|
+
embedding_model: this.embedding_model,
|
|
89
|
+
sandbox_enabled: this.sandbox_enabled,
|
|
90
|
+
core_tools_enabled: this.core_tools_enabled,
|
|
91
|
+
approval_mode: this.approval_mode,
|
|
92
|
+
api_key_enabled: this.api_key_enabled,
|
|
93
|
+
vertex_ai_enabled: this.vertex_ai_enabled,
|
|
94
|
+
log_user_prompts_enabled: this.telemetry_log_user_prompts_enabled,
|
|
95
|
+
file_filtering_respect_git_ignore: this.file_filtering_respect_git_ignore,
|
|
96
|
+
debug_mode: this.debug_enabled,
|
|
97
|
+
mcp_servers: this.mcp_servers,
|
|
98
|
+
mcp_servers_count: this.mcp_servers_count,
|
|
99
|
+
mcp_tools: this.mcp_tools,
|
|
100
|
+
mcp_tools_count: this.mcp_tools_count,
|
|
101
|
+
output_format: this.output_format,
|
|
102
|
+
extensions: this.extensions,
|
|
103
|
+
extensions_count: this.extensions_count,
|
|
104
|
+
extension_ids: this.extension_ids,
|
|
105
|
+
auth_type: this.auth_type,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
toLogBody() {
|
|
109
|
+
return 'CLI configuration loaded.';
|
|
110
|
+
}
|
|
66
111
|
}
|
|
67
112
|
export class EndSessionEvent {
|
|
68
113
|
'event.name';
|
|
@@ -73,7 +118,19 @@ export class EndSessionEvent {
|
|
|
73
118
|
this['event.timestamp'] = new Date().toISOString();
|
|
74
119
|
this.session_id = config?.getSessionId();
|
|
75
120
|
}
|
|
121
|
+
toOpenTelemetryAttributes(config) {
|
|
122
|
+
return {
|
|
123
|
+
...getCommonAttributes(config),
|
|
124
|
+
'event.name': this['event.name'],
|
|
125
|
+
'event.timestamp': this['event.timestamp'],
|
|
126
|
+
session_id: this.session_id,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
toLogBody() {
|
|
130
|
+
return 'Session ended.';
|
|
131
|
+
}
|
|
76
132
|
}
|
|
133
|
+
export const EVENT_USER_PROMPT = 'gemini_cli.user_prompt';
|
|
77
134
|
export class UserPromptEvent {
|
|
78
135
|
'event.name';
|
|
79
136
|
'event.timestamp';
|
|
@@ -89,7 +146,27 @@ export class UserPromptEvent {
|
|
|
89
146
|
this.auth_type = auth_type;
|
|
90
147
|
this.prompt = prompt;
|
|
91
148
|
}
|
|
149
|
+
toOpenTelemetryAttributes(config) {
|
|
150
|
+
const attributes = {
|
|
151
|
+
...getCommonAttributes(config),
|
|
152
|
+
'event.name': EVENT_USER_PROMPT,
|
|
153
|
+
'event.timestamp': this['event.timestamp'],
|
|
154
|
+
prompt_length: this.prompt_length,
|
|
155
|
+
prompt_id: this.prompt_id,
|
|
156
|
+
};
|
|
157
|
+
if (this.auth_type) {
|
|
158
|
+
attributes['auth_type'] = this.auth_type;
|
|
159
|
+
}
|
|
160
|
+
if (config.getTelemetryLogPromptsEnabled()) {
|
|
161
|
+
attributes['prompt'] = this.prompt;
|
|
162
|
+
}
|
|
163
|
+
return attributes;
|
|
164
|
+
}
|
|
165
|
+
toLogBody() {
|
|
166
|
+
return `User prompt. Length: ${this.prompt_length}.`;
|
|
167
|
+
}
|
|
92
168
|
}
|
|
169
|
+
export const EVENT_TOOL_CALL = 'gemini_cli.tool_call';
|
|
93
170
|
export class ToolCallEvent {
|
|
94
171
|
'event.name';
|
|
95
172
|
'event.timestamp';
|
|
@@ -104,50 +181,97 @@ export class ToolCallEvent {
|
|
|
104
181
|
tool_type;
|
|
105
182
|
content_length;
|
|
106
183
|
mcp_server_name;
|
|
184
|
+
extension_name;
|
|
185
|
+
extension_id;
|
|
107
186
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
187
|
metadata;
|
|
109
|
-
constructor(call) {
|
|
188
|
+
constructor(call, function_name, function_args, duration_ms, success, prompt_id, tool_type, error) {
|
|
110
189
|
this['event.name'] = 'tool_call';
|
|
111
190
|
this['event.timestamp'] = new Date().toISOString();
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
call.tool
|
|
125
|
-
|
|
126
|
-
|
|
191
|
+
if (call) {
|
|
192
|
+
this.function_name = call.request.name;
|
|
193
|
+
this.function_args = call.request.args;
|
|
194
|
+
this.duration_ms = call.durationMs ?? 0;
|
|
195
|
+
this.success = call.status === 'success';
|
|
196
|
+
this.decision = call.outcome
|
|
197
|
+
? getDecisionFromOutcome(call.outcome)
|
|
198
|
+
: undefined;
|
|
199
|
+
this.error = call.response.error?.message;
|
|
200
|
+
this.error_type = call.response.errorType;
|
|
201
|
+
this.prompt_id = call.request.prompt_id;
|
|
202
|
+
this.content_length = call.response.contentLength;
|
|
203
|
+
if (typeof call.tool !== 'undefined' &&
|
|
204
|
+
call.tool instanceof DiscoveredMCPTool) {
|
|
205
|
+
this.tool_type = 'mcp';
|
|
206
|
+
this.mcp_server_name = call.tool.serverName;
|
|
207
|
+
this.extension_name = call.tool.extensionName;
|
|
208
|
+
this.extension_id = call.tool.extensionId;
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
this.tool_type = 'native';
|
|
212
|
+
}
|
|
213
|
+
if (call.status === 'success' &&
|
|
214
|
+
typeof call.response.resultDisplay === 'object' &&
|
|
215
|
+
call.response.resultDisplay !== null &&
|
|
216
|
+
'diffStat' in call.response.resultDisplay) {
|
|
217
|
+
const diffStat = call.response.resultDisplay.diffStat;
|
|
218
|
+
if (diffStat) {
|
|
219
|
+
this.metadata = {
|
|
220
|
+
model_added_lines: diffStat.model_added_lines,
|
|
221
|
+
model_removed_lines: diffStat.model_removed_lines,
|
|
222
|
+
model_added_chars: diffStat.model_added_chars,
|
|
223
|
+
model_removed_chars: diffStat.model_removed_chars,
|
|
224
|
+
user_added_lines: diffStat.user_added_lines,
|
|
225
|
+
user_removed_lines: diffStat.user_removed_lines,
|
|
226
|
+
user_added_chars: diffStat.user_added_chars,
|
|
227
|
+
user_removed_chars: diffStat.user_removed_chars,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
127
231
|
}
|
|
128
232
|
else {
|
|
129
|
-
this.
|
|
233
|
+
this.function_name = function_name;
|
|
234
|
+
this.function_args = function_args;
|
|
235
|
+
this.duration_ms = duration_ms;
|
|
236
|
+
this.success = success;
|
|
237
|
+
this.prompt_id = prompt_id;
|
|
238
|
+
this.tool_type = tool_type;
|
|
239
|
+
this.error = error;
|
|
130
240
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
241
|
+
}
|
|
242
|
+
toOpenTelemetryAttributes(config) {
|
|
243
|
+
const attributes = {
|
|
244
|
+
...getCommonAttributes(config),
|
|
245
|
+
'event.name': EVENT_TOOL_CALL,
|
|
246
|
+
'event.timestamp': this['event.timestamp'],
|
|
247
|
+
function_name: this.function_name,
|
|
248
|
+
function_args: safeJsonStringify(this.function_args, 2),
|
|
249
|
+
duration_ms: this.duration_ms,
|
|
250
|
+
success: this.success,
|
|
251
|
+
decision: this.decision,
|
|
252
|
+
prompt_id: this.prompt_id,
|
|
253
|
+
tool_type: this.tool_type,
|
|
254
|
+
content_length: this.content_length,
|
|
255
|
+
mcp_server_name: this.mcp_server_name,
|
|
256
|
+
extension_name: this.extension_name,
|
|
257
|
+
extension_id: this.extension_id,
|
|
258
|
+
metadata: this.metadata,
|
|
259
|
+
};
|
|
260
|
+
if (this.error) {
|
|
261
|
+
attributes['error'] = this.error;
|
|
262
|
+
attributes['error.message'] = this.error;
|
|
263
|
+
if (this.error_type) {
|
|
264
|
+
attributes['error_type'] = this.error_type;
|
|
265
|
+
attributes['error.type'] = this.error_type;
|
|
147
266
|
}
|
|
148
267
|
}
|
|
268
|
+
return attributes;
|
|
269
|
+
}
|
|
270
|
+
toLogBody() {
|
|
271
|
+
return `Tool call: ${this.function_name}${this.decision ? `. Decision: ${this.decision}` : ''}. Success: ${this.success}. Duration: ${this.duration_ms}ms.`;
|
|
149
272
|
}
|
|
150
273
|
}
|
|
274
|
+
export const EVENT_API_REQUEST = 'gemini_cli.api_request';
|
|
151
275
|
export class ApiRequestEvent {
|
|
152
276
|
'event.name';
|
|
153
277
|
'event.timestamp';
|
|
@@ -161,18 +285,32 @@ export class ApiRequestEvent {
|
|
|
161
285
|
this.prompt_id = prompt_id;
|
|
162
286
|
this.request_text = request_text;
|
|
163
287
|
}
|
|
288
|
+
toOpenTelemetryAttributes(config) {
|
|
289
|
+
return {
|
|
290
|
+
...getCommonAttributes(config),
|
|
291
|
+
'event.name': EVENT_API_REQUEST,
|
|
292
|
+
'event.timestamp': this['event.timestamp'],
|
|
293
|
+
model: this.model,
|
|
294
|
+
prompt_id: this.prompt_id,
|
|
295
|
+
request_text: this.request_text,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
toLogBody() {
|
|
299
|
+
return `API request to ${this.model}.`;
|
|
300
|
+
}
|
|
164
301
|
}
|
|
302
|
+
export const EVENT_API_ERROR = 'gemini_cli.api_error';
|
|
165
303
|
export class ApiErrorEvent {
|
|
166
304
|
'event.name';
|
|
167
305
|
'event.timestamp';
|
|
168
306
|
model;
|
|
307
|
+
prompt;
|
|
169
308
|
error;
|
|
170
309
|
error_type;
|
|
171
310
|
status_code;
|
|
172
311
|
duration_ms;
|
|
173
|
-
prompt_id;
|
|
174
312
|
auth_type;
|
|
175
|
-
constructor(model, error, duration_ms,
|
|
313
|
+
constructor(model, error, duration_ms, prompt_details, auth_type, error_type, status_code) {
|
|
176
314
|
this['event.name'] = 'api_error';
|
|
177
315
|
this['event.timestamp'] = new Date().toISOString();
|
|
178
316
|
this.model = model;
|
|
@@ -180,42 +318,169 @@ export class ApiErrorEvent {
|
|
|
180
318
|
this.error_type = error_type;
|
|
181
319
|
this.status_code = status_code;
|
|
182
320
|
this.duration_ms = duration_ms;
|
|
183
|
-
this.
|
|
321
|
+
this.prompt = prompt_details;
|
|
184
322
|
this.auth_type = auth_type;
|
|
185
323
|
}
|
|
324
|
+
toLogRecord(config) {
|
|
325
|
+
const attributes = {
|
|
326
|
+
...getCommonAttributes(config),
|
|
327
|
+
'event.name': EVENT_API_ERROR,
|
|
328
|
+
'event.timestamp': this['event.timestamp'],
|
|
329
|
+
['error.message']: this.error,
|
|
330
|
+
model_name: this.model,
|
|
331
|
+
duration: this.duration_ms,
|
|
332
|
+
model: this.model,
|
|
333
|
+
error: this.error,
|
|
334
|
+
status_code: this.status_code,
|
|
335
|
+
duration_ms: this.duration_ms,
|
|
336
|
+
prompt_id: this.prompt.prompt_id,
|
|
337
|
+
auth_type: this.auth_type,
|
|
338
|
+
};
|
|
339
|
+
if (this.error_type) {
|
|
340
|
+
attributes['error.type'] = this.error_type;
|
|
341
|
+
}
|
|
342
|
+
if (typeof this.status_code === 'number') {
|
|
343
|
+
attributes[SemanticAttributes.HTTP_STATUS_CODE] = this.status_code;
|
|
344
|
+
}
|
|
345
|
+
const logRecord = {
|
|
346
|
+
body: `API error for ${this.model}. Error: ${this.error}. Duration: ${this.duration_ms}ms.`,
|
|
347
|
+
attributes,
|
|
348
|
+
};
|
|
349
|
+
return logRecord;
|
|
350
|
+
}
|
|
351
|
+
toSemanticLogRecord(config) {
|
|
352
|
+
const attributes = {
|
|
353
|
+
...getCommonAttributes(config),
|
|
354
|
+
'event.name': EVENT_GEN_AI_OPERATION_DETAILS,
|
|
355
|
+
'event.timestamp': this['event.timestamp'],
|
|
356
|
+
...toGenerateContentConfigAttributes(this.prompt.generate_content_config),
|
|
357
|
+
...getConventionAttributes(this),
|
|
358
|
+
};
|
|
359
|
+
if (this.prompt.server) {
|
|
360
|
+
attributes['server.address'] = this.prompt.server.address;
|
|
361
|
+
attributes['server.port'] = this.prompt.server.port;
|
|
362
|
+
}
|
|
363
|
+
if (config.getTelemetryLogPromptsEnabled() && this.prompt.contents) {
|
|
364
|
+
attributes['gen_ai.input.messages'] = JSON.stringify(toInputMessages(this.prompt.contents));
|
|
365
|
+
}
|
|
366
|
+
const logRecord = {
|
|
367
|
+
body: `GenAI operation error details from ${this.model}. Error: ${this.error}. Duration: ${this.duration_ms}ms.`,
|
|
368
|
+
attributes,
|
|
369
|
+
};
|
|
370
|
+
return logRecord;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
export const EVENT_API_RESPONSE = 'gemini_cli.api_response';
|
|
374
|
+
export const EVENT_GEN_AI_OPERATION_DETAILS = 'gen_ai.client.inference.operation.details';
|
|
375
|
+
function toGenerateContentConfigAttributes(config) {
|
|
376
|
+
if (!config) {
|
|
377
|
+
return {};
|
|
378
|
+
}
|
|
379
|
+
return {
|
|
380
|
+
'gen_ai.request.temperature': config.temperature,
|
|
381
|
+
'gen_ai.request.top_p': config.topP,
|
|
382
|
+
'gen_ai.request.top_k': config.topK,
|
|
383
|
+
'gen_ai.request.choice.count': config.candidateCount,
|
|
384
|
+
'gen_ai.request.seed': config.seed,
|
|
385
|
+
'gen_ai.request.frequency_penalty': config.frequencyPenalty,
|
|
386
|
+
'gen_ai.request.presence_penalty': config.presencePenalty,
|
|
387
|
+
'gen_ai.request.max_tokens': config.maxOutputTokens,
|
|
388
|
+
'gen_ai.output.type': toOutputType(config.responseMimeType),
|
|
389
|
+
'gen_ai.request.stop_sequences': config.stopSequences,
|
|
390
|
+
'gen_ai.system_instructions': JSON.stringify(toSystemInstruction(config.systemInstruction)),
|
|
391
|
+
};
|
|
186
392
|
}
|
|
187
393
|
export class ApiResponseEvent {
|
|
188
394
|
'event.name';
|
|
189
395
|
'event.timestamp';
|
|
190
|
-
model;
|
|
191
396
|
status_code;
|
|
192
397
|
duration_ms;
|
|
193
|
-
input_token_count;
|
|
194
|
-
output_token_count;
|
|
195
|
-
cached_content_token_count;
|
|
196
|
-
thoughts_token_count;
|
|
197
|
-
tool_token_count;
|
|
198
|
-
total_token_count;
|
|
199
398
|
response_text;
|
|
200
|
-
prompt_id;
|
|
201
399
|
auth_type;
|
|
202
|
-
|
|
400
|
+
model;
|
|
401
|
+
prompt;
|
|
402
|
+
response;
|
|
403
|
+
usage;
|
|
404
|
+
constructor(model, duration_ms, prompt_details, response_details, auth_type, usage_data, response_text) {
|
|
203
405
|
this['event.name'] = 'api_response';
|
|
204
406
|
this['event.timestamp'] = new Date().toISOString();
|
|
205
|
-
this.model = model;
|
|
206
407
|
this.duration_ms = duration_ms;
|
|
207
408
|
this.status_code = 200;
|
|
208
|
-
this.input_token_count = usage_data?.promptTokenCount ?? 0;
|
|
209
|
-
this.output_token_count = usage_data?.candidatesTokenCount ?? 0;
|
|
210
|
-
this.cached_content_token_count = usage_data?.cachedContentTokenCount ?? 0;
|
|
211
|
-
this.thoughts_token_count = usage_data?.thoughtsTokenCount ?? 0;
|
|
212
|
-
this.tool_token_count = usage_data?.toolUsePromptTokenCount ?? 0;
|
|
213
|
-
this.total_token_count = usage_data?.totalTokenCount ?? 0;
|
|
214
409
|
this.response_text = response_text;
|
|
215
|
-
this.prompt_id = prompt_id;
|
|
216
410
|
this.auth_type = auth_type;
|
|
411
|
+
this.model = model;
|
|
412
|
+
this.prompt = prompt_details;
|
|
413
|
+
this.response = response_details;
|
|
414
|
+
this.usage = {
|
|
415
|
+
input_token_count: usage_data?.promptTokenCount ?? 0,
|
|
416
|
+
output_token_count: usage_data?.candidatesTokenCount ?? 0,
|
|
417
|
+
cached_content_token_count: usage_data?.cachedContentTokenCount ?? 0,
|
|
418
|
+
thoughts_token_count: usage_data?.thoughtsTokenCount ?? 0,
|
|
419
|
+
tool_token_count: usage_data?.toolUsePromptTokenCount ?? 0,
|
|
420
|
+
total_token_count: usage_data?.totalTokenCount ?? 0,
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
toLogRecord(config) {
|
|
424
|
+
const attributes = {
|
|
425
|
+
...getCommonAttributes(config),
|
|
426
|
+
'event.name': EVENT_API_RESPONSE,
|
|
427
|
+
'event.timestamp': this['event.timestamp'],
|
|
428
|
+
model: this.model,
|
|
429
|
+
duration_ms: this.duration_ms,
|
|
430
|
+
input_token_count: this.usage.input_token_count,
|
|
431
|
+
output_token_count: this.usage.output_token_count,
|
|
432
|
+
cached_content_token_count: this.usage.cached_content_token_count,
|
|
433
|
+
thoughts_token_count: this.usage.thoughts_token_count,
|
|
434
|
+
tool_token_count: this.usage.tool_token_count,
|
|
435
|
+
total_token_count: this.usage.total_token_count,
|
|
436
|
+
prompt_id: this.prompt.prompt_id,
|
|
437
|
+
auth_type: this.auth_type,
|
|
438
|
+
status_code: this.status_code,
|
|
439
|
+
};
|
|
440
|
+
if (this.response_text) {
|
|
441
|
+
attributes['response_text'] = this.response_text;
|
|
442
|
+
}
|
|
443
|
+
if (this.status_code) {
|
|
444
|
+
if (typeof this.status_code === 'number') {
|
|
445
|
+
attributes[SemanticAttributes.HTTP_STATUS_CODE] = this.status_code;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
const logRecord = {
|
|
449
|
+
body: `API response from ${this.model}. Status: ${this.status_code || 'N/A'}. Duration: ${this.duration_ms}ms.`,
|
|
450
|
+
attributes,
|
|
451
|
+
};
|
|
452
|
+
return logRecord;
|
|
453
|
+
}
|
|
454
|
+
toSemanticLogRecord(config) {
|
|
455
|
+
const attributes = {
|
|
456
|
+
...getCommonAttributes(config),
|
|
457
|
+
'event.name': EVENT_GEN_AI_OPERATION_DETAILS,
|
|
458
|
+
'event.timestamp': this['event.timestamp'],
|
|
459
|
+
'gen_ai.response.id': this.response.response_id,
|
|
460
|
+
'gen_ai.response.finish_reasons': toFinishReasons(this.response.candidates),
|
|
461
|
+
'gen_ai.output.messages': JSON.stringify(toOutputMessages(this.response.candidates)),
|
|
462
|
+
...toGenerateContentConfigAttributes(this.prompt.generate_content_config),
|
|
463
|
+
...getConventionAttributes(this),
|
|
464
|
+
};
|
|
465
|
+
if (this.prompt.server) {
|
|
466
|
+
attributes['server.address'] = this.prompt.server.address;
|
|
467
|
+
attributes['server.port'] = this.prompt.server.port;
|
|
468
|
+
}
|
|
469
|
+
if (config.getTelemetryLogPromptsEnabled() && this.prompt.contents) {
|
|
470
|
+
attributes['gen_ai.input.messages'] = JSON.stringify(toInputMessages(this.prompt.contents));
|
|
471
|
+
}
|
|
472
|
+
if (this.usage) {
|
|
473
|
+
attributes['gen_ai.usage.input_tokens'] = this.usage.input_token_count;
|
|
474
|
+
attributes['gen_ai.usage.output_tokens'] = this.usage.output_token_count;
|
|
475
|
+
}
|
|
476
|
+
const logRecord = {
|
|
477
|
+
body: `GenAI operation details from ${this.model}. Status: ${this.status_code || 'N/A'}. Duration: ${this.duration_ms}ms.`,
|
|
478
|
+
attributes,
|
|
479
|
+
};
|
|
480
|
+
return logRecord;
|
|
217
481
|
}
|
|
218
482
|
}
|
|
483
|
+
export const EVENT_FLASH_FALLBACK = 'gemini_cli.flash_fallback';
|
|
219
484
|
export class FlashFallbackEvent {
|
|
220
485
|
'event.name';
|
|
221
486
|
'event.timestamp';
|
|
@@ -225,7 +490,19 @@ export class FlashFallbackEvent {
|
|
|
225
490
|
this['event.timestamp'] = new Date().toISOString();
|
|
226
491
|
this.auth_type = auth_type;
|
|
227
492
|
}
|
|
493
|
+
toOpenTelemetryAttributes(config) {
|
|
494
|
+
return {
|
|
495
|
+
...getCommonAttributes(config),
|
|
496
|
+
'event.name': EVENT_FLASH_FALLBACK,
|
|
497
|
+
'event.timestamp': this['event.timestamp'],
|
|
498
|
+
auth_type: this.auth_type,
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
toLogBody() {
|
|
502
|
+
return `Switching to flash as Fallback.`;
|
|
503
|
+
}
|
|
228
504
|
}
|
|
505
|
+
export const EVENT_RIPGREP_FALLBACK = 'gemini_cli.ripgrep_fallback';
|
|
229
506
|
export class RipgrepFallbackEvent {
|
|
230
507
|
error;
|
|
231
508
|
'event.name';
|
|
@@ -235,6 +512,17 @@ export class RipgrepFallbackEvent {
|
|
|
235
512
|
this['event.name'] = 'ripgrep_fallback';
|
|
236
513
|
this['event.timestamp'] = new Date().toISOString();
|
|
237
514
|
}
|
|
515
|
+
toOpenTelemetryAttributes(config) {
|
|
516
|
+
return {
|
|
517
|
+
...getCommonAttributes(config),
|
|
518
|
+
'event.name': EVENT_RIPGREP_FALLBACK,
|
|
519
|
+
'event.timestamp': this['event.timestamp'],
|
|
520
|
+
error: this.error,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
toLogBody() {
|
|
524
|
+
return `Switching to grep as fallback.`;
|
|
525
|
+
}
|
|
238
526
|
}
|
|
239
527
|
export var LoopType;
|
|
240
528
|
(function (LoopType) {
|
|
@@ -247,11 +535,29 @@ export class LoopDetectedEvent {
|
|
|
247
535
|
'event.timestamp';
|
|
248
536
|
loop_type;
|
|
249
537
|
prompt_id;
|
|
250
|
-
|
|
538
|
+
confirmed_by_model;
|
|
539
|
+
constructor(loop_type, prompt_id, confirmed_by_model) {
|
|
251
540
|
this['event.name'] = 'loop_detected';
|
|
252
541
|
this['event.timestamp'] = new Date().toISOString();
|
|
253
542
|
this.loop_type = loop_type;
|
|
254
543
|
this.prompt_id = prompt_id;
|
|
544
|
+
this.confirmed_by_model = confirmed_by_model;
|
|
545
|
+
}
|
|
546
|
+
toOpenTelemetryAttributes(config) {
|
|
547
|
+
const attributes = {
|
|
548
|
+
...getCommonAttributes(config),
|
|
549
|
+
'event.name': this['event.name'],
|
|
550
|
+
'event.timestamp': this['event.timestamp'],
|
|
551
|
+
loop_type: this.loop_type,
|
|
552
|
+
prompt_id: this.prompt_id,
|
|
553
|
+
};
|
|
554
|
+
if (this.confirmed_by_model) {
|
|
555
|
+
attributes['confirmed_by_model'] = this.confirmed_by_model;
|
|
556
|
+
}
|
|
557
|
+
return attributes;
|
|
558
|
+
}
|
|
559
|
+
toLogBody() {
|
|
560
|
+
return `Loop detected. Type: ${this.loop_type}.${this.confirmed_by_model ? ` Confirmed by: ${this.confirmed_by_model}` : ''}`;
|
|
255
561
|
}
|
|
256
562
|
}
|
|
257
563
|
export class LoopDetectionDisabledEvent {
|
|
@@ -263,7 +569,19 @@ export class LoopDetectionDisabledEvent {
|
|
|
263
569
|
this['event.timestamp'] = new Date().toISOString();
|
|
264
570
|
this.prompt_id = prompt_id;
|
|
265
571
|
}
|
|
572
|
+
toOpenTelemetryAttributes(config) {
|
|
573
|
+
return {
|
|
574
|
+
...getCommonAttributes(config),
|
|
575
|
+
'event.name': this['event.name'],
|
|
576
|
+
'event.timestamp': this['event.timestamp'],
|
|
577
|
+
prompt_id: this.prompt_id,
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
toLogBody() {
|
|
581
|
+
return `Loop detection disabled.`;
|
|
582
|
+
}
|
|
266
583
|
}
|
|
584
|
+
export const EVENT_NEXT_SPEAKER_CHECK = 'gemini_cli.next_speaker_check';
|
|
267
585
|
export class NextSpeakerCheckEvent {
|
|
268
586
|
'event.name';
|
|
269
587
|
'event.timestamp';
|
|
@@ -277,14 +595,43 @@ export class NextSpeakerCheckEvent {
|
|
|
277
595
|
this.finish_reason = finish_reason;
|
|
278
596
|
this.result = result;
|
|
279
597
|
}
|
|
598
|
+
toOpenTelemetryAttributes(config) {
|
|
599
|
+
return {
|
|
600
|
+
...getCommonAttributes(config),
|
|
601
|
+
'event.name': EVENT_NEXT_SPEAKER_CHECK,
|
|
602
|
+
'event.timestamp': this['event.timestamp'],
|
|
603
|
+
prompt_id: this.prompt_id,
|
|
604
|
+
finish_reason: this.finish_reason,
|
|
605
|
+
result: this.result,
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
toLogBody() {
|
|
609
|
+
return `Next speaker check.`;
|
|
610
|
+
}
|
|
280
611
|
}
|
|
281
|
-
export
|
|
612
|
+
export const EVENT_SLASH_COMMAND = 'gemini_cli.slash_command';
|
|
613
|
+
export function makeSlashCommandEvent({ command, subcommand, status, extension_id, }) {
|
|
282
614
|
return {
|
|
283
615
|
'event.name': 'slash_command',
|
|
284
616
|
'event.timestamp': new Date().toISOString(),
|
|
285
617
|
command,
|
|
286
618
|
subcommand,
|
|
287
619
|
status,
|
|
620
|
+
extension_id,
|
|
621
|
+
toOpenTelemetryAttributes(config) {
|
|
622
|
+
return {
|
|
623
|
+
...getCommonAttributes(config),
|
|
624
|
+
'event.name': EVENT_SLASH_COMMAND,
|
|
625
|
+
'event.timestamp': this['event.timestamp'],
|
|
626
|
+
command: this.command,
|
|
627
|
+
subcommand: this.subcommand,
|
|
628
|
+
status: this.status,
|
|
629
|
+
extension_id: this.extension_id,
|
|
630
|
+
};
|
|
631
|
+
},
|
|
632
|
+
toLogBody() {
|
|
633
|
+
return `Slash command: ${this.command}.`;
|
|
634
|
+
},
|
|
288
635
|
};
|
|
289
636
|
}
|
|
290
637
|
export var SlashCommandStatus;
|
|
@@ -292,14 +639,28 @@ export var SlashCommandStatus;
|
|
|
292
639
|
SlashCommandStatus["SUCCESS"] = "success";
|
|
293
640
|
SlashCommandStatus["ERROR"] = "error";
|
|
294
641
|
})(SlashCommandStatus || (SlashCommandStatus = {}));
|
|
642
|
+
export const EVENT_CHAT_COMPRESSION = 'gemini_cli.chat_compression';
|
|
295
643
|
export function makeChatCompressionEvent({ tokens_before, tokens_after, }) {
|
|
296
644
|
return {
|
|
297
645
|
'event.name': 'chat_compression',
|
|
298
646
|
'event.timestamp': new Date().toISOString(),
|
|
299
647
|
tokens_before,
|
|
300
648
|
tokens_after,
|
|
649
|
+
toOpenTelemetryAttributes(config) {
|
|
650
|
+
return {
|
|
651
|
+
...getCommonAttributes(config),
|
|
652
|
+
'event.name': EVENT_CHAT_COMPRESSION,
|
|
653
|
+
'event.timestamp': this['event.timestamp'],
|
|
654
|
+
tokens_before: this.tokens_before,
|
|
655
|
+
tokens_after: this.tokens_after,
|
|
656
|
+
};
|
|
657
|
+
},
|
|
658
|
+
toLogBody() {
|
|
659
|
+
return `Chat compression (Saved ${this.tokens_before - this.tokens_after} tokens)`;
|
|
660
|
+
},
|
|
301
661
|
};
|
|
302
662
|
}
|
|
663
|
+
export const EVENT_MALFORMED_JSON_RESPONSE = 'gemini_cli.malformed_json_response';
|
|
303
664
|
export class MalformedJsonResponseEvent {
|
|
304
665
|
'event.name';
|
|
305
666
|
'event.timestamp';
|
|
@@ -309,12 +670,24 @@ export class MalformedJsonResponseEvent {
|
|
|
309
670
|
this['event.timestamp'] = new Date().toISOString();
|
|
310
671
|
this.model = model;
|
|
311
672
|
}
|
|
673
|
+
toOpenTelemetryAttributes(config) {
|
|
674
|
+
return {
|
|
675
|
+
...getCommonAttributes(config),
|
|
676
|
+
'event.name': EVENT_MALFORMED_JSON_RESPONSE,
|
|
677
|
+
'event.timestamp': this['event.timestamp'],
|
|
678
|
+
model: this.model,
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
toLogBody() {
|
|
682
|
+
return `Malformed JSON response from ${this.model}.`;
|
|
683
|
+
}
|
|
312
684
|
}
|
|
313
685
|
export var IdeConnectionType;
|
|
314
686
|
(function (IdeConnectionType) {
|
|
315
687
|
IdeConnectionType["START"] = "start";
|
|
316
688
|
IdeConnectionType["SESSION"] = "session";
|
|
317
689
|
})(IdeConnectionType || (IdeConnectionType = {}));
|
|
690
|
+
export const EVENT_IDE_CONNECTION = 'gemini_cli.ide_connection';
|
|
318
691
|
export class IdeConnectionEvent {
|
|
319
692
|
'event.name';
|
|
320
693
|
'event.timestamp';
|
|
@@ -324,7 +697,19 @@ export class IdeConnectionEvent {
|
|
|
324
697
|
this['event.timestamp'] = new Date().toISOString();
|
|
325
698
|
this.connection_type = connection_type;
|
|
326
699
|
}
|
|
700
|
+
toOpenTelemetryAttributes(config) {
|
|
701
|
+
return {
|
|
702
|
+
...getCommonAttributes(config),
|
|
703
|
+
'event.name': EVENT_IDE_CONNECTION,
|
|
704
|
+
'event.timestamp': this['event.timestamp'],
|
|
705
|
+
connection_type: this.connection_type,
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
toLogBody() {
|
|
709
|
+
return `Ide connection. Type: ${this.connection_type}.`;
|
|
710
|
+
}
|
|
327
711
|
}
|
|
712
|
+
export const EVENT_CONVERSATION_FINISHED = 'gemini_cli.conversation_finished';
|
|
328
713
|
export class ConversationFinishedEvent {
|
|
329
714
|
'event_name';
|
|
330
715
|
'event.timestamp'; // ISO 8601;
|
|
@@ -336,20 +721,20 @@ export class ConversationFinishedEvent {
|
|
|
336
721
|
this.approvalMode = approvalMode;
|
|
337
722
|
this.turnCount = turnCount;
|
|
338
723
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
this.truncated_sequence = truncated_sequence.substring(0, 20);
|
|
724
|
+
toOpenTelemetryAttributes(config) {
|
|
725
|
+
return {
|
|
726
|
+
...getCommonAttributes(config),
|
|
727
|
+
'event.name': EVENT_CONVERSATION_FINISHED,
|
|
728
|
+
'event.timestamp': this['event.timestamp'],
|
|
729
|
+
approvalMode: this.approvalMode,
|
|
730
|
+
turnCount: this.turnCount,
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
toLogBody() {
|
|
734
|
+
return `Conversation finished.`;
|
|
351
735
|
}
|
|
352
736
|
}
|
|
737
|
+
export const EVENT_FILE_OPERATION = 'gemini_cli.file_operation';
|
|
353
738
|
export class FileOperationEvent {
|
|
354
739
|
'event.name';
|
|
355
740
|
'event.timestamp';
|
|
@@ -369,7 +754,33 @@ export class FileOperationEvent {
|
|
|
369
754
|
this.extension = extension;
|
|
370
755
|
this.programming_language = programming_language;
|
|
371
756
|
}
|
|
757
|
+
toOpenTelemetryAttributes(config) {
|
|
758
|
+
const attributes = {
|
|
759
|
+
...getCommonAttributes(config),
|
|
760
|
+
'event.name': EVENT_FILE_OPERATION,
|
|
761
|
+
'event.timestamp': this['event.timestamp'],
|
|
762
|
+
tool_name: this.tool_name,
|
|
763
|
+
operation: this.operation,
|
|
764
|
+
};
|
|
765
|
+
if (this.lines) {
|
|
766
|
+
attributes['lines'] = this.lines;
|
|
767
|
+
}
|
|
768
|
+
if (this.mimetype) {
|
|
769
|
+
attributes['mimetype'] = this.mimetype;
|
|
770
|
+
}
|
|
771
|
+
if (this.extension) {
|
|
772
|
+
attributes['extension'] = this.extension;
|
|
773
|
+
}
|
|
774
|
+
if (this.programming_language) {
|
|
775
|
+
attributes['programming_language'] = this.programming_language;
|
|
776
|
+
}
|
|
777
|
+
return attributes;
|
|
778
|
+
}
|
|
779
|
+
toLogBody() {
|
|
780
|
+
return `File operation: ${this.operation}. Lines: ${this.lines}.`;
|
|
781
|
+
}
|
|
372
782
|
}
|
|
783
|
+
export const EVENT_INVALID_CHUNK = 'gemini_cli.chat.invalid_chunk';
|
|
373
784
|
// Add these new event interfaces
|
|
374
785
|
export class InvalidChunkEvent {
|
|
375
786
|
'event.name';
|
|
@@ -380,7 +791,22 @@ export class InvalidChunkEvent {
|
|
|
380
791
|
this['event.timestamp'] = new Date().toISOString();
|
|
381
792
|
this.error_message = error_message;
|
|
382
793
|
}
|
|
794
|
+
toOpenTelemetryAttributes(config) {
|
|
795
|
+
const attributes = {
|
|
796
|
+
...getCommonAttributes(config),
|
|
797
|
+
'event.name': EVENT_INVALID_CHUNK,
|
|
798
|
+
'event.timestamp': this['event.timestamp'],
|
|
799
|
+
};
|
|
800
|
+
if (this.error_message) {
|
|
801
|
+
attributes['error.message'] = this.error_message;
|
|
802
|
+
}
|
|
803
|
+
return attributes;
|
|
804
|
+
}
|
|
805
|
+
toLogBody() {
|
|
806
|
+
return `Invalid chunk received from stream.`;
|
|
807
|
+
}
|
|
383
808
|
}
|
|
809
|
+
export const EVENT_CONTENT_RETRY = 'gemini_cli.chat.content_retry';
|
|
384
810
|
export class ContentRetryEvent {
|
|
385
811
|
'event.name';
|
|
386
812
|
'event.timestamp';
|
|
@@ -396,7 +822,22 @@ export class ContentRetryEvent {
|
|
|
396
822
|
this.retry_delay_ms = retry_delay_ms;
|
|
397
823
|
this.model = model;
|
|
398
824
|
}
|
|
825
|
+
toOpenTelemetryAttributes(config) {
|
|
826
|
+
return {
|
|
827
|
+
...getCommonAttributes(config),
|
|
828
|
+
'event.name': EVENT_CONTENT_RETRY,
|
|
829
|
+
'event.timestamp': this['event.timestamp'],
|
|
830
|
+
attempt_number: this.attempt_number,
|
|
831
|
+
error_type: this.error_type,
|
|
832
|
+
retry_delay_ms: this.retry_delay_ms,
|
|
833
|
+
model: this.model,
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
toLogBody() {
|
|
837
|
+
return `Content retry attempt ${this.attempt_number} due to ${this.error_type}.`;
|
|
838
|
+
}
|
|
399
839
|
}
|
|
840
|
+
export const EVENT_CONTENT_RETRY_FAILURE = 'gemini_cli.chat.content_retry_failure';
|
|
400
841
|
export class ContentRetryFailureEvent {
|
|
401
842
|
'event.name';
|
|
402
843
|
'event.timestamp';
|
|
@@ -412,7 +853,22 @@ export class ContentRetryFailureEvent {
|
|
|
412
853
|
this.total_duration_ms = total_duration_ms;
|
|
413
854
|
this.model = model;
|
|
414
855
|
}
|
|
856
|
+
toOpenTelemetryAttributes(config) {
|
|
857
|
+
return {
|
|
858
|
+
...getCommonAttributes(config),
|
|
859
|
+
'event.name': EVENT_CONTENT_RETRY_FAILURE,
|
|
860
|
+
'event.timestamp': this['event.timestamp'],
|
|
861
|
+
total_attempts: this.total_attempts,
|
|
862
|
+
final_error_type: this.final_error_type,
|
|
863
|
+
total_duration_ms: this.total_duration_ms,
|
|
864
|
+
model: this.model,
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
toLogBody() {
|
|
868
|
+
return `All content retries failed after ${this.total_attempts} attempts.`;
|
|
869
|
+
}
|
|
415
870
|
}
|
|
871
|
+
export const EVENT_MODEL_ROUTING = 'gemini_cli.model_routing';
|
|
416
872
|
export class ModelRoutingEvent {
|
|
417
873
|
'event.name';
|
|
418
874
|
'event.timestamp';
|
|
@@ -432,23 +888,57 @@ export class ModelRoutingEvent {
|
|
|
432
888
|
this.failed = failed;
|
|
433
889
|
this.error_message = error_message;
|
|
434
890
|
}
|
|
891
|
+
toOpenTelemetryAttributes(config) {
|
|
892
|
+
return {
|
|
893
|
+
...getCommonAttributes(config),
|
|
894
|
+
'event.name': EVENT_MODEL_ROUTING,
|
|
895
|
+
'event.timestamp': this['event.timestamp'],
|
|
896
|
+
decision_model: this.decision_model,
|
|
897
|
+
decision_source: this.decision_source,
|
|
898
|
+
routing_latency_ms: this.routing_latency_ms,
|
|
899
|
+
reasoning: this.reasoning,
|
|
900
|
+
failed: this.failed,
|
|
901
|
+
error_message: this.error_message,
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
toLogBody() {
|
|
905
|
+
return `Model routing decision. Model: ${this.decision_model}, Source: ${this.decision_source}`;
|
|
906
|
+
}
|
|
435
907
|
}
|
|
908
|
+
export const EVENT_EXTENSION_INSTALL = 'gemini_cli.extension_install';
|
|
436
909
|
export class ExtensionInstallEvent {
|
|
437
910
|
'event.name';
|
|
438
911
|
'event.timestamp';
|
|
439
912
|
extension_name;
|
|
913
|
+
extension_id;
|
|
440
914
|
extension_version;
|
|
441
915
|
extension_source;
|
|
442
916
|
status;
|
|
443
|
-
constructor(extension_name, extension_version, extension_source, status) {
|
|
917
|
+
constructor(extension_name, extension_id, extension_version, extension_source, status) {
|
|
444
918
|
this['event.name'] = 'extension_install';
|
|
445
919
|
this['event.timestamp'] = new Date().toISOString();
|
|
446
920
|
this.extension_name = extension_name;
|
|
921
|
+
this.extension_id = extension_id;
|
|
447
922
|
this.extension_version = extension_version;
|
|
448
923
|
this.extension_source = extension_source;
|
|
449
924
|
this.status = status;
|
|
450
925
|
}
|
|
926
|
+
toOpenTelemetryAttributes(config) {
|
|
927
|
+
return {
|
|
928
|
+
...getCommonAttributes(config),
|
|
929
|
+
'event.name': EVENT_EXTENSION_INSTALL,
|
|
930
|
+
'event.timestamp': this['event.timestamp'],
|
|
931
|
+
extension_name: this.extension_name,
|
|
932
|
+
extension_version: this.extension_version,
|
|
933
|
+
extension_source: this.extension_source,
|
|
934
|
+
status: this.status,
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
toLogBody() {
|
|
938
|
+
return `Installed extension ${this.extension_name}`;
|
|
939
|
+
}
|
|
451
940
|
}
|
|
941
|
+
export const EVENT_TOOL_OUTPUT_TRUNCATED = 'gemini_cli.tool_output_truncated';
|
|
452
942
|
export class ToolOutputTruncatedEvent {
|
|
453
943
|
eventName = 'tool_output_truncated';
|
|
454
944
|
'event.timestamp' = new Date().toISOString();
|
|
@@ -468,31 +958,115 @@ export class ToolOutputTruncatedEvent {
|
|
|
468
958
|
this.threshold = details.threshold;
|
|
469
959
|
this.lines = details.lines;
|
|
470
960
|
}
|
|
961
|
+
toOpenTelemetryAttributes(config) {
|
|
962
|
+
return {
|
|
963
|
+
...getCommonAttributes(config),
|
|
964
|
+
'event.name': EVENT_TOOL_OUTPUT_TRUNCATED,
|
|
965
|
+
eventName: this.eventName,
|
|
966
|
+
'event.timestamp': this['event.timestamp'],
|
|
967
|
+
tool_name: this.tool_name,
|
|
968
|
+
original_content_length: this.original_content_length,
|
|
969
|
+
truncated_content_length: this.truncated_content_length,
|
|
970
|
+
threshold: this.threshold,
|
|
971
|
+
lines: this.lines,
|
|
972
|
+
prompt_id: this.prompt_id,
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
toLogBody() {
|
|
976
|
+
return `Tool output truncated for ${this.tool_name}.`;
|
|
977
|
+
}
|
|
471
978
|
}
|
|
979
|
+
export const EVENT_EXTENSION_UNINSTALL = 'gemini_cli.extension_uninstall';
|
|
472
980
|
export class ExtensionUninstallEvent {
|
|
473
981
|
'event.name';
|
|
474
982
|
'event.timestamp';
|
|
475
983
|
extension_name;
|
|
984
|
+
extension_id;
|
|
476
985
|
status;
|
|
477
|
-
constructor(extension_name, status) {
|
|
986
|
+
constructor(extension_name, extension_id, status) {
|
|
478
987
|
this['event.name'] = 'extension_uninstall';
|
|
479
988
|
this['event.timestamp'] = new Date().toISOString();
|
|
480
989
|
this.extension_name = extension_name;
|
|
990
|
+
this.extension_id = extension_id;
|
|
991
|
+
this.status = status;
|
|
992
|
+
}
|
|
993
|
+
toOpenTelemetryAttributes(config) {
|
|
994
|
+
return {
|
|
995
|
+
...getCommonAttributes(config),
|
|
996
|
+
'event.name': EVENT_EXTENSION_UNINSTALL,
|
|
997
|
+
'event.timestamp': this['event.timestamp'],
|
|
998
|
+
extension_name: this.extension_name,
|
|
999
|
+
status: this.status,
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
toLogBody() {
|
|
1003
|
+
return `Uninstalled extension ${this.extension_name}`;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
export const EVENT_EXTENSION_UPDATE = 'gemini_cli.extension_update';
|
|
1007
|
+
export class ExtensionUpdateEvent {
|
|
1008
|
+
'event.name';
|
|
1009
|
+
'event.timestamp';
|
|
1010
|
+
extension_name;
|
|
1011
|
+
extension_id;
|
|
1012
|
+
extension_previous_version;
|
|
1013
|
+
extension_version;
|
|
1014
|
+
extension_source;
|
|
1015
|
+
status;
|
|
1016
|
+
constructor(extension_name, extension_id, extension_version, extension_previous_version, extension_source, status) {
|
|
1017
|
+
this['event.name'] = 'extension_update';
|
|
1018
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1019
|
+
this.extension_name = extension_name;
|
|
1020
|
+
this.extension_id = extension_id;
|
|
1021
|
+
this.extension_version = extension_version;
|
|
1022
|
+
this.extension_previous_version = extension_previous_version;
|
|
1023
|
+
this.extension_source = extension_source;
|
|
481
1024
|
this.status = status;
|
|
482
1025
|
}
|
|
1026
|
+
toOpenTelemetryAttributes(config) {
|
|
1027
|
+
return {
|
|
1028
|
+
...getCommonAttributes(config),
|
|
1029
|
+
'event.name': EVENT_EXTENSION_UPDATE,
|
|
1030
|
+
'event.timestamp': this['event.timestamp'],
|
|
1031
|
+
extension_name: this.extension_name,
|
|
1032
|
+
extension_version: this.extension_version,
|
|
1033
|
+
extension_previous_version: this.extension_previous_version,
|
|
1034
|
+
extension_source: this.extension_source,
|
|
1035
|
+
status: this.status,
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
toLogBody() {
|
|
1039
|
+
return `Updated extension ${this.extension_name}`;
|
|
1040
|
+
}
|
|
483
1041
|
}
|
|
1042
|
+
export const EVENT_EXTENSION_ENABLE = 'gemini_cli.extension_enable';
|
|
484
1043
|
export class ExtensionEnableEvent {
|
|
485
1044
|
'event.name';
|
|
486
1045
|
'event.timestamp';
|
|
487
1046
|
extension_name;
|
|
1047
|
+
extension_id;
|
|
488
1048
|
setting_scope;
|
|
489
|
-
constructor(extension_name, settingScope) {
|
|
1049
|
+
constructor(extension_name, extension_id, settingScope) {
|
|
490
1050
|
this['event.name'] = 'extension_enable';
|
|
491
1051
|
this['event.timestamp'] = new Date().toISOString();
|
|
492
1052
|
this.extension_name = extension_name;
|
|
1053
|
+
this.extension_id = extension_id;
|
|
493
1054
|
this.setting_scope = settingScope;
|
|
494
1055
|
}
|
|
1056
|
+
toOpenTelemetryAttributes(config) {
|
|
1057
|
+
return {
|
|
1058
|
+
...getCommonAttributes(config),
|
|
1059
|
+
'event.name': EVENT_EXTENSION_ENABLE,
|
|
1060
|
+
'event.timestamp': this['event.timestamp'],
|
|
1061
|
+
extension_name: this.extension_name,
|
|
1062
|
+
setting_scope: this.setting_scope,
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
toLogBody() {
|
|
1066
|
+
return `Enabled extension ${this.extension_name}`;
|
|
1067
|
+
}
|
|
495
1068
|
}
|
|
1069
|
+
export const EVENT_MODEL_SLASH_COMMAND = 'gemini_cli.slash_command.model';
|
|
496
1070
|
export class ModelSlashCommandEvent {
|
|
497
1071
|
'event.name';
|
|
498
1072
|
'event.timestamp';
|
|
@@ -502,17 +1076,229 @@ export class ModelSlashCommandEvent {
|
|
|
502
1076
|
this['event.timestamp'] = new Date().toISOString();
|
|
503
1077
|
this.model_name = model_name;
|
|
504
1078
|
}
|
|
1079
|
+
toOpenTelemetryAttributes(config) {
|
|
1080
|
+
return {
|
|
1081
|
+
...getCommonAttributes(config),
|
|
1082
|
+
'event.name': EVENT_MODEL_SLASH_COMMAND,
|
|
1083
|
+
'event.timestamp': this['event.timestamp'],
|
|
1084
|
+
model_name: this.model_name,
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
toLogBody() {
|
|
1088
|
+
return `Model slash command. Model: ${this.model_name}`;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
export const EVENT_LLM_LOOP_CHECK = 'gemini_cli.llm_loop_check';
|
|
1092
|
+
export class LlmLoopCheckEvent {
|
|
1093
|
+
'event.name';
|
|
1094
|
+
'event.timestamp';
|
|
1095
|
+
prompt_id;
|
|
1096
|
+
flash_confidence;
|
|
1097
|
+
main_model;
|
|
1098
|
+
main_model_confidence;
|
|
1099
|
+
constructor(prompt_id, flash_confidence, main_model, main_model_confidence) {
|
|
1100
|
+
this['event.name'] = 'llm_loop_check';
|
|
1101
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1102
|
+
this.prompt_id = prompt_id;
|
|
1103
|
+
this.flash_confidence = flash_confidence;
|
|
1104
|
+
this.main_model = main_model;
|
|
1105
|
+
this.main_model_confidence = main_model_confidence;
|
|
1106
|
+
}
|
|
1107
|
+
toOpenTelemetryAttributes(config) {
|
|
1108
|
+
return {
|
|
1109
|
+
...getCommonAttributes(config),
|
|
1110
|
+
'event.name': EVENT_LLM_LOOP_CHECK,
|
|
1111
|
+
'event.timestamp': this['event.timestamp'],
|
|
1112
|
+
prompt_id: this.prompt_id,
|
|
1113
|
+
flash_confidence: this.flash_confidence,
|
|
1114
|
+
main_model: this.main_model,
|
|
1115
|
+
main_model_confidence: this.main_model_confidence,
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
toLogBody() {
|
|
1119
|
+
return this.main_model_confidence === -1
|
|
1120
|
+
? `LLM loop check. Flash confidence: ${this.flash_confidence.toFixed(2)}. Main model (${this.main_model}) check skipped`
|
|
1121
|
+
: `LLM loop check. Flash confidence: ${this.flash_confidence.toFixed(2)}. Main model (${this.main_model}) confidence: ${this.main_model_confidence.toFixed(2)}`;
|
|
1122
|
+
}
|
|
505
1123
|
}
|
|
1124
|
+
export const EVENT_EXTENSION_DISABLE = 'gemini_cli.extension_disable';
|
|
506
1125
|
export class ExtensionDisableEvent {
|
|
507
1126
|
'event.name';
|
|
508
1127
|
'event.timestamp';
|
|
509
1128
|
extension_name;
|
|
1129
|
+
extension_id;
|
|
510
1130
|
setting_scope;
|
|
511
|
-
constructor(extension_name, settingScope) {
|
|
1131
|
+
constructor(extension_name, extension_id, settingScope) {
|
|
512
1132
|
this['event.name'] = 'extension_disable';
|
|
513
1133
|
this['event.timestamp'] = new Date().toISOString();
|
|
514
1134
|
this.extension_name = extension_name;
|
|
1135
|
+
this.extension_id = extension_id;
|
|
515
1136
|
this.setting_scope = settingScope;
|
|
516
1137
|
}
|
|
1138
|
+
toOpenTelemetryAttributes(config) {
|
|
1139
|
+
return {
|
|
1140
|
+
...getCommonAttributes(config),
|
|
1141
|
+
'event.name': EVENT_EXTENSION_DISABLE,
|
|
1142
|
+
'event.timestamp': this['event.timestamp'],
|
|
1143
|
+
extension_name: this.extension_name,
|
|
1144
|
+
setting_scope: this.setting_scope,
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
toLogBody() {
|
|
1148
|
+
return `Disabled extension ${this.extension_name}`;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
export const EVENT_SMART_EDIT_STRATEGY = 'gemini_cli.smart_edit_strategy';
|
|
1152
|
+
export class SmartEditStrategyEvent {
|
|
1153
|
+
'event.name';
|
|
1154
|
+
'event.timestamp';
|
|
1155
|
+
strategy;
|
|
1156
|
+
constructor(strategy) {
|
|
1157
|
+
this['event.name'] = 'smart_edit_strategy';
|
|
1158
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1159
|
+
this.strategy = strategy;
|
|
1160
|
+
}
|
|
1161
|
+
toOpenTelemetryAttributes(config) {
|
|
1162
|
+
return {
|
|
1163
|
+
...getCommonAttributes(config),
|
|
1164
|
+
'event.name': EVENT_SMART_EDIT_STRATEGY,
|
|
1165
|
+
'event.timestamp': this['event.timestamp'],
|
|
1166
|
+
strategy: this.strategy,
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
toLogBody() {
|
|
1170
|
+
return `Smart Edit Tool Strategy: ${this.strategy}`;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
export const EVENT_SMART_EDIT_CORRECTION = 'gemini_cli.smart_edit_correction';
|
|
1174
|
+
export class SmartEditCorrectionEvent {
|
|
1175
|
+
'event.name';
|
|
1176
|
+
'event.timestamp';
|
|
1177
|
+
correction;
|
|
1178
|
+
constructor(correction) {
|
|
1179
|
+
this['event.name'] = 'smart_edit_correction';
|
|
1180
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1181
|
+
this.correction = correction;
|
|
1182
|
+
}
|
|
1183
|
+
toOpenTelemetryAttributes(config) {
|
|
1184
|
+
return {
|
|
1185
|
+
...getCommonAttributes(config),
|
|
1186
|
+
'event.name': EVENT_SMART_EDIT_CORRECTION,
|
|
1187
|
+
'event.timestamp': this['event.timestamp'],
|
|
1188
|
+
correction: this.correction,
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
toLogBody() {
|
|
1192
|
+
return `Smart Edit Tool Correction: ${this.correction}`;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
class BaseAgentEvent {
|
|
1196
|
+
'event.timestamp';
|
|
1197
|
+
agent_id;
|
|
1198
|
+
agent_name;
|
|
1199
|
+
constructor(agent_id, agent_name) {
|
|
1200
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1201
|
+
this.agent_id = agent_id;
|
|
1202
|
+
this.agent_name = agent_name;
|
|
1203
|
+
}
|
|
1204
|
+
toOpenTelemetryAttributes(config) {
|
|
1205
|
+
return {
|
|
1206
|
+
...getCommonAttributes(config),
|
|
1207
|
+
'event.timestamp': this['event.timestamp'],
|
|
1208
|
+
agent_id: this.agent_id,
|
|
1209
|
+
agent_name: this.agent_name,
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
export const EVENT_AGENT_START = 'gemini_cli.agent.start';
|
|
1214
|
+
export class AgentStartEvent extends BaseAgentEvent {
|
|
1215
|
+
'event.name' = 'agent_start';
|
|
1216
|
+
constructor(agent_id, agent_name) {
|
|
1217
|
+
super(agent_id, agent_name);
|
|
1218
|
+
}
|
|
1219
|
+
toOpenTelemetryAttributes(config) {
|
|
1220
|
+
return {
|
|
1221
|
+
...super.toOpenTelemetryAttributes(config),
|
|
1222
|
+
'event.name': EVENT_AGENT_START,
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
toLogBody() {
|
|
1226
|
+
return `Agent ${this.agent_name} started. ID: ${this.agent_id}`;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
export const EVENT_AGENT_FINISH = 'gemini_cli.agent.finish';
|
|
1230
|
+
export class AgentFinishEvent extends BaseAgentEvent {
|
|
1231
|
+
'event.name' = 'agent_finish';
|
|
1232
|
+
duration_ms;
|
|
1233
|
+
turn_count;
|
|
1234
|
+
terminate_reason;
|
|
1235
|
+
constructor(agent_id, agent_name, duration_ms, turn_count, terminate_reason) {
|
|
1236
|
+
super(agent_id, agent_name);
|
|
1237
|
+
this.duration_ms = duration_ms;
|
|
1238
|
+
this.turn_count = turn_count;
|
|
1239
|
+
this.terminate_reason = terminate_reason;
|
|
1240
|
+
}
|
|
1241
|
+
toOpenTelemetryAttributes(config) {
|
|
1242
|
+
return {
|
|
1243
|
+
...super.toOpenTelemetryAttributes(config),
|
|
1244
|
+
'event.name': EVENT_AGENT_FINISH,
|
|
1245
|
+
duration_ms: this.duration_ms,
|
|
1246
|
+
turn_count: this.turn_count,
|
|
1247
|
+
terminate_reason: this.terminate_reason,
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
toLogBody() {
|
|
1251
|
+
return `Agent ${this.agent_name} finished. Reason: ${this.terminate_reason}. Duration: ${this.duration_ms}ms. Turns: ${this.turn_count}.`;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
export const EVENT_AGENT_RECOVERY_ATTEMPT = 'gemini_cli.agent.recovery_attempt';
|
|
1255
|
+
export class RecoveryAttemptEvent extends BaseAgentEvent {
|
|
1256
|
+
'event.name' = 'agent_recovery_attempt';
|
|
1257
|
+
reason;
|
|
1258
|
+
duration_ms;
|
|
1259
|
+
success;
|
|
1260
|
+
turn_count;
|
|
1261
|
+
constructor(agent_id, agent_name, reason, duration_ms, success, turn_count) {
|
|
1262
|
+
super(agent_id, agent_name);
|
|
1263
|
+
this.reason = reason;
|
|
1264
|
+
this.duration_ms = duration_ms;
|
|
1265
|
+
this.success = success;
|
|
1266
|
+
this.turn_count = turn_count;
|
|
1267
|
+
}
|
|
1268
|
+
toOpenTelemetryAttributes(config) {
|
|
1269
|
+
return {
|
|
1270
|
+
...super.toOpenTelemetryAttributes(config),
|
|
1271
|
+
'event.name': EVENT_AGENT_RECOVERY_ATTEMPT,
|
|
1272
|
+
reason: this.reason,
|
|
1273
|
+
duration_ms: this.duration_ms,
|
|
1274
|
+
success: this.success,
|
|
1275
|
+
turn_count: this.turn_count,
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
toLogBody() {
|
|
1279
|
+
return `Agent ${this.agent_name} recovery attempt. Reason: ${this.reason}. Success: ${this.success}. Duration: ${this.duration_ms}ms.`;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
export const EVENT_WEB_FETCH_FALLBACK_ATTEMPT = 'gemini_cli.web_fetch_fallback_attempt';
|
|
1283
|
+
export class WebFetchFallbackAttemptEvent {
|
|
1284
|
+
'event.name';
|
|
1285
|
+
'event.timestamp';
|
|
1286
|
+
reason;
|
|
1287
|
+
constructor(reason) {
|
|
1288
|
+
this['event.name'] = 'web_fetch_fallback_attempt';
|
|
1289
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1290
|
+
this.reason = reason;
|
|
1291
|
+
}
|
|
1292
|
+
toOpenTelemetryAttributes(config) {
|
|
1293
|
+
return {
|
|
1294
|
+
...getCommonAttributes(config),
|
|
1295
|
+
'event.name': EVENT_WEB_FETCH_FALLBACK_ATTEMPT,
|
|
1296
|
+
'event.timestamp': this['event.timestamp'],
|
|
1297
|
+
reason: this.reason,
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
toLogBody() {
|
|
1301
|
+
return `Web fetch fallback attempt. Reason: ${this.reason}`;
|
|
1302
|
+
}
|
|
517
1303
|
}
|
|
518
1304
|
//# sourceMappingURL=types.js.map
|