@machina.ai/cell-cli-core 1.6.1-rc2 → 1.10.0-rc1
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 +4 -3
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/agents/codebase-investigator.d.ts +46 -0
- package/dist/src/agents/codebase-investigator.js +135 -0
- package/dist/src/agents/codebase-investigator.js.map +1 -0
- package/dist/src/agents/executor.d.ts +92 -0
- package/dist/src/agents/executor.js +579 -0
- package/dist/src/agents/executor.js.map +1 -0
- package/dist/src/agents/executor.test.d.ts +6 -0
- package/dist/src/agents/executor.test.js +680 -0
- package/dist/src/agents/executor.test.js.map +1 -0
- package/dist/src/agents/invocation.d.ts +46 -0
- package/dist/src/agents/invocation.js +102 -0
- package/dist/src/agents/invocation.js.map +1 -0
- package/dist/src/agents/invocation.test.d.ts +6 -0
- package/dist/src/agents/invocation.test.js +215 -0
- package/dist/src/agents/invocation.test.js.map +1 -0
- package/dist/src/agents/registry.d.ts +36 -0
- package/dist/src/agents/registry.js +81 -0
- package/dist/src/agents/registry.js.map +1 -0
- package/dist/src/agents/registry.test.d.ts +6 -0
- package/dist/src/agents/registry.test.js +146 -0
- package/dist/src/agents/registry.test.js.map +1 -0
- package/dist/src/agents/schema-utils.d.ts +39 -0
- package/dist/src/agents/schema-utils.js +57 -0
- package/dist/src/agents/schema-utils.js.map +1 -0
- package/dist/src/agents/schema-utils.test.d.ts +6 -0
- package/dist/src/agents/schema-utils.test.js +144 -0
- package/dist/src/agents/schema-utils.test.js.map +1 -0
- package/dist/src/agents/subagent-tool-wrapper.d.ts +38 -0
- package/dist/src/agents/subagent-tool-wrapper.js +48 -0
- package/dist/src/agents/subagent-tool-wrapper.js.map +1 -0
- package/dist/src/agents/subagent-tool-wrapper.test.d.ts +6 -0
- package/dist/src/agents/subagent-tool-wrapper.test.js +112 -0
- package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -0
- package/dist/src/agents/types.d.ts +145 -0
- package/dist/src/agents/types.js +18 -0
- package/dist/src/agents/types.js.map +1 -0
- package/dist/src/agents/utils.d.ts +15 -0
- package/dist/src/agents/utils.js +29 -0
- package/dist/src/agents/utils.js.map +1 -0
- package/dist/src/agents/utils.test.d.ts +6 -0
- package/dist/src/agents/utils.test.js +87 -0
- package/dist/src/agents/utils.test.js.map +1 -0
- package/dist/src/code_assist/oauth-credential-storage.js +1 -1
- package/dist/src/code_assist/oauth-credential-storage.js.map +1 -1
- package/dist/src/code_assist/oauth-credential-storage.test.js +1 -1
- package/dist/src/code_assist/oauth-credential-storage.test.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +14 -13
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/setup.js +4 -2
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/config/config.d.ts +61 -15
- package/dist/src/config/config.js +132 -28
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +67 -3
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/constants.d.ts +11 -0
- package/dist/src/config/constants.js +16 -0
- package/dist/src/config/constants.js.map +1 -0
- package/dist/src/config/storage.d.ts +0 -1
- package/dist/src/config/storage.js +2 -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/core/baseLlmClient.d.ts +4 -0
- package/dist/src/core/baseLlmClient.js +24 -23
- package/dist/src/core/baseLlmClient.js.map +1 -1
- package/dist/src/core/baseLlmClient.test.js +76 -13
- package/dist/src/core/baseLlmClient.test.js.map +1 -1
- package/dist/src/core/client.d.ts +6 -3
- package/dist/src/core/client.js +103 -64
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +470 -118
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/contentGenerator.js +3 -1
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/coreToolScheduler.js +12 -12
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +260 -23
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/geminiChat.d.ts +11 -14
- package/dist/src/core/geminiChat.js +80 -124
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +316 -239
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/logger.test.js +16 -16
- package/dist/src/core/logger.test.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.d.ts +3 -2
- package/dist/src/core/nonInteractiveToolExecutor.js +2 -2
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +19 -19
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/prompts.d.ts +2 -1
- package/dist/src/core/prompts.js +53 -111
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/prompts.test.js +83 -29
- package/dist/src/core/prompts.test.js.map +1 -1
- package/dist/src/core/subagent.js +1 -1
- package/dist/src/core/subagent.js.map +1 -1
- package/dist/src/core/subagent.test.js +38 -12
- package/dist/src/core/subagent.test.js.map +1 -1
- package/dist/src/core/turn.d.ts +15 -6
- package/dist/src/core/turn.js +14 -13
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +14 -2
- package/dist/src/core/turn.test.js.map +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/ide/detect-ide.d.ts +45 -14
- package/dist/src/ide/detect-ide.js +32 -69
- package/dist/src/ide/detect-ide.js.map +1 -1
- package/dist/src/ide/detect-ide.test.js +40 -46
- package/dist/src/ide/detect-ide.test.js.map +1 -1
- package/dist/src/ide/ide-client.d.ts +4 -4
- package/dist/src/ide/ide-client.js +33 -32
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-client.test.js +12 -25
- package/dist/src/ide/ide-client.test.js.map +1 -1
- package/dist/src/ide/ide-installer.d.ts +2 -2
- package/dist/src/ide/ide-installer.js +8 -10
- package/dist/src/ide/ide-installer.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +33 -14
- 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/index.d.ts +7 -2
- package/dist/src/index.js +7 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/oauth-provider.d.ts +4 -1
- package/dist/src/mcp/oauth-provider.js +31 -25
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/sa-impersonation-provider.d.ts +33 -0
- package/dist/src/mcp/sa-impersonation-provider.js +130 -0
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -0
- package/dist/src/mcp/sa-impersonation-provider.test.d.ts +6 -0
- package/dist/src/mcp/sa-impersonation-provider.test.js +117 -0
- package/dist/src/mcp/sa-impersonation-provider.test.js.map +1 -0
- package/dist/src/mcp/token-storage/file-token-storage.js +2 -1
- package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -1
- package/dist/src/mcp/token-storage/file-token-storage.test.js +4 -3
- package/dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -1
- package/dist/src/policy/policy-engine.js +11 -2
- package/dist/src/policy/policy-engine.js.map +1 -1
- package/dist/src/policy/policy-engine.test.js +45 -0
- package/dist/src/policy/policy-engine.test.js.map +1 -1
- package/dist/src/routing/strategies/compositeStrategy.js +4 -3
- package/dist/src/routing/strategies/compositeStrategy.js.map +1 -1
- package/dist/src/services/chatRecordingService.d.ts +3 -2
- package/dist/src/services/chatRecordingService.js +3 -2
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/fileSystemService.d.ts +9 -0
- package/dist/src/services/fileSystemService.js +11 -0
- package/dist/src/services/fileSystemService.js.map +1 -1
- package/dist/src/services/shellExecutionService.d.ts +3 -0
- package/dist/src/services/shellExecutionService.js +165 -49
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +74 -5
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/telemetry/activity-detector.d.ts +41 -0
- package/dist/src/telemetry/activity-detector.js +61 -0
- package/dist/src/telemetry/activity-detector.js.map +1 -0
- package/dist/src/telemetry/activity-detector.test.d.ts +6 -0
- package/dist/src/telemetry/activity-detector.test.js +136 -0
- package/dist/src/telemetry/activity-detector.test.js.map +1 -0
- package/dist/src/telemetry/activity-types.d.ts +19 -0
- package/dist/src/telemetry/activity-types.js +21 -0
- package/dist/src/telemetry/activity-types.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +18 -2
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +257 -108
- 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 +258 -33
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +118 -100
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +146 -103
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/config.d.ts +31 -0
- package/dist/src/telemetry/config.js +74 -0
- package/dist/src/telemetry/config.js.map +1 -0
- package/dist/src/telemetry/config.test.d.ts +6 -0
- package/dist/src/telemetry/config.test.js +124 -0
- package/dist/src/telemetry/config.test.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +0 -34
- package/dist/src/telemetry/constants.js +0 -34
- package/dist/src/telemetry/constants.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +9 -3
- package/dist/src/telemetry/index.js +19 -2
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +10 -2
- package/dist/src/telemetry/loggers.js +206 -273
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +3 -3
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +316 -13
- 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 +436 -11
- package/dist/src/telemetry/metrics.js +600 -110
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +898 -16
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/sdk.js +1 -1
- package/dist/src/telemetry/sdk.js.map +1 -1
- package/dist/src/telemetry/sdk.test.js +13 -0
- package/dist/src/telemetry/sdk.test.js.map +1 -1
- package/dist/src/telemetry/telemetryAttributes.d.ts +8 -0
- package/dist/src/telemetry/telemetryAttributes.js +18 -0
- package/dist/src/telemetry/telemetryAttributes.js.map +1 -0
- package/dist/src/telemetry/types.d.ts +168 -5
- package/dist/src/telemetry/types.js +696 -34
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +2 -2
- package/dist/src/telemetry/uiTelemetry.js +3 -4
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +14 -14
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/mock-tool.d.ts +28 -3
- package/dist/src/test-utils/mock-tool.js +71 -1
- package/dist/src/test-utils/mock-tool.js.map +1 -1
- package/dist/src/tools/glob.js +4 -2
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/ls.js +1 -1
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +5 -14
- package/dist/src/tools/mcp-client.js +51 -98
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +175 -157
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +1 -1
- package/dist/src/tools/memoryTool.js +1 -2
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +9 -8
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/message-bus-integration.test.d.ts +6 -0
- package/dist/src/tools/message-bus-integration.test.js +183 -0
- package/dist/src/tools/message-bus-integration.test.js.map +1 -0
- package/dist/src/tools/shell.js +60 -4
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +2 -1
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/smart-edit.d.ts +1 -1
- package/dist/src/tools/smart-edit.js +116 -12
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/smart-edit.test.js +91 -29
- package/dist/src/tools/smart-edit.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +22 -0
- package/dist/src/tools/tool-error.js +28 -0
- package/dist/src/tools/tool-error.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +9 -0
- package/dist/src/tools/tool-names.js +18 -0
- package/dist/src/tools/tool-names.js.map +1 -0
- package/dist/src/tools/tool-registry.test.js +10 -10
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +11 -3
- package/dist/src/tools/tools.js +94 -3
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/web-fetch.d.ts +7 -0
- package/dist/src/tools/web-fetch.js +42 -10
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +127 -8
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/web-search.js +2 -1
- package/dist/src/tools/web-search.js.map +1 -1
- package/dist/src/tools/write-file.js +2 -1
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-todos.d.ts +25 -0
- package/dist/src/tools/write-todos.js +151 -0
- package/dist/src/tools/write-todos.js.map +1 -0
- package/dist/src/tools/write-todos.test.d.ts +6 -0
- package/dist/src/tools/write-todos.test.js +89 -0
- package/dist/src/tools/write-todos.test.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.d.ts +1 -1
- package/dist/src/utils/editCorrector.js +2 -2
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editor.js +1 -0
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/editor.test.js +1 -0
- package/dist/src/utils/editor.test.js.map +1 -1
- package/dist/src/utils/flashFallback.test.js +2 -2
- 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.d.ts +1 -1
- package/dist/src/utils/getFolderStructure.js +1 -1
- 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/installationManager.test.js +2 -1
- package/dist/src/utils/installationManager.test.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.js +14 -4
- package/dist/src/utils/llm-edit-fixer.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.test.js +81 -0
- package/dist/src/utils/llm-edit-fixer.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +2 -1
- package/dist/src/utils/memoryDiscovery.js +3 -2
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +99 -21
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.js +13 -20
- package/dist/src/utils/memoryImportProcessor.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.test.js +14 -0
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
- 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/retry.d.ts +4 -1
- package/dist/src/utils/retry.js +40 -17
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +104 -31
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/schemaValidator.js +11 -1
- package/dist/src/utils/schemaValidator.js.map +1 -1
- package/dist/src/utils/schemaValidator.test.d.ts +6 -0
- package/dist/src/utils/schemaValidator.test.js +113 -0
- package/dist/src/utils/schemaValidator.test.js.map +1 -0
- package/dist/src/utils/shell-utils.d.ts +1 -0
- package/dist/src/utils/shell-utils.js +6 -2
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +5 -0
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/src/utils/terminalSerializer.d.ts +1 -4
- package/dist/src/utils/terminalSerializer.js +3 -3
- package/dist/src/utils/terminalSerializer.js.map +1 -1
- package/dist/src/utils/thoughtUtils.d.ts +21 -0
- package/dist/src/utils/thoughtUtils.js +39 -0
- package/dist/src/utils/thoughtUtils.js.map +1 -0
- package/dist/src/utils/thoughtUtils.test.d.ts +6 -0
- package/dist/src/utils/thoughtUtils.test.js +78 -0
- package/dist/src/utils/thoughtUtils.test.js.map +1 -0
- package/dist/src/utils/tool-utils.js +2 -2
- 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.test.js +2 -1
- package/dist/src/utils/userAccountManager.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/src/test-utils/tools.d.ts +0 -45
- package/dist/src/test-utils/tools.js +0 -105
- package/dist/src/test-utils/tools.js.map +0 -1
|
@@ -7,6 +7,10 @@ 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
9
|
export { ToolCallDecision };
|
|
10
|
+
import { getCommonAttributes } from './telemetryAttributes.js';
|
|
11
|
+
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
|
|
12
|
+
import { safeJsonStringify } from '../utils/safeJsonStringify.js';
|
|
13
|
+
export const EVENT_CLI_CONFIG = 'gemini_cli.config';
|
|
10
14
|
export class StartSessionEvent {
|
|
11
15
|
'event.name';
|
|
12
16
|
'event.timestamp';
|
|
@@ -36,6 +40,7 @@ export class StartSessionEvent {
|
|
|
36
40
|
useVertex = generatorConfig.authType === AuthType.USE_VERTEX_AI;
|
|
37
41
|
}
|
|
38
42
|
this['event.name'] = 'cli_config';
|
|
43
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
39
44
|
this.model = config.getModel();
|
|
40
45
|
this.embedding_model = config.getEmbeddingModel();
|
|
41
46
|
this.sandbox_enabled =
|
|
@@ -63,6 +68,31 @@ export class StartSessionEvent {
|
|
|
63
68
|
.join(',');
|
|
64
69
|
}
|
|
65
70
|
}
|
|
71
|
+
toOpenTelemetryAttributes(config) {
|
|
72
|
+
return {
|
|
73
|
+
...getCommonAttributes(config),
|
|
74
|
+
'event.name': EVENT_CLI_CONFIG,
|
|
75
|
+
'event.timestamp': this['event.timestamp'],
|
|
76
|
+
model: this.model,
|
|
77
|
+
embedding_model: this.embedding_model,
|
|
78
|
+
sandbox_enabled: this.sandbox_enabled,
|
|
79
|
+
core_tools_enabled: this.core_tools_enabled,
|
|
80
|
+
approval_mode: this.approval_mode,
|
|
81
|
+
api_key_enabled: this.api_key_enabled,
|
|
82
|
+
vertex_ai_enabled: this.vertex_ai_enabled,
|
|
83
|
+
log_user_prompts_enabled: this.telemetry_log_user_prompts_enabled,
|
|
84
|
+
file_filtering_respect_git_ignore: this.file_filtering_respect_git_ignore,
|
|
85
|
+
debug_mode: this.debug_enabled,
|
|
86
|
+
mcp_servers: this.mcp_servers,
|
|
87
|
+
mcp_servers_count: this.mcp_servers_count,
|
|
88
|
+
mcp_tools: this.mcp_tools,
|
|
89
|
+
mcp_tools_count: this.mcp_tools_count,
|
|
90
|
+
output_format: this.output_format,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
toLogBody() {
|
|
94
|
+
return 'CLI configuration loaded.';
|
|
95
|
+
}
|
|
66
96
|
}
|
|
67
97
|
export class EndSessionEvent {
|
|
68
98
|
'event.name';
|
|
@@ -74,6 +104,7 @@ export class EndSessionEvent {
|
|
|
74
104
|
this.session_id = config?.getSessionId();
|
|
75
105
|
}
|
|
76
106
|
}
|
|
107
|
+
export const EVENT_USER_PROMPT = 'gemini_cli.user_prompt';
|
|
77
108
|
export class UserPromptEvent {
|
|
78
109
|
'event.name';
|
|
79
110
|
'event.timestamp';
|
|
@@ -89,7 +120,27 @@ export class UserPromptEvent {
|
|
|
89
120
|
this.auth_type = auth_type;
|
|
90
121
|
this.prompt = prompt;
|
|
91
122
|
}
|
|
123
|
+
toOpenTelemetryAttributes(config) {
|
|
124
|
+
const attributes = {
|
|
125
|
+
...getCommonAttributes(config),
|
|
126
|
+
'event.name': EVENT_USER_PROMPT,
|
|
127
|
+
'event.timestamp': this['event.timestamp'],
|
|
128
|
+
prompt_length: this.prompt_length,
|
|
129
|
+
prompt_id: this.prompt_id,
|
|
130
|
+
};
|
|
131
|
+
if (this.auth_type) {
|
|
132
|
+
attributes['auth_type'] = this.auth_type;
|
|
133
|
+
}
|
|
134
|
+
if (config.getTelemetryLogPromptsEnabled()) {
|
|
135
|
+
attributes['prompt'] = this.prompt;
|
|
136
|
+
}
|
|
137
|
+
return attributes;
|
|
138
|
+
}
|
|
139
|
+
toLogBody() {
|
|
140
|
+
return `User prompt. Length: ${this.prompt_length}.`;
|
|
141
|
+
}
|
|
92
142
|
}
|
|
143
|
+
export const EVENT_TOOL_CALL = 'gemini_cli.tool_call';
|
|
93
144
|
export class ToolCallEvent {
|
|
94
145
|
'event.name';
|
|
95
146
|
'event.timestamp';
|
|
@@ -103,46 +154,92 @@ export class ToolCallEvent {
|
|
|
103
154
|
prompt_id;
|
|
104
155
|
tool_type;
|
|
105
156
|
content_length;
|
|
157
|
+
mcp_server_name;
|
|
106
158
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
159
|
metadata;
|
|
108
|
-
constructor(call) {
|
|
160
|
+
constructor(call, function_name, function_args, duration_ms, success, prompt_id, tool_type, error) {
|
|
109
161
|
this['event.name'] = 'tool_call';
|
|
110
162
|
this['event.timestamp'] = new Date().toISOString();
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
163
|
+
if (call) {
|
|
164
|
+
this.function_name = call.request.name;
|
|
165
|
+
this.function_args = call.request.args;
|
|
166
|
+
this.duration_ms = call.durationMs ?? 0;
|
|
167
|
+
this.success = call.status === 'success';
|
|
168
|
+
this.decision = call.outcome
|
|
169
|
+
? getDecisionFromOutcome(call.outcome)
|
|
170
|
+
: undefined;
|
|
171
|
+
this.error = call.response.error?.message;
|
|
172
|
+
this.error_type = call.response.errorType;
|
|
173
|
+
this.prompt_id = call.request.prompt_id;
|
|
174
|
+
this.content_length = call.response.contentLength;
|
|
175
|
+
if (typeof call.tool !== 'undefined' &&
|
|
176
|
+
call.tool instanceof DiscoveredMCPTool) {
|
|
177
|
+
this.tool_type = 'mcp';
|
|
178
|
+
this.mcp_server_name = call.tool.serverName;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
this.tool_type = 'native';
|
|
182
|
+
}
|
|
183
|
+
if (call.status === 'success' &&
|
|
184
|
+
typeof call.response.resultDisplay === 'object' &&
|
|
185
|
+
call.response.resultDisplay !== null &&
|
|
186
|
+
'diffStat' in call.response.resultDisplay) {
|
|
187
|
+
const diffStat = call.response.resultDisplay.diffStat;
|
|
188
|
+
if (diffStat) {
|
|
189
|
+
this.metadata = {
|
|
190
|
+
model_added_lines: diffStat.model_added_lines,
|
|
191
|
+
model_removed_lines: diffStat.model_removed_lines,
|
|
192
|
+
model_added_chars: diffStat.model_added_chars,
|
|
193
|
+
model_removed_chars: diffStat.model_removed_chars,
|
|
194
|
+
user_added_lines: diffStat.user_added_lines,
|
|
195
|
+
user_removed_lines: diffStat.user_removed_lines,
|
|
196
|
+
user_added_chars: diffStat.user_added_chars,
|
|
197
|
+
user_removed_chars: diffStat.user_removed_chars,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
142
200
|
}
|
|
143
201
|
}
|
|
202
|
+
else {
|
|
203
|
+
this.function_name = function_name;
|
|
204
|
+
this.function_args = function_args;
|
|
205
|
+
this.duration_ms = duration_ms;
|
|
206
|
+
this.success = success;
|
|
207
|
+
this.prompt_id = prompt_id;
|
|
208
|
+
this.tool_type = tool_type;
|
|
209
|
+
this.error = error;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
toOpenTelemetryAttributes(config) {
|
|
213
|
+
const attributes = {
|
|
214
|
+
...getCommonAttributes(config),
|
|
215
|
+
'event.name': EVENT_TOOL_CALL,
|
|
216
|
+
'event.timestamp': this['event.timestamp'],
|
|
217
|
+
function_name: this.function_name,
|
|
218
|
+
function_args: safeJsonStringify(this.function_args, 2),
|
|
219
|
+
duration_ms: this.duration_ms,
|
|
220
|
+
success: this.success,
|
|
221
|
+
decision: this.decision,
|
|
222
|
+
prompt_id: this.prompt_id,
|
|
223
|
+
tool_type: this.tool_type,
|
|
224
|
+
content_length: this.content_length,
|
|
225
|
+
mcp_server_name: this.mcp_server_name,
|
|
226
|
+
metadata: this.metadata,
|
|
227
|
+
};
|
|
228
|
+
if (this.error) {
|
|
229
|
+
attributes['error'] = this.error;
|
|
230
|
+
attributes['error.message'] = this.error;
|
|
231
|
+
if (this.error_type) {
|
|
232
|
+
attributes['error_type'] = this.error_type;
|
|
233
|
+
attributes['error.type'] = this.error_type;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return attributes;
|
|
237
|
+
}
|
|
238
|
+
toLogBody() {
|
|
239
|
+
return `Tool call: ${this.function_name}${this.decision ? `. Decision: ${this.decision}` : ''}. Success: ${this.success}. Duration: ${this.duration_ms}ms.`;
|
|
144
240
|
}
|
|
145
241
|
}
|
|
242
|
+
export const EVENT_API_REQUEST = 'gemini_cli.api_request';
|
|
146
243
|
export class ApiRequestEvent {
|
|
147
244
|
'event.name';
|
|
148
245
|
'event.timestamp';
|
|
@@ -156,7 +253,21 @@ export class ApiRequestEvent {
|
|
|
156
253
|
this.prompt_id = prompt_id;
|
|
157
254
|
this.request_text = request_text;
|
|
158
255
|
}
|
|
256
|
+
toOpenTelemetryAttributes(config) {
|
|
257
|
+
return {
|
|
258
|
+
...getCommonAttributes(config),
|
|
259
|
+
'event.name': EVENT_API_REQUEST,
|
|
260
|
+
'event.timestamp': this['event.timestamp'],
|
|
261
|
+
model: this.model,
|
|
262
|
+
prompt_id: this.prompt_id,
|
|
263
|
+
request_text: this.request_text,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
toLogBody() {
|
|
267
|
+
return `API request to ${this.model}.`;
|
|
268
|
+
}
|
|
159
269
|
}
|
|
270
|
+
export const EVENT_API_ERROR = 'gemini_cli.api_error';
|
|
160
271
|
export class ApiErrorEvent {
|
|
161
272
|
'event.name';
|
|
162
273
|
'event.timestamp';
|
|
@@ -178,7 +289,34 @@ export class ApiErrorEvent {
|
|
|
178
289
|
this.prompt_id = prompt_id;
|
|
179
290
|
this.auth_type = auth_type;
|
|
180
291
|
}
|
|
292
|
+
toOpenTelemetryAttributes(config) {
|
|
293
|
+
const attributes = {
|
|
294
|
+
...getCommonAttributes(config),
|
|
295
|
+
'event.name': EVENT_API_ERROR,
|
|
296
|
+
'event.timestamp': this['event.timestamp'],
|
|
297
|
+
['error.message']: this.error,
|
|
298
|
+
model_name: this.model,
|
|
299
|
+
duration: this.duration_ms,
|
|
300
|
+
model: this.model,
|
|
301
|
+
error: this.error,
|
|
302
|
+
status_code: this.status_code,
|
|
303
|
+
duration_ms: this.duration_ms,
|
|
304
|
+
prompt_id: this.prompt_id,
|
|
305
|
+
auth_type: this.auth_type,
|
|
306
|
+
};
|
|
307
|
+
if (this.error_type) {
|
|
308
|
+
attributes['error.type'] = this.error_type;
|
|
309
|
+
}
|
|
310
|
+
if (typeof this.status_code === 'number') {
|
|
311
|
+
attributes[SemanticAttributes.HTTP_STATUS_CODE] = this.status_code;
|
|
312
|
+
}
|
|
313
|
+
return attributes;
|
|
314
|
+
}
|
|
315
|
+
toLogBody() {
|
|
316
|
+
return `API error for ${this.model}. Error: ${this.error}. Duration: ${this.duration_ms}ms.`;
|
|
317
|
+
}
|
|
181
318
|
}
|
|
319
|
+
export const EVENT_API_RESPONSE = 'gemini_cli.api_response';
|
|
182
320
|
export class ApiResponseEvent {
|
|
183
321
|
'event.name';
|
|
184
322
|
'event.timestamp';
|
|
@@ -210,7 +348,38 @@ export class ApiResponseEvent {
|
|
|
210
348
|
this.prompt_id = prompt_id;
|
|
211
349
|
this.auth_type = auth_type;
|
|
212
350
|
}
|
|
351
|
+
toOpenTelemetryAttributes(config) {
|
|
352
|
+
const attributes = {
|
|
353
|
+
...getCommonAttributes(config),
|
|
354
|
+
'event.name': EVENT_API_RESPONSE,
|
|
355
|
+
'event.timestamp': this['event.timestamp'],
|
|
356
|
+
model: this.model,
|
|
357
|
+
duration_ms: this.duration_ms,
|
|
358
|
+
input_token_count: this.input_token_count,
|
|
359
|
+
output_token_count: this.output_token_count,
|
|
360
|
+
cached_content_token_count: this.cached_content_token_count,
|
|
361
|
+
thoughts_token_count: this.thoughts_token_count,
|
|
362
|
+
tool_token_count: this.tool_token_count,
|
|
363
|
+
total_token_count: this.total_token_count,
|
|
364
|
+
prompt_id: this.prompt_id,
|
|
365
|
+
auth_type: this.auth_type,
|
|
366
|
+
status_code: this.status_code,
|
|
367
|
+
};
|
|
368
|
+
if (this.response_text) {
|
|
369
|
+
attributes['response_text'] = this.response_text;
|
|
370
|
+
}
|
|
371
|
+
if (this.status_code) {
|
|
372
|
+
if (typeof this.status_code === 'number') {
|
|
373
|
+
attributes[SemanticAttributes.HTTP_STATUS_CODE] = this.status_code;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return attributes;
|
|
377
|
+
}
|
|
378
|
+
toLogBody() {
|
|
379
|
+
return `API response from ${this.model}. Status: ${this.status_code || 'N/A'}. Duration: ${this.duration_ms}ms.`;
|
|
380
|
+
}
|
|
213
381
|
}
|
|
382
|
+
export const EVENT_FLASH_FALLBACK = 'gemini_cli.flash_fallback';
|
|
214
383
|
export class FlashFallbackEvent {
|
|
215
384
|
'event.name';
|
|
216
385
|
'event.timestamp';
|
|
@@ -220,7 +389,19 @@ export class FlashFallbackEvent {
|
|
|
220
389
|
this['event.timestamp'] = new Date().toISOString();
|
|
221
390
|
this.auth_type = auth_type;
|
|
222
391
|
}
|
|
392
|
+
toOpenTelemetryAttributes(config) {
|
|
393
|
+
return {
|
|
394
|
+
...getCommonAttributes(config),
|
|
395
|
+
'event.name': EVENT_FLASH_FALLBACK,
|
|
396
|
+
'event.timestamp': this['event.timestamp'],
|
|
397
|
+
auth_type: this.auth_type,
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
toLogBody() {
|
|
401
|
+
return `Switching to flash as Fallback.`;
|
|
402
|
+
}
|
|
223
403
|
}
|
|
404
|
+
export const EVENT_RIPGREP_FALLBACK = 'gemini_cli.ripgrep_fallback';
|
|
224
405
|
export class RipgrepFallbackEvent {
|
|
225
406
|
error;
|
|
226
407
|
'event.name';
|
|
@@ -230,6 +411,17 @@ export class RipgrepFallbackEvent {
|
|
|
230
411
|
this['event.name'] = 'ripgrep_fallback';
|
|
231
412
|
this['event.timestamp'] = new Date().toISOString();
|
|
232
413
|
}
|
|
414
|
+
toOpenTelemetryAttributes(config) {
|
|
415
|
+
return {
|
|
416
|
+
...getCommonAttributes(config),
|
|
417
|
+
'event.name': EVENT_RIPGREP_FALLBACK,
|
|
418
|
+
'event.timestamp': this['event.timestamp'],
|
|
419
|
+
error: this.error,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
toLogBody() {
|
|
423
|
+
return `Switching to grep as fallback.`;
|
|
424
|
+
}
|
|
233
425
|
}
|
|
234
426
|
export var LoopType;
|
|
235
427
|
(function (LoopType) {
|
|
@@ -248,6 +440,18 @@ export class LoopDetectedEvent {
|
|
|
248
440
|
this.loop_type = loop_type;
|
|
249
441
|
this.prompt_id = prompt_id;
|
|
250
442
|
}
|
|
443
|
+
toOpenTelemetryAttributes(config) {
|
|
444
|
+
return {
|
|
445
|
+
...getCommonAttributes(config),
|
|
446
|
+
'event.name': this['event.name'],
|
|
447
|
+
'event.timestamp': this['event.timestamp'],
|
|
448
|
+
loop_type: this.loop_type,
|
|
449
|
+
prompt_id: this.prompt_id,
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
toLogBody() {
|
|
453
|
+
return `Loop detected. Type: ${this.loop_type}.`;
|
|
454
|
+
}
|
|
251
455
|
}
|
|
252
456
|
export class LoopDetectionDisabledEvent {
|
|
253
457
|
'event.name';
|
|
@@ -258,7 +462,19 @@ export class LoopDetectionDisabledEvent {
|
|
|
258
462
|
this['event.timestamp'] = new Date().toISOString();
|
|
259
463
|
this.prompt_id = prompt_id;
|
|
260
464
|
}
|
|
465
|
+
toOpenTelemetryAttributes(config) {
|
|
466
|
+
return {
|
|
467
|
+
...getCommonAttributes(config),
|
|
468
|
+
'event.name': this['event.name'],
|
|
469
|
+
'event.timestamp': this['event.timestamp'],
|
|
470
|
+
prompt_id: this.prompt_id,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
toLogBody() {
|
|
474
|
+
return `Loop detection disabled.`;
|
|
475
|
+
}
|
|
261
476
|
}
|
|
477
|
+
export const EVENT_NEXT_SPEAKER_CHECK = 'gemini_cli.next_speaker_check';
|
|
262
478
|
export class NextSpeakerCheckEvent {
|
|
263
479
|
'event.name';
|
|
264
480
|
'event.timestamp';
|
|
@@ -272,7 +488,21 @@ export class NextSpeakerCheckEvent {
|
|
|
272
488
|
this.finish_reason = finish_reason;
|
|
273
489
|
this.result = result;
|
|
274
490
|
}
|
|
491
|
+
toOpenTelemetryAttributes(config) {
|
|
492
|
+
return {
|
|
493
|
+
...getCommonAttributes(config),
|
|
494
|
+
'event.name': EVENT_NEXT_SPEAKER_CHECK,
|
|
495
|
+
'event.timestamp': this['event.timestamp'],
|
|
496
|
+
prompt_id: this.prompt_id,
|
|
497
|
+
finish_reason: this.finish_reason,
|
|
498
|
+
result: this.result,
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
toLogBody() {
|
|
502
|
+
return `Next speaker check.`;
|
|
503
|
+
}
|
|
275
504
|
}
|
|
505
|
+
export const EVENT_SLASH_COMMAND = 'gemini_cli.slash_command';
|
|
276
506
|
export function makeSlashCommandEvent({ command, subcommand, status, }) {
|
|
277
507
|
return {
|
|
278
508
|
'event.name': 'slash_command',
|
|
@@ -280,6 +510,19 @@ export function makeSlashCommandEvent({ command, subcommand, status, }) {
|
|
|
280
510
|
command,
|
|
281
511
|
subcommand,
|
|
282
512
|
status,
|
|
513
|
+
toOpenTelemetryAttributes(config) {
|
|
514
|
+
return {
|
|
515
|
+
...getCommonAttributes(config),
|
|
516
|
+
'event.name': EVENT_SLASH_COMMAND,
|
|
517
|
+
'event.timestamp': this['event.timestamp'],
|
|
518
|
+
command: this.command,
|
|
519
|
+
subcommand: this.subcommand,
|
|
520
|
+
status: this.status,
|
|
521
|
+
};
|
|
522
|
+
},
|
|
523
|
+
toLogBody() {
|
|
524
|
+
return `Slash command: ${this.command}.`;
|
|
525
|
+
},
|
|
283
526
|
};
|
|
284
527
|
}
|
|
285
528
|
export var SlashCommandStatus;
|
|
@@ -287,14 +530,28 @@ export var SlashCommandStatus;
|
|
|
287
530
|
SlashCommandStatus["SUCCESS"] = "success";
|
|
288
531
|
SlashCommandStatus["ERROR"] = "error";
|
|
289
532
|
})(SlashCommandStatus || (SlashCommandStatus = {}));
|
|
533
|
+
export const EVENT_CHAT_COMPRESSION = 'gemini_cli.chat_compression';
|
|
290
534
|
export function makeChatCompressionEvent({ tokens_before, tokens_after, }) {
|
|
291
535
|
return {
|
|
292
536
|
'event.name': 'chat_compression',
|
|
293
537
|
'event.timestamp': new Date().toISOString(),
|
|
294
538
|
tokens_before,
|
|
295
539
|
tokens_after,
|
|
540
|
+
toOpenTelemetryAttributes(config) {
|
|
541
|
+
return {
|
|
542
|
+
...getCommonAttributes(config),
|
|
543
|
+
'event.name': EVENT_CHAT_COMPRESSION,
|
|
544
|
+
'event.timestamp': this['event.timestamp'],
|
|
545
|
+
tokens_before: this.tokens_before,
|
|
546
|
+
tokens_after: this.tokens_after,
|
|
547
|
+
};
|
|
548
|
+
},
|
|
549
|
+
toLogBody() {
|
|
550
|
+
return `Chat compression (Saved ${this.tokens_before - this.tokens_after} tokens)`;
|
|
551
|
+
},
|
|
296
552
|
};
|
|
297
553
|
}
|
|
554
|
+
export const EVENT_MALFORMED_JSON_RESPONSE = 'gemini_cli.malformed_json_response';
|
|
298
555
|
export class MalformedJsonResponseEvent {
|
|
299
556
|
'event.name';
|
|
300
557
|
'event.timestamp';
|
|
@@ -304,12 +561,24 @@ export class MalformedJsonResponseEvent {
|
|
|
304
561
|
this['event.timestamp'] = new Date().toISOString();
|
|
305
562
|
this.model = model;
|
|
306
563
|
}
|
|
564
|
+
toOpenTelemetryAttributes(config) {
|
|
565
|
+
return {
|
|
566
|
+
...getCommonAttributes(config),
|
|
567
|
+
'event.name': EVENT_MALFORMED_JSON_RESPONSE,
|
|
568
|
+
'event.timestamp': this['event.timestamp'],
|
|
569
|
+
model: this.model,
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
toLogBody() {
|
|
573
|
+
return `Malformed JSON response from ${this.model}.`;
|
|
574
|
+
}
|
|
307
575
|
}
|
|
308
576
|
export var IdeConnectionType;
|
|
309
577
|
(function (IdeConnectionType) {
|
|
310
578
|
IdeConnectionType["START"] = "start";
|
|
311
579
|
IdeConnectionType["SESSION"] = "session";
|
|
312
580
|
})(IdeConnectionType || (IdeConnectionType = {}));
|
|
581
|
+
export const EVENT_IDE_CONNECTION = 'gemini_cli.ide_connection';
|
|
313
582
|
export class IdeConnectionEvent {
|
|
314
583
|
'event.name';
|
|
315
584
|
'event.timestamp';
|
|
@@ -319,7 +588,19 @@ export class IdeConnectionEvent {
|
|
|
319
588
|
this['event.timestamp'] = new Date().toISOString();
|
|
320
589
|
this.connection_type = connection_type;
|
|
321
590
|
}
|
|
591
|
+
toOpenTelemetryAttributes(config) {
|
|
592
|
+
return {
|
|
593
|
+
...getCommonAttributes(config),
|
|
594
|
+
'event.name': EVENT_IDE_CONNECTION,
|
|
595
|
+
'event.timestamp': this['event.timestamp'],
|
|
596
|
+
connection_type: this.connection_type,
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
toLogBody() {
|
|
600
|
+
return `Ide connection. Type: ${this.connection_type}.`;
|
|
601
|
+
}
|
|
322
602
|
}
|
|
603
|
+
export const EVENT_CONVERSATION_FINISHED = 'gemini_cli.conversation_finished';
|
|
323
604
|
export class ConversationFinishedEvent {
|
|
324
605
|
'event_name';
|
|
325
606
|
'event.timestamp'; // ISO 8601;
|
|
@@ -331,6 +612,18 @@ export class ConversationFinishedEvent {
|
|
|
331
612
|
this.approvalMode = approvalMode;
|
|
332
613
|
this.turnCount = turnCount;
|
|
333
614
|
}
|
|
615
|
+
toOpenTelemetryAttributes(config) {
|
|
616
|
+
return {
|
|
617
|
+
...getCommonAttributes(config),
|
|
618
|
+
'event.name': EVENT_CONVERSATION_FINISHED,
|
|
619
|
+
'event.timestamp': this['event.timestamp'],
|
|
620
|
+
approvalMode: this.approvalMode,
|
|
621
|
+
turnCount: this.turnCount,
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
toLogBody() {
|
|
625
|
+
return `Conversation finished.`;
|
|
626
|
+
}
|
|
334
627
|
}
|
|
335
628
|
export class KittySequenceOverflowEvent {
|
|
336
629
|
'event.name';
|
|
@@ -344,7 +637,20 @@ export class KittySequenceOverflowEvent {
|
|
|
344
637
|
// Truncate to first 20 chars for logging (avoid logging sensitive data)
|
|
345
638
|
this.truncated_sequence = truncated_sequence.substring(0, 20);
|
|
346
639
|
}
|
|
640
|
+
toOpenTelemetryAttributes(config) {
|
|
641
|
+
return {
|
|
642
|
+
...getCommonAttributes(config),
|
|
643
|
+
'event.name': this['event.name'],
|
|
644
|
+
'event.timestamp': this['event.timestamp'],
|
|
645
|
+
sequence_length: this.sequence_length,
|
|
646
|
+
truncated_sequence: this.truncated_sequence,
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
toLogBody() {
|
|
650
|
+
return `Kitty sequence buffer overflow: ${this.sequence_length} bytes`;
|
|
651
|
+
}
|
|
347
652
|
}
|
|
653
|
+
export const EVENT_FILE_OPERATION = 'gemini_cli.file_operation';
|
|
348
654
|
export class FileOperationEvent {
|
|
349
655
|
'event.name';
|
|
350
656
|
'event.timestamp';
|
|
@@ -364,7 +670,33 @@ export class FileOperationEvent {
|
|
|
364
670
|
this.extension = extension;
|
|
365
671
|
this.programming_language = programming_language;
|
|
366
672
|
}
|
|
673
|
+
toOpenTelemetryAttributes(config) {
|
|
674
|
+
const attributes = {
|
|
675
|
+
...getCommonAttributes(config),
|
|
676
|
+
'event.name': EVENT_FILE_OPERATION,
|
|
677
|
+
'event.timestamp': this['event.timestamp'],
|
|
678
|
+
tool_name: this.tool_name,
|
|
679
|
+
operation: this.operation,
|
|
680
|
+
};
|
|
681
|
+
if (this.lines) {
|
|
682
|
+
attributes['lines'] = this.lines;
|
|
683
|
+
}
|
|
684
|
+
if (this.mimetype) {
|
|
685
|
+
attributes['mimetype'] = this.mimetype;
|
|
686
|
+
}
|
|
687
|
+
if (this.extension) {
|
|
688
|
+
attributes['extension'] = this.extension;
|
|
689
|
+
}
|
|
690
|
+
if (this.programming_language) {
|
|
691
|
+
attributes['programming_language'] = this.programming_language;
|
|
692
|
+
}
|
|
693
|
+
return attributes;
|
|
694
|
+
}
|
|
695
|
+
toLogBody() {
|
|
696
|
+
return `File operation: ${this.operation}. Lines: ${this.lines}.`;
|
|
697
|
+
}
|
|
367
698
|
}
|
|
699
|
+
export const EVENT_INVALID_CHUNK = 'gemini_cli.chat.invalid_chunk';
|
|
368
700
|
// Add these new event interfaces
|
|
369
701
|
export class InvalidChunkEvent {
|
|
370
702
|
'event.name';
|
|
@@ -375,35 +707,84 @@ export class InvalidChunkEvent {
|
|
|
375
707
|
this['event.timestamp'] = new Date().toISOString();
|
|
376
708
|
this.error_message = error_message;
|
|
377
709
|
}
|
|
710
|
+
toOpenTelemetryAttributes(config) {
|
|
711
|
+
const attributes = {
|
|
712
|
+
...getCommonAttributes(config),
|
|
713
|
+
'event.name': EVENT_INVALID_CHUNK,
|
|
714
|
+
'event.timestamp': this['event.timestamp'],
|
|
715
|
+
};
|
|
716
|
+
if (this.error_message) {
|
|
717
|
+
attributes['error.message'] = this.error_message;
|
|
718
|
+
}
|
|
719
|
+
return attributes;
|
|
720
|
+
}
|
|
721
|
+
toLogBody() {
|
|
722
|
+
return `Invalid chunk received from stream.`;
|
|
723
|
+
}
|
|
378
724
|
}
|
|
725
|
+
export const EVENT_CONTENT_RETRY = 'gemini_cli.chat.content_retry';
|
|
379
726
|
export class ContentRetryEvent {
|
|
380
727
|
'event.name';
|
|
381
728
|
'event.timestamp';
|
|
382
729
|
attempt_number;
|
|
383
730
|
error_type; // e.g., 'EmptyStreamError'
|
|
384
731
|
retry_delay_ms;
|
|
385
|
-
|
|
732
|
+
model;
|
|
733
|
+
constructor(attempt_number, error_type, retry_delay_ms, model) {
|
|
386
734
|
this['event.name'] = 'content_retry';
|
|
387
735
|
this['event.timestamp'] = new Date().toISOString();
|
|
388
736
|
this.attempt_number = attempt_number;
|
|
389
737
|
this.error_type = error_type;
|
|
390
738
|
this.retry_delay_ms = retry_delay_ms;
|
|
739
|
+
this.model = model;
|
|
740
|
+
}
|
|
741
|
+
toOpenTelemetryAttributes(config) {
|
|
742
|
+
return {
|
|
743
|
+
...getCommonAttributes(config),
|
|
744
|
+
'event.name': EVENT_CONTENT_RETRY,
|
|
745
|
+
'event.timestamp': this['event.timestamp'],
|
|
746
|
+
attempt_number: this.attempt_number,
|
|
747
|
+
error_type: this.error_type,
|
|
748
|
+
retry_delay_ms: this.retry_delay_ms,
|
|
749
|
+
model: this.model,
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
toLogBody() {
|
|
753
|
+
return `Content retry attempt ${this.attempt_number} due to ${this.error_type}.`;
|
|
391
754
|
}
|
|
392
755
|
}
|
|
756
|
+
export const EVENT_CONTENT_RETRY_FAILURE = 'gemini_cli.chat.content_retry_failure';
|
|
393
757
|
export class ContentRetryFailureEvent {
|
|
394
758
|
'event.name';
|
|
395
759
|
'event.timestamp';
|
|
396
760
|
total_attempts;
|
|
397
761
|
final_error_type;
|
|
398
762
|
total_duration_ms; // Optional: total time spent retrying
|
|
399
|
-
|
|
763
|
+
model;
|
|
764
|
+
constructor(total_attempts, final_error_type, model, total_duration_ms) {
|
|
400
765
|
this['event.name'] = 'content_retry_failure';
|
|
401
766
|
this['event.timestamp'] = new Date().toISOString();
|
|
402
767
|
this.total_attempts = total_attempts;
|
|
403
768
|
this.final_error_type = final_error_type;
|
|
404
769
|
this.total_duration_ms = total_duration_ms;
|
|
770
|
+
this.model = model;
|
|
771
|
+
}
|
|
772
|
+
toOpenTelemetryAttributes(config) {
|
|
773
|
+
return {
|
|
774
|
+
...getCommonAttributes(config),
|
|
775
|
+
'event.name': EVENT_CONTENT_RETRY_FAILURE,
|
|
776
|
+
'event.timestamp': this['event.timestamp'],
|
|
777
|
+
total_attempts: this.total_attempts,
|
|
778
|
+
final_error_type: this.final_error_type,
|
|
779
|
+
total_duration_ms: this.total_duration_ms,
|
|
780
|
+
model: this.model,
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
toLogBody() {
|
|
784
|
+
return `All content retries failed after ${this.total_attempts} attempts.`;
|
|
405
785
|
}
|
|
406
786
|
}
|
|
787
|
+
export const EVENT_MODEL_ROUTING = 'gemini_cli.model_routing';
|
|
407
788
|
export class ModelRoutingEvent {
|
|
408
789
|
'event.name';
|
|
409
790
|
'event.timestamp';
|
|
@@ -423,7 +804,24 @@ export class ModelRoutingEvent {
|
|
|
423
804
|
this.failed = failed;
|
|
424
805
|
this.error_message = error_message;
|
|
425
806
|
}
|
|
807
|
+
toOpenTelemetryAttributes(config) {
|
|
808
|
+
return {
|
|
809
|
+
...getCommonAttributes(config),
|
|
810
|
+
'event.name': EVENT_MODEL_ROUTING,
|
|
811
|
+
'event.timestamp': this['event.timestamp'],
|
|
812
|
+
decision_model: this.decision_model,
|
|
813
|
+
decision_source: this.decision_source,
|
|
814
|
+
routing_latency_ms: this.routing_latency_ms,
|
|
815
|
+
reasoning: this.reasoning,
|
|
816
|
+
failed: this.failed,
|
|
817
|
+
error_message: this.error_message,
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
toLogBody() {
|
|
821
|
+
return `Model routing decision. Model: ${this.decision_model}, Source: ${this.decision_source}`;
|
|
822
|
+
}
|
|
426
823
|
}
|
|
824
|
+
export const EVENT_EXTENSION_INSTALL = 'gemini_cli.extension_install';
|
|
427
825
|
export class ExtensionInstallEvent {
|
|
428
826
|
'event.name';
|
|
429
827
|
'event.timestamp';
|
|
@@ -439,7 +837,22 @@ export class ExtensionInstallEvent {
|
|
|
439
837
|
this.extension_source = extension_source;
|
|
440
838
|
this.status = status;
|
|
441
839
|
}
|
|
840
|
+
toOpenTelemetryAttributes(config) {
|
|
841
|
+
return {
|
|
842
|
+
...getCommonAttributes(config),
|
|
843
|
+
'event.name': EVENT_EXTENSION_INSTALL,
|
|
844
|
+
'event.timestamp': this['event.timestamp'],
|
|
845
|
+
extension_name: this.extension_name,
|
|
846
|
+
extension_version: this.extension_version,
|
|
847
|
+
extension_source: this.extension_source,
|
|
848
|
+
status: this.status,
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
toLogBody() {
|
|
852
|
+
return `Installed extension ${this.extension_name}`;
|
|
853
|
+
}
|
|
442
854
|
}
|
|
855
|
+
export const EVENT_TOOL_OUTPUT_TRUNCATED = 'gemini_cli.tool_output_truncated';
|
|
443
856
|
export class ToolOutputTruncatedEvent {
|
|
444
857
|
eventName = 'tool_output_truncated';
|
|
445
858
|
'event.timestamp' = new Date().toISOString();
|
|
@@ -459,7 +872,25 @@ export class ToolOutputTruncatedEvent {
|
|
|
459
872
|
this.threshold = details.threshold;
|
|
460
873
|
this.lines = details.lines;
|
|
461
874
|
}
|
|
875
|
+
toOpenTelemetryAttributes(config) {
|
|
876
|
+
return {
|
|
877
|
+
...getCommonAttributes(config),
|
|
878
|
+
'event.name': EVENT_TOOL_OUTPUT_TRUNCATED,
|
|
879
|
+
eventName: this.eventName,
|
|
880
|
+
'event.timestamp': this['event.timestamp'],
|
|
881
|
+
tool_name: this.tool_name,
|
|
882
|
+
original_content_length: this.original_content_length,
|
|
883
|
+
truncated_content_length: this.truncated_content_length,
|
|
884
|
+
threshold: this.threshold,
|
|
885
|
+
lines: this.lines,
|
|
886
|
+
prompt_id: this.prompt_id,
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
toLogBody() {
|
|
890
|
+
return `Tool output truncated for ${this.tool_name}.`;
|
|
891
|
+
}
|
|
462
892
|
}
|
|
893
|
+
export const EVENT_EXTENSION_UNINSTALL = 'gemini_cli.extension_uninstall';
|
|
463
894
|
export class ExtensionUninstallEvent {
|
|
464
895
|
'event.name';
|
|
465
896
|
'event.timestamp';
|
|
@@ -471,7 +902,54 @@ export class ExtensionUninstallEvent {
|
|
|
471
902
|
this.extension_name = extension_name;
|
|
472
903
|
this.status = status;
|
|
473
904
|
}
|
|
905
|
+
toOpenTelemetryAttributes(config) {
|
|
906
|
+
return {
|
|
907
|
+
...getCommonAttributes(config),
|
|
908
|
+
'event.name': EVENT_EXTENSION_UNINSTALL,
|
|
909
|
+
'event.timestamp': this['event.timestamp'],
|
|
910
|
+
extension_name: this.extension_name,
|
|
911
|
+
status: this.status,
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
toLogBody() {
|
|
915
|
+
return `Uninstalled extension ${this.extension_name}`;
|
|
916
|
+
}
|
|
474
917
|
}
|
|
918
|
+
export const EVENT_EXTENSION_UPDATE = 'gemini_cli.extension_update';
|
|
919
|
+
export class ExtensionUpdateEvent {
|
|
920
|
+
'event.name';
|
|
921
|
+
'event.timestamp';
|
|
922
|
+
extension_name;
|
|
923
|
+
extension_previous_version;
|
|
924
|
+
extension_version;
|
|
925
|
+
extension_source;
|
|
926
|
+
status;
|
|
927
|
+
constructor(extension_name, extension_version, extension_previous_version, extension_source, status) {
|
|
928
|
+
this['event.name'] = 'extension_update';
|
|
929
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
930
|
+
this.extension_name = extension_name;
|
|
931
|
+
this.extension_version = extension_version;
|
|
932
|
+
this.extension_previous_version = extension_previous_version;
|
|
933
|
+
this.extension_source = extension_source;
|
|
934
|
+
this.status = status;
|
|
935
|
+
}
|
|
936
|
+
toOpenTelemetryAttributes(config) {
|
|
937
|
+
return {
|
|
938
|
+
...getCommonAttributes(config),
|
|
939
|
+
'event.name': EVENT_EXTENSION_UPDATE,
|
|
940
|
+
'event.timestamp': this['event.timestamp'],
|
|
941
|
+
extension_name: this.extension_name,
|
|
942
|
+
extension_version: this.extension_version,
|
|
943
|
+
extension_previous_version: this.extension_previous_version,
|
|
944
|
+
extension_source: this.extension_source,
|
|
945
|
+
status: this.status,
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
toLogBody() {
|
|
949
|
+
return `Updated extension ${this.extension_name}`;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
export const EVENT_EXTENSION_ENABLE = 'gemini_cli.extension_enable';
|
|
475
953
|
export class ExtensionEnableEvent {
|
|
476
954
|
'event.name';
|
|
477
955
|
'event.timestamp';
|
|
@@ -483,5 +961,189 @@ export class ExtensionEnableEvent {
|
|
|
483
961
|
this.extension_name = extension_name;
|
|
484
962
|
this.setting_scope = settingScope;
|
|
485
963
|
}
|
|
964
|
+
toOpenTelemetryAttributes(config) {
|
|
965
|
+
return {
|
|
966
|
+
...getCommonAttributes(config),
|
|
967
|
+
'event.name': EVENT_EXTENSION_ENABLE,
|
|
968
|
+
'event.timestamp': this['event.timestamp'],
|
|
969
|
+
extension_name: this.extension_name,
|
|
970
|
+
setting_scope: this.setting_scope,
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
toLogBody() {
|
|
974
|
+
return `Enabled extension ${this.extension_name}`;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
export const EVENT_MODEL_SLASH_COMMAND = 'gemini_cli.slash_command.model';
|
|
978
|
+
export class ModelSlashCommandEvent {
|
|
979
|
+
'event.name';
|
|
980
|
+
'event.timestamp';
|
|
981
|
+
model_name;
|
|
982
|
+
constructor(model_name) {
|
|
983
|
+
this['event.name'] = 'model_slash_command';
|
|
984
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
985
|
+
this.model_name = model_name;
|
|
986
|
+
}
|
|
987
|
+
toOpenTelemetryAttributes(config) {
|
|
988
|
+
return {
|
|
989
|
+
...getCommonAttributes(config),
|
|
990
|
+
'event.name': EVENT_MODEL_SLASH_COMMAND,
|
|
991
|
+
'event.timestamp': this['event.timestamp'],
|
|
992
|
+
model_name: this.model_name,
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
toLogBody() {
|
|
996
|
+
return `Model slash command. Model: ${this.model_name}`;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
export const EVENT_EXTENSION_DISABLE = 'gemini_cli.extension_disable';
|
|
1000
|
+
export class ExtensionDisableEvent {
|
|
1001
|
+
'event.name';
|
|
1002
|
+
'event.timestamp';
|
|
1003
|
+
extension_name;
|
|
1004
|
+
setting_scope;
|
|
1005
|
+
constructor(extension_name, settingScope) {
|
|
1006
|
+
this['event.name'] = 'extension_disable';
|
|
1007
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1008
|
+
this.extension_name = extension_name;
|
|
1009
|
+
this.setting_scope = settingScope;
|
|
1010
|
+
}
|
|
1011
|
+
toOpenTelemetryAttributes(config) {
|
|
1012
|
+
return {
|
|
1013
|
+
...getCommonAttributes(config),
|
|
1014
|
+
'event.name': EVENT_EXTENSION_DISABLE,
|
|
1015
|
+
'event.timestamp': this['event.timestamp'],
|
|
1016
|
+
extension_name: this.extension_name,
|
|
1017
|
+
setting_scope: this.setting_scope,
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
toLogBody() {
|
|
1021
|
+
return `Disabled extension ${this.extension_name}`;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
export const EVENT_SMART_EDIT_STRATEGY = 'gemini_cli.smart_edit_strategy';
|
|
1025
|
+
export class SmartEditStrategyEvent {
|
|
1026
|
+
'event.name';
|
|
1027
|
+
'event.timestamp';
|
|
1028
|
+
strategy;
|
|
1029
|
+
constructor(strategy) {
|
|
1030
|
+
this['event.name'] = 'smart_edit_strategy';
|
|
1031
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1032
|
+
this.strategy = strategy;
|
|
1033
|
+
}
|
|
1034
|
+
toOpenTelemetryAttributes(config) {
|
|
1035
|
+
return {
|
|
1036
|
+
...getCommonAttributes(config),
|
|
1037
|
+
'event.name': EVENT_SMART_EDIT_STRATEGY,
|
|
1038
|
+
'event.timestamp': this['event.timestamp'],
|
|
1039
|
+
strategy: this.strategy,
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
toLogBody() {
|
|
1043
|
+
return `Smart Edit Tool Strategy: ${this.strategy}`;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
export const EVENT_SMART_EDIT_CORRECTION = 'gemini_cli.smart_edit_correction';
|
|
1047
|
+
export class SmartEditCorrectionEvent {
|
|
1048
|
+
'event.name';
|
|
1049
|
+
'event.timestamp';
|
|
1050
|
+
correction;
|
|
1051
|
+
constructor(correction) {
|
|
1052
|
+
this['event.name'] = 'smart_edit_correction';
|
|
1053
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1054
|
+
this.correction = correction;
|
|
1055
|
+
}
|
|
1056
|
+
toOpenTelemetryAttributes(config) {
|
|
1057
|
+
return {
|
|
1058
|
+
...getCommonAttributes(config),
|
|
1059
|
+
'event.name': EVENT_SMART_EDIT_CORRECTION,
|
|
1060
|
+
'event.timestamp': this['event.timestamp'],
|
|
1061
|
+
correction: this.correction,
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
toLogBody() {
|
|
1065
|
+
return `Smart Edit Tool Correction: ${this.correction}`;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
export const EVENT_AGENT_START = 'gemini_cli.agent.start';
|
|
1069
|
+
export class AgentStartEvent {
|
|
1070
|
+
'event.name';
|
|
1071
|
+
'event.timestamp';
|
|
1072
|
+
agent_id;
|
|
1073
|
+
agent_name;
|
|
1074
|
+
constructor(agent_id, agent_name) {
|
|
1075
|
+
this['event.name'] = 'agent_start';
|
|
1076
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1077
|
+
this.agent_id = agent_id;
|
|
1078
|
+
this.agent_name = agent_name;
|
|
1079
|
+
}
|
|
1080
|
+
toOpenTelemetryAttributes(config) {
|
|
1081
|
+
return {
|
|
1082
|
+
...getCommonAttributes(config),
|
|
1083
|
+
'event.name': EVENT_AGENT_START,
|
|
1084
|
+
'event.timestamp': this['event.timestamp'],
|
|
1085
|
+
agent_id: this.agent_id,
|
|
1086
|
+
agent_name: this.agent_name,
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
toLogBody() {
|
|
1090
|
+
return `Agent ${this.agent_name} started. ID: ${this.agent_id}`;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
export const EVENT_AGENT_FINISH = 'gemini_cli.agent.finish';
|
|
1094
|
+
export class AgentFinishEvent {
|
|
1095
|
+
'event.name';
|
|
1096
|
+
'event.timestamp';
|
|
1097
|
+
agent_id;
|
|
1098
|
+
agent_name;
|
|
1099
|
+
duration_ms;
|
|
1100
|
+
turn_count;
|
|
1101
|
+
terminate_reason;
|
|
1102
|
+
constructor(agent_id, agent_name, duration_ms, turn_count, terminate_reason) {
|
|
1103
|
+
this['event.name'] = 'agent_finish';
|
|
1104
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1105
|
+
this.agent_id = agent_id;
|
|
1106
|
+
this.agent_name = agent_name;
|
|
1107
|
+
this.duration_ms = duration_ms;
|
|
1108
|
+
this.turn_count = turn_count;
|
|
1109
|
+
this.terminate_reason = terminate_reason;
|
|
1110
|
+
}
|
|
1111
|
+
toOpenTelemetryAttributes(config) {
|
|
1112
|
+
return {
|
|
1113
|
+
...getCommonAttributes(config),
|
|
1114
|
+
'event.name': EVENT_AGENT_FINISH,
|
|
1115
|
+
'event.timestamp': this['event.timestamp'],
|
|
1116
|
+
agent_id: this.agent_id,
|
|
1117
|
+
agent_name: this.agent_name,
|
|
1118
|
+
duration_ms: this.duration_ms,
|
|
1119
|
+
turn_count: this.turn_count,
|
|
1120
|
+
terminate_reason: this.terminate_reason,
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
toLogBody() {
|
|
1124
|
+
return `Agent ${this.agent_name} finished. Reason: ${this.terminate_reason}. Duration: ${this.duration_ms}ms. Turns: ${this.turn_count}.`;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
export const EVENT_WEB_FETCH_FALLBACK_ATTEMPT = 'gemini_cli.web_fetch_fallback_attempt';
|
|
1128
|
+
export class WebFetchFallbackAttemptEvent {
|
|
1129
|
+
'event.name';
|
|
1130
|
+
'event.timestamp';
|
|
1131
|
+
reason;
|
|
1132
|
+
constructor(reason) {
|
|
1133
|
+
this['event.name'] = 'web_fetch_fallback_attempt';
|
|
1134
|
+
this['event.timestamp'] = new Date().toISOString();
|
|
1135
|
+
this.reason = reason;
|
|
1136
|
+
}
|
|
1137
|
+
toOpenTelemetryAttributes(config) {
|
|
1138
|
+
return {
|
|
1139
|
+
...getCommonAttributes(config),
|
|
1140
|
+
'event.name': EVENT_WEB_FETCH_FALLBACK_ATTEMPT,
|
|
1141
|
+
'event.timestamp': this['event.timestamp'],
|
|
1142
|
+
reason: this.reason,
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
toLogBody() {
|
|
1146
|
+
return `Web fetch fallback attempt. Reason: ${this.reason}`;
|
|
1147
|
+
}
|
|
486
1148
|
}
|
|
487
1149
|
//# sourceMappingURL=types.js.map
|