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