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