@machina.ai/cell-cli-core 1.6.1-rc1 → 1.8.2-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/agents/codebase-investigator.d.ts +11 -0
- package/dist/src/agents/codebase-investigator.js +73 -0
- package/dist/src/agents/codebase-investigator.js.map +1 -0
- package/dist/src/agents/executor.d.ts +88 -0
- package/dist/src/agents/executor.js +417 -0
- package/dist/src/agents/executor.js.map +1 -0
- package/dist/src/agents/executor.test.d.ts +6 -0
- package/dist/src/agents/executor.test.js +419 -0
- package/dist/src/agents/executor.test.js.map +1 -0
- package/dist/src/agents/invocation.d.ts +43 -0
- package/dist/src/agents/invocation.js +100 -0
- package/dist/src/agents/invocation.js.map +1 -0
- package/dist/src/agents/invocation.test.d.ts +6 -0
- package/dist/src/agents/invocation.test.js +206 -0
- package/dist/src/agents/invocation.test.js.map +1 -0
- package/dist/src/agents/registry.d.ts +35 -0
- package/dist/src/agents/registry.js +58 -0
- package/dist/src/agents/registry.js.map +1 -0
- package/dist/src/agents/registry.test.d.ts +6 -0
- package/dist/src/agents/registry.test.js +146 -0
- package/dist/src/agents/registry.test.js.map +1 -0
- package/dist/src/agents/schema-utils.d.ts +39 -0
- package/dist/src/agents/schema-utils.js +57 -0
- package/dist/src/agents/schema-utils.js.map +1 -0
- package/dist/src/agents/schema-utils.test.d.ts +6 -0
- package/dist/src/agents/schema-utils.test.js +144 -0
- package/dist/src/agents/schema-utils.test.js.map +1 -0
- package/dist/src/agents/subagent-tool-wrapper.d.ts +36 -0
- package/dist/src/agents/subagent-tool-wrapper.js +47 -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 +105 -0
- package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -0
- package/dist/src/agents/types.d.ts +116 -0
- package/dist/src/agents/types.js +17 -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/config/config.d.ts +15 -8
- package/dist/src/config/config.js +43 -14
- package/dist/src/config/config.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/core/baseLlmClient.d.ts +4 -0
- package/dist/src/core/baseLlmClient.js +24 -23
- package/dist/src/core/baseLlmClient.js.map +1 -1
- package/dist/src/core/baseLlmClient.test.js +76 -13
- package/dist/src/core/baseLlmClient.test.js.map +1 -1
- package/dist/src/core/client.d.ts +3 -2
- package/dist/src/core/client.js +37 -48
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +277 -119
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +33 -23
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/geminiChat.d.ts +4 -3
- package/dist/src/core/geminiChat.js +55 -61
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +241 -29
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/logger.test.js +16 -16
- package/dist/src/core/logger.test.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +11 -11
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/prompts.js +3 -2
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/turn.d.ts +1 -4
- package/dist/src/core/turn.js +2 -12
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/ide/detect-ide.d.ts +45 -14
- package/dist/src/ide/detect-ide.js +32 -69
- package/dist/src/ide/detect-ide.js.map +1 -1
- package/dist/src/ide/detect-ide.test.js +29 -46
- package/dist/src/ide/detect-ide.test.js.map +1 -1
- package/dist/src/ide/ide-client.d.ts +4 -4
- package/dist/src/ide/ide-client.js +30 -29
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-client.test.js +8 -21
- 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 +7 -9
- package/dist/src/ide/ide-installer.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +20 -13
- package/dist/src/ide/ide-installer.test.js.map +1 -1
- package/dist/src/index.d.ts +5 -2
- package/dist/src/index.js +5 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/oauth-provider.d.ts +4 -1
- package/dist/src/mcp/oauth-provider.js +31 -25
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/sa-impersonation-provider.d.ts +33 -0
- package/dist/src/mcp/sa-impersonation-provider.js +130 -0
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -0
- package/dist/src/mcp/sa-impersonation-provider.test.d.ts +6 -0
- package/dist/src/mcp/sa-impersonation-provider.test.js +117 -0
- package/dist/src/mcp/sa-impersonation-provider.test.js.map +1 -0
- package/dist/src/policy/policy-engine.js +11 -2
- package/dist/src/policy/policy-engine.js.map +1 -1
- package/dist/src/policy/policy-engine.test.js +45 -0
- package/dist/src/policy/policy-engine.test.js.map +1 -1
- package/dist/src/routing/strategies/compositeStrategy.js +4 -3
- package/dist/src/routing/strategies/compositeStrategy.js.map +1 -1
- package/dist/src/services/chatRecordingService.d.ts +1 -1
- package/dist/src/services/chatRecordingService.js +1 -1
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/fileSystemService.d.ts +9 -0
- package/dist/src/services/fileSystemService.js +11 -0
- package/dist/src/services/fileSystemService.js.map +1 -1
- package/dist/src/services/shellExecutionService.d.ts +2 -0
- package/dist/src/services/shellExecutionService.js +48 -7
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +13 -4
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/telemetry/activity-detector.d.ts +41 -0
- package/dist/src/telemetry/activity-detector.js +61 -0
- package/dist/src/telemetry/activity-detector.js.map +1 -0
- package/dist/src/telemetry/activity-detector.test.d.ts +6 -0
- package/dist/src/telemetry/activity-detector.test.js +136 -0
- package/dist/src/telemetry/activity-detector.test.js.map +1 -0
- package/dist/src/telemetry/activity-types.d.ts +19 -0
- package/dist/src/telemetry/activity-types.js +21 -0
- package/dist/src/telemetry/activity-types.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +6 -2
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +155 -102
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +178 -33
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +108 -100
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +116 -100
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/config.d.ts +31 -0
- package/dist/src/telemetry/config.js +74 -0
- package/dist/src/telemetry/config.js.map +1 -0
- package/dist/src/telemetry/config.test.d.ts +6 -0
- package/dist/src/telemetry/config.test.js +124 -0
- package/dist/src/telemetry/config.test.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +6 -12
- package/dist/src/telemetry/constants.js +7 -12
- package/dist/src/telemetry/constants.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +5 -1
- package/dist/src/telemetry/index.js +10 -0
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +3 -1
- package/dist/src/telemetry/loggers.js +78 -11
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +3 -3
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +126 -11
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/metrics.d.ts +309 -11
- package/dist/src/telemetry/metrics.js +424 -110
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +538 -15
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/sdk.js +1 -1
- package/dist/src/telemetry/sdk.js.map +1 -1
- package/dist/src/telemetry/sdk.test.js +13 -0
- package/dist/src/telemetry/sdk.test.js.map +1 -1
- package/dist/src/telemetry/types.d.ts +19 -3
- package/dist/src/telemetry/types.js +37 -6
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +1 -1
- package/dist/src/telemetry/uiTelemetry.js +2 -3
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +13 -13
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/mock-tool.d.ts +28 -3
- package/dist/src/test-utils/mock-tool.js +71 -1
- package/dist/src/test-utils/mock-tool.js.map +1 -1
- package/dist/src/tools/glob.js +2 -1
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/ls.js +1 -1
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +2 -12
- package/dist/src/tools/mcp-client.js +22 -65
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +9 -154
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/message-bus-integration.test.d.ts +6 -0
- package/dist/src/tools/message-bus-integration.test.js +183 -0
- package/dist/src/tools/message-bus-integration.test.js.map +1 -0
- package/dist/src/tools/shell.js +5 -2
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/smart-edit.d.ts +19 -0
- package/dist/src/tools/smart-edit.js +105 -3
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/smart-edit.test.js +83 -5
- package/dist/src/tools/smart-edit.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +1 -0
- package/dist/src/tools/tool-error.js +1 -0
- package/dist/src/tools/tool-error.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +10 -10
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +11 -3
- package/dist/src/tools/tools.js +94 -3
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/write-todos.d.ts +25 -0
- package/dist/src/tools/write-todos.js +150 -0
- package/dist/src/tools/write-todos.js.map +1 -0
- package/dist/src/tools/write-todos.test.d.ts +6 -0
- package/dist/src/tools/write-todos.test.js +89 -0
- package/dist/src/tools/write-todos.test.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.d.ts +1 -1
- package/dist/src/utils/flashFallback.test.js +2 -2
- package/dist/src/utils/flashFallback.test.js.map +1 -1
- package/dist/src/utils/getFolderStructure.d.ts +1 -1
- package/dist/src/utils/getFolderStructure.js +1 -1
- package/dist/src/utils/getFolderStructure.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.js +11 -1
- package/dist/src/utils/llm-edit-fixer.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.test.js +81 -0
- package/dist/src/utils/llm-edit-fixer.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +1 -1
- package/dist/src/utils/memoryDiscovery.js +1 -1
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.js +13 -20
- package/dist/src/utils/memoryImportProcessor.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.test.js +14 -0
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
- package/dist/src/utils/retry.d.ts +3 -1
- package/dist/src/utils/retry.js +20 -5
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +31 -2
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/schemaValidator.js +11 -1
- package/dist/src/utils/schemaValidator.js.map +1 -1
- package/dist/src/utils/schemaValidator.test.d.ts +6 -0
- package/dist/src/utils/schemaValidator.test.js +113 -0
- package/dist/src/utils/schemaValidator.test.js.map +1 -0
- package/dist/src/utils/shell-utils.js +5 -1
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +5 -0
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/src/utils/terminalSerializer.d.ts +1 -4
- package/dist/src/utils/terminalSerializer.js +3 -3
- package/dist/src/utils/terminalSerializer.js.map +1 -1
- package/dist/src/utils/thoughtUtils.d.ts +21 -0
- package/dist/src/utils/thoughtUtils.js +39 -0
- package/dist/src/utils/thoughtUtils.js.map +1 -0
- package/dist/src/utils/thoughtUtils.test.d.ts +6 -0
- package/dist/src/utils/thoughtUtils.test.js +78 -0
- package/dist/src/utils/thoughtUtils.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/src/test-utils/tools.d.ts +0 -45
- package/dist/src/test-utils/tools.js +0 -105
- package/dist/src/test-utils/tools.js.map +0 -1
|
@@ -10,7 +10,7 @@ import { UserAccountManager } from '../../utils/userAccountManager.js';
|
|
|
10
10
|
import { safeJsonStringify } from '../../utils/safeJsonStringify.js';
|
|
11
11
|
import { FixedDeque } from 'mnemonist';
|
|
12
12
|
import { GIT_COMMIT_INFO, CLI_VERSION } from '../../generated/git-commit.js';
|
|
13
|
-
import {
|
|
13
|
+
import { IDE_DEFINITIONS, detectIdeFromEnv, isCloudShell, } from '../../ide/detect-ide.js';
|
|
14
14
|
export var EventNames;
|
|
15
15
|
(function (EventNames) {
|
|
16
16
|
EventNames["START_SESSION"] = "start_session";
|
|
@@ -36,10 +36,12 @@ export var EventNames;
|
|
|
36
36
|
EventNames["CONTENT_RETRY"] = "content_retry";
|
|
37
37
|
EventNames["CONTENT_RETRY_FAILURE"] = "content_retry_failure";
|
|
38
38
|
EventNames["EXTENSION_ENABLE"] = "extension_enable";
|
|
39
|
+
EventNames["EXTENSION_DISABLE"] = "extension_disable";
|
|
39
40
|
EventNames["EXTENSION_INSTALL"] = "extension_install";
|
|
40
41
|
EventNames["EXTENSION_UNINSTALL"] = "extension_uninstall";
|
|
41
42
|
EventNames["TOOL_OUTPUT_TRUNCATED"] = "tool_output_truncated";
|
|
42
43
|
EventNames["MODEL_ROUTING"] = "model_routing";
|
|
44
|
+
EventNames["MODEL_SLASH_COMMAND"] = "model_slash_command";
|
|
43
45
|
})(EventNames || (EventNames = {}));
|
|
44
46
|
/**
|
|
45
47
|
* Determine the surface that the user is currently using. Surface is effectively the
|
|
@@ -54,11 +56,14 @@ function determineSurface() {
|
|
|
54
56
|
if (process.env['SURFACE']) {
|
|
55
57
|
return process.env['SURFACE'];
|
|
56
58
|
}
|
|
59
|
+
else if (isCloudShell()) {
|
|
60
|
+
return IDE_DEFINITIONS.cloudshell.name;
|
|
61
|
+
}
|
|
57
62
|
else if (process.env['GITHUB_SHA']) {
|
|
58
63
|
return 'GitHub';
|
|
59
64
|
}
|
|
60
65
|
else if (process.env['TERM_PROGRAM'] === 'vscode') {
|
|
61
|
-
return detectIdeFromEnv() ||
|
|
66
|
+
return detectIdeFromEnv().name || IDE_DEFINITIONS.vscode.name;
|
|
62
67
|
}
|
|
63
68
|
else {
|
|
64
69
|
return 'SURFACE_NOT_SET';
|
|
@@ -252,69 +257,69 @@ export class ClearcutLogger {
|
|
|
252
257
|
logStartSessionEvent(event) {
|
|
253
258
|
const data = [
|
|
254
259
|
{
|
|
255
|
-
gemini_cli_key: EventMetadataKey.
|
|
260
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_MODEL,
|
|
256
261
|
value: event.model,
|
|
257
262
|
},
|
|
258
263
|
{
|
|
259
|
-
gemini_cli_key: EventMetadataKey.
|
|
264
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_EMBEDDING_MODEL,
|
|
260
265
|
value: event.embedding_model,
|
|
261
266
|
},
|
|
262
267
|
{
|
|
263
|
-
gemini_cli_key: EventMetadataKey.
|
|
268
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_SANDBOX,
|
|
264
269
|
value: event.sandbox_enabled.toString(),
|
|
265
270
|
},
|
|
266
271
|
{
|
|
267
|
-
gemini_cli_key: EventMetadataKey.
|
|
272
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_CORE_TOOLS,
|
|
268
273
|
value: event.core_tools_enabled,
|
|
269
274
|
},
|
|
270
275
|
{
|
|
271
|
-
gemini_cli_key: EventMetadataKey.
|
|
276
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_APPROVAL_MODE,
|
|
272
277
|
value: event.approval_mode,
|
|
273
278
|
},
|
|
274
279
|
{
|
|
275
|
-
gemini_cli_key: EventMetadataKey.
|
|
280
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_API_KEY_ENABLED,
|
|
276
281
|
value: event.api_key_enabled.toString(),
|
|
277
282
|
},
|
|
278
283
|
{
|
|
279
|
-
gemini_cli_key: EventMetadataKey.
|
|
284
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_VERTEX_API_ENABLED,
|
|
280
285
|
value: event.vertex_ai_enabled.toString(),
|
|
281
286
|
},
|
|
282
287
|
{
|
|
283
|
-
gemini_cli_key: EventMetadataKey.
|
|
288
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_DEBUG_MODE_ENABLED,
|
|
284
289
|
value: event.debug_enabled.toString(),
|
|
285
290
|
},
|
|
286
291
|
{
|
|
287
|
-
gemini_cli_key: EventMetadataKey.
|
|
292
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_VERTEX_API_ENABLED,
|
|
288
293
|
value: event.vertex_ai_enabled.toString(),
|
|
289
294
|
},
|
|
290
295
|
{
|
|
291
|
-
gemini_cli_key: EventMetadataKey.
|
|
296
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_MCP_SERVERS,
|
|
292
297
|
value: event.mcp_servers,
|
|
293
298
|
},
|
|
294
299
|
{
|
|
295
|
-
gemini_cli_key: EventMetadataKey.
|
|
300
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_VERTEX_API_ENABLED,
|
|
296
301
|
value: event.vertex_ai_enabled.toString(),
|
|
297
302
|
},
|
|
298
303
|
{
|
|
299
|
-
gemini_cli_key: EventMetadataKey.
|
|
304
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_TELEMETRY_ENABLED,
|
|
300
305
|
value: event.telemetry_enabled.toString(),
|
|
301
306
|
},
|
|
302
307
|
{
|
|
303
|
-
gemini_cli_key: EventMetadataKey.
|
|
308
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_TELEMETRY_LOG_USER_PROMPTS_ENABLED,
|
|
304
309
|
value: event.telemetry_log_user_prompts_enabled.toString(),
|
|
305
310
|
},
|
|
306
311
|
{
|
|
307
|
-
gemini_cli_key: EventMetadataKey.
|
|
312
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_MCP_SERVERS_COUNT,
|
|
308
313
|
value: event.mcp_servers_count
|
|
309
314
|
? event.mcp_servers_count.toString()
|
|
310
315
|
: '',
|
|
311
316
|
},
|
|
312
317
|
{
|
|
313
|
-
gemini_cli_key: EventMetadataKey.
|
|
318
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_MCP_TOOLS_COUNT,
|
|
314
319
|
value: event.mcp_tools_count?.toString() ?? '',
|
|
315
320
|
},
|
|
316
321
|
{
|
|
317
|
-
gemini_cli_key: EventMetadataKey.
|
|
322
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_START_SESSION_MCP_TOOLS,
|
|
318
323
|
value: event.mcp_tools ? event.mcp_tools : '',
|
|
319
324
|
},
|
|
320
325
|
];
|
|
@@ -329,7 +334,7 @@ export class ClearcutLogger {
|
|
|
329
334
|
this.promptId = event.prompt_id;
|
|
330
335
|
const data = [
|
|
331
336
|
{
|
|
332
|
-
gemini_cli_key: EventMetadataKey.
|
|
337
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_USER_PROMPT_LENGTH,
|
|
333
338
|
value: JSON.stringify(event.prompt_length),
|
|
334
339
|
},
|
|
335
340
|
];
|
|
@@ -339,44 +344,52 @@ export class ClearcutLogger {
|
|
|
339
344
|
logToolCallEvent(event) {
|
|
340
345
|
const data = [
|
|
341
346
|
{
|
|
342
|
-
gemini_cli_key: EventMetadataKey.
|
|
347
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_NAME,
|
|
343
348
|
value: JSON.stringify(event.function_name),
|
|
344
349
|
},
|
|
345
350
|
{
|
|
346
|
-
gemini_cli_key: EventMetadataKey.
|
|
351
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_DECISION,
|
|
347
352
|
value: JSON.stringify(event.decision),
|
|
348
353
|
},
|
|
349
354
|
{
|
|
350
|
-
gemini_cli_key: EventMetadataKey.
|
|
355
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_SUCCESS,
|
|
351
356
|
value: JSON.stringify(event.success),
|
|
352
357
|
},
|
|
353
358
|
{
|
|
354
|
-
gemini_cli_key: EventMetadataKey.
|
|
359
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_DURATION_MS,
|
|
355
360
|
value: JSON.stringify(event.duration_ms),
|
|
356
361
|
},
|
|
357
362
|
{
|
|
358
|
-
gemini_cli_key: EventMetadataKey.
|
|
363
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_ERROR_MESSAGE,
|
|
359
364
|
value: JSON.stringify(event.error),
|
|
360
365
|
},
|
|
361
366
|
{
|
|
362
|
-
gemini_cli_key: EventMetadataKey.
|
|
367
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_ERROR_TYPE,
|
|
363
368
|
value: JSON.stringify(event.error_type),
|
|
364
369
|
},
|
|
365
370
|
{
|
|
366
|
-
gemini_cli_key: EventMetadataKey.
|
|
371
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_TYPE,
|
|
367
372
|
value: JSON.stringify(event.tool_type),
|
|
368
373
|
},
|
|
369
374
|
{
|
|
370
|
-
gemini_cli_key: EventMetadataKey.
|
|
375
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_CONTENT_LENGTH,
|
|
371
376
|
value: JSON.stringify(event.content_length),
|
|
372
377
|
},
|
|
378
|
+
{
|
|
379
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_MCP_SERVER_NAME,
|
|
380
|
+
value: JSON.stringify(event.mcp_server_name),
|
|
381
|
+
},
|
|
373
382
|
];
|
|
374
383
|
if (event.metadata) {
|
|
375
384
|
const metadataMapping = {
|
|
376
|
-
model_added_lines: EventMetadataKey.
|
|
377
|
-
model_removed_lines: EventMetadataKey.
|
|
378
|
-
|
|
379
|
-
|
|
385
|
+
model_added_lines: EventMetadataKey.CELL_CLI_AI_ADDED_LINES,
|
|
386
|
+
model_removed_lines: EventMetadataKey.CELL_CLI_AI_REMOVED_LINES,
|
|
387
|
+
model_added_chars: EventMetadataKey.CELL_CLI_AI_ADDED_CHARS,
|
|
388
|
+
model_removed_chars: EventMetadataKey.CELL_CLI_AI_REMOVED_CHARS,
|
|
389
|
+
user_added_lines: EventMetadataKey.CELL_CLI_USER_ADDED_LINES,
|
|
390
|
+
user_removed_lines: EventMetadataKey.CELL_CLI_USER_REMOVED_LINES,
|
|
391
|
+
user_added_chars: EventMetadataKey.CELL_CLI_USER_ADDED_CHARS,
|
|
392
|
+
user_removed_chars: EventMetadataKey.CELL_CLI_USER_REMOVED_CHARS,
|
|
380
393
|
};
|
|
381
394
|
for (const [key, gemini_cli_key] of Object.entries(metadataMapping)) {
|
|
382
395
|
if (event.metadata[key] !== undefined) {
|
|
@@ -394,29 +407,29 @@ export class ClearcutLogger {
|
|
|
394
407
|
logFileOperationEvent(event) {
|
|
395
408
|
const data = [
|
|
396
409
|
{
|
|
397
|
-
gemini_cli_key: EventMetadataKey.
|
|
410
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_NAME,
|
|
398
411
|
value: JSON.stringify(event.tool_name),
|
|
399
412
|
},
|
|
400
413
|
{
|
|
401
|
-
gemini_cli_key: EventMetadataKey.
|
|
414
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_FILE_OPERATION_TYPE,
|
|
402
415
|
value: JSON.stringify(event.operation),
|
|
403
416
|
},
|
|
404
417
|
{
|
|
405
|
-
gemini_cli_key: EventMetadataKey.
|
|
418
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_FILE_OPERATION_LINES,
|
|
406
419
|
value: JSON.stringify(event.lines),
|
|
407
420
|
},
|
|
408
421
|
{
|
|
409
|
-
gemini_cli_key: EventMetadataKey.
|
|
422
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_FILE_OPERATION_MIMETYPE,
|
|
410
423
|
value: JSON.stringify(event.mimetype),
|
|
411
424
|
},
|
|
412
425
|
{
|
|
413
|
-
gemini_cli_key: EventMetadataKey.
|
|
426
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_FILE_OPERATION_EXTENSION,
|
|
414
427
|
value: JSON.stringify(event.extension),
|
|
415
428
|
},
|
|
416
429
|
];
|
|
417
430
|
if (event.programming_language) {
|
|
418
431
|
data.push({
|
|
419
|
-
gemini_cli_key: EventMetadataKey.
|
|
432
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_PROGRAMMING_LANGUAGE,
|
|
420
433
|
value: event.programming_language,
|
|
421
434
|
});
|
|
422
435
|
}
|
|
@@ -427,7 +440,7 @@ export class ClearcutLogger {
|
|
|
427
440
|
logApiRequestEvent(event) {
|
|
428
441
|
const data = [
|
|
429
442
|
{
|
|
430
|
-
gemini_cli_key: EventMetadataKey.
|
|
443
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_REQUEST_MODEL,
|
|
431
444
|
value: JSON.stringify(event.model),
|
|
432
445
|
},
|
|
433
446
|
];
|
|
@@ -437,35 +450,35 @@ export class ClearcutLogger {
|
|
|
437
450
|
logApiResponseEvent(event) {
|
|
438
451
|
const data = [
|
|
439
452
|
{
|
|
440
|
-
gemini_cli_key: EventMetadataKey.
|
|
453
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_RESPONSE_MODEL,
|
|
441
454
|
value: JSON.stringify(event.model),
|
|
442
455
|
},
|
|
443
456
|
{
|
|
444
|
-
gemini_cli_key: EventMetadataKey.
|
|
457
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_RESPONSE_STATUS_CODE,
|
|
445
458
|
value: JSON.stringify(event.status_code),
|
|
446
459
|
},
|
|
447
460
|
{
|
|
448
|
-
gemini_cli_key: EventMetadataKey.
|
|
461
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_RESPONSE_DURATION_MS,
|
|
449
462
|
value: JSON.stringify(event.duration_ms),
|
|
450
463
|
},
|
|
451
464
|
{
|
|
452
|
-
gemini_cli_key: EventMetadataKey.
|
|
465
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_RESPONSE_INPUT_TOKEN_COUNT,
|
|
453
466
|
value: JSON.stringify(event.input_token_count),
|
|
454
467
|
},
|
|
455
468
|
{
|
|
456
|
-
gemini_cli_key: EventMetadataKey.
|
|
469
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_RESPONSE_OUTPUT_TOKEN_COUNT,
|
|
457
470
|
value: JSON.stringify(event.output_token_count),
|
|
458
471
|
},
|
|
459
472
|
{
|
|
460
|
-
gemini_cli_key: EventMetadataKey.
|
|
473
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_RESPONSE_CACHED_TOKEN_COUNT,
|
|
461
474
|
value: JSON.stringify(event.cached_content_token_count),
|
|
462
475
|
},
|
|
463
476
|
{
|
|
464
|
-
gemini_cli_key: EventMetadataKey.
|
|
477
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_RESPONSE_THINKING_TOKEN_COUNT,
|
|
465
478
|
value: JSON.stringify(event.thoughts_token_count),
|
|
466
479
|
},
|
|
467
480
|
{
|
|
468
|
-
gemini_cli_key: EventMetadataKey.
|
|
481
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_RESPONSE_TOOL_TOKEN_COUNT,
|
|
469
482
|
value: JSON.stringify(event.tool_token_count),
|
|
470
483
|
},
|
|
471
484
|
];
|
|
@@ -475,19 +488,19 @@ export class ClearcutLogger {
|
|
|
475
488
|
logApiErrorEvent(event) {
|
|
476
489
|
const data = [
|
|
477
490
|
{
|
|
478
|
-
gemini_cli_key: EventMetadataKey.
|
|
491
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_ERROR_MODEL,
|
|
479
492
|
value: JSON.stringify(event.model),
|
|
480
493
|
},
|
|
481
494
|
{
|
|
482
|
-
gemini_cli_key: EventMetadataKey.
|
|
495
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_ERROR_TYPE,
|
|
483
496
|
value: JSON.stringify(event.error_type),
|
|
484
497
|
},
|
|
485
498
|
{
|
|
486
|
-
gemini_cli_key: EventMetadataKey.
|
|
499
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_ERROR_STATUS_CODE,
|
|
487
500
|
value: JSON.stringify(event.status_code),
|
|
488
501
|
},
|
|
489
502
|
{
|
|
490
|
-
gemini_cli_key: EventMetadataKey.
|
|
503
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_ERROR_DURATION_MS,
|
|
491
504
|
value: JSON.stringify(event.duration_ms),
|
|
492
505
|
},
|
|
493
506
|
];
|
|
@@ -497,11 +510,11 @@ export class ClearcutLogger {
|
|
|
497
510
|
logChatCompressionEvent(event) {
|
|
498
511
|
const data = [
|
|
499
512
|
{
|
|
500
|
-
gemini_cli_key: EventMetadataKey.
|
|
513
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_COMPRESSION_TOKENS_BEFORE,
|
|
501
514
|
value: `${event.tokens_before}`,
|
|
502
515
|
},
|
|
503
516
|
{
|
|
504
|
-
gemini_cli_key: EventMetadataKey.
|
|
517
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_COMPRESSION_TOKENS_AFTER,
|
|
505
518
|
value: `${event.tokens_after}`,
|
|
506
519
|
},
|
|
507
520
|
];
|
|
@@ -522,7 +535,7 @@ export class ClearcutLogger {
|
|
|
522
535
|
logLoopDetectedEvent(event) {
|
|
523
536
|
const data = [
|
|
524
537
|
{
|
|
525
|
-
gemini_cli_key: EventMetadataKey.
|
|
538
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_LOOP_DETECTED_TYPE,
|
|
526
539
|
value: JSON.stringify(event.loop_type),
|
|
527
540
|
},
|
|
528
541
|
];
|
|
@@ -537,11 +550,11 @@ export class ClearcutLogger {
|
|
|
537
550
|
logNextSpeakerCheck(event) {
|
|
538
551
|
const data = [
|
|
539
552
|
{
|
|
540
|
-
gemini_cli_key: EventMetadataKey.
|
|
553
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_RESPONSE_FINISH_REASON,
|
|
541
554
|
value: JSON.stringify(event.finish_reason),
|
|
542
555
|
},
|
|
543
556
|
{
|
|
544
|
-
gemini_cli_key: EventMetadataKey.
|
|
557
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_NEXT_SPEAKER_CHECK_RESULT,
|
|
545
558
|
value: JSON.stringify(event.result),
|
|
546
559
|
},
|
|
547
560
|
];
|
|
@@ -551,19 +564,19 @@ export class ClearcutLogger {
|
|
|
551
564
|
logSlashCommandEvent(event) {
|
|
552
565
|
const data = [
|
|
553
566
|
{
|
|
554
|
-
gemini_cli_key: EventMetadataKey.
|
|
567
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_SLASH_COMMAND_NAME,
|
|
555
568
|
value: JSON.stringify(event.command),
|
|
556
569
|
},
|
|
557
570
|
];
|
|
558
571
|
if (event.subcommand) {
|
|
559
572
|
data.push({
|
|
560
|
-
gemini_cli_key: EventMetadataKey.
|
|
573
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_SLASH_COMMAND_SUBCOMMAND,
|
|
561
574
|
value: JSON.stringify(event.subcommand),
|
|
562
575
|
});
|
|
563
576
|
}
|
|
564
577
|
if (event.status) {
|
|
565
578
|
data.push({
|
|
566
|
-
gemini_cli_key: EventMetadataKey.
|
|
579
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_SLASH_COMMAND_STATUS,
|
|
567
580
|
value: JSON.stringify(event.status),
|
|
568
581
|
});
|
|
569
582
|
}
|
|
@@ -573,7 +586,7 @@ export class ClearcutLogger {
|
|
|
573
586
|
logMalformedJsonResponseEvent(event) {
|
|
574
587
|
const data = [
|
|
575
588
|
{
|
|
576
|
-
gemini_cli_key: EventMetadataKey.
|
|
589
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_MALFORMED_JSON_RESPONSE_MODEL,
|
|
577
590
|
value: JSON.stringify(event.model),
|
|
578
591
|
},
|
|
579
592
|
];
|
|
@@ -583,7 +596,7 @@ export class ClearcutLogger {
|
|
|
583
596
|
logIdeConnectionEvent(event) {
|
|
584
597
|
const data = [
|
|
585
598
|
{
|
|
586
|
-
gemini_cli_key: EventMetadataKey.
|
|
599
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_IDE_CONNECTION_TYPE,
|
|
587
600
|
value: JSON.stringify(event.connection_type),
|
|
588
601
|
},
|
|
589
602
|
];
|
|
@@ -593,15 +606,15 @@ export class ClearcutLogger {
|
|
|
593
606
|
logConversationFinishedEvent(event) {
|
|
594
607
|
const data = [
|
|
595
608
|
{
|
|
596
|
-
gemini_cli_key: EventMetadataKey.
|
|
609
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_SESSION_ID,
|
|
597
610
|
value: this.config?.getSessionId() ?? '',
|
|
598
611
|
},
|
|
599
612
|
{
|
|
600
|
-
gemini_cli_key: EventMetadataKey.
|
|
613
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_CONVERSATION_TURN_COUNT,
|
|
601
614
|
value: JSON.stringify(event.turnCount),
|
|
602
615
|
},
|
|
603
616
|
{
|
|
604
|
-
gemini_cli_key: EventMetadataKey.
|
|
617
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_APPROVAL_MODE,
|
|
605
618
|
value: event.approvalMode,
|
|
606
619
|
},
|
|
607
620
|
];
|
|
@@ -611,11 +624,11 @@ export class ClearcutLogger {
|
|
|
611
624
|
logKittySequenceOverflowEvent(event) {
|
|
612
625
|
const data = [
|
|
613
626
|
{
|
|
614
|
-
gemini_cli_key: EventMetadataKey.
|
|
627
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_KITTY_SEQUENCE_LENGTH,
|
|
615
628
|
value: event.sequence_length.toString(),
|
|
616
629
|
},
|
|
617
630
|
{
|
|
618
|
-
gemini_cli_key: EventMetadataKey.
|
|
631
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_KITTY_TRUNCATED_SEQUENCE,
|
|
619
632
|
value: event.truncated_sequence,
|
|
620
633
|
},
|
|
621
634
|
];
|
|
@@ -633,7 +646,7 @@ export class ClearcutLogger {
|
|
|
633
646
|
const data = [];
|
|
634
647
|
if (event.error_message) {
|
|
635
648
|
data.push({
|
|
636
|
-
gemini_cli_key: EventMetadataKey.
|
|
649
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_INVALID_CHUNK_ERROR_MESSAGE,
|
|
637
650
|
value: event.error_message,
|
|
638
651
|
});
|
|
639
652
|
}
|
|
@@ -643,17 +656,21 @@ export class ClearcutLogger {
|
|
|
643
656
|
logContentRetryEvent(event) {
|
|
644
657
|
const data = [
|
|
645
658
|
{
|
|
646
|
-
gemini_cli_key: EventMetadataKey.
|
|
659
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_CONTENT_RETRY_ATTEMPT_NUMBER,
|
|
647
660
|
value: String(event.attempt_number),
|
|
648
661
|
},
|
|
649
662
|
{
|
|
650
|
-
gemini_cli_key: EventMetadataKey.
|
|
663
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_CONTENT_RETRY_ERROR_TYPE,
|
|
651
664
|
value: event.error_type,
|
|
652
665
|
},
|
|
653
666
|
{
|
|
654
|
-
gemini_cli_key: EventMetadataKey.
|
|
667
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_CONTENT_RETRY_DELAY_MS,
|
|
655
668
|
value: String(event.retry_delay_ms),
|
|
656
669
|
},
|
|
670
|
+
{
|
|
671
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_REQUEST_MODEL,
|
|
672
|
+
value: event.model,
|
|
673
|
+
},
|
|
657
674
|
];
|
|
658
675
|
this.enqueueLogEvent(this.createLogEvent(EventNames.CONTENT_RETRY, data));
|
|
659
676
|
this.flushIfNeeded();
|
|
@@ -661,17 +678,21 @@ export class ClearcutLogger {
|
|
|
661
678
|
logContentRetryFailureEvent(event) {
|
|
662
679
|
const data = [
|
|
663
680
|
{
|
|
664
|
-
gemini_cli_key: EventMetadataKey.
|
|
681
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_CONTENT_RETRY_FAILURE_TOTAL_ATTEMPTS,
|
|
665
682
|
value: String(event.total_attempts),
|
|
666
683
|
},
|
|
667
684
|
{
|
|
668
|
-
gemini_cli_key: EventMetadataKey.
|
|
685
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_CONTENT_RETRY_FAILURE_FINAL_ERROR_TYPE,
|
|
669
686
|
value: event.final_error_type,
|
|
670
687
|
},
|
|
688
|
+
{
|
|
689
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_API_REQUEST_MODEL,
|
|
690
|
+
value: event.model,
|
|
691
|
+
},
|
|
671
692
|
];
|
|
672
693
|
if (event.total_duration_ms) {
|
|
673
694
|
data.push({
|
|
674
|
-
gemini_cli_key: EventMetadataKey.
|
|
695
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_CONTENT_RETRY_FAILURE_TOTAL_DURATION_MS,
|
|
675
696
|
value: String(event.total_duration_ms),
|
|
676
697
|
});
|
|
677
698
|
}
|
|
@@ -681,59 +702,63 @@ export class ClearcutLogger {
|
|
|
681
702
|
logExtensionInstallEvent(event) {
|
|
682
703
|
const data = [
|
|
683
704
|
{
|
|
684
|
-
gemini_cli_key: EventMetadataKey.
|
|
705
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_NAME,
|
|
685
706
|
value: event.extension_name,
|
|
686
707
|
},
|
|
687
708
|
{
|
|
688
|
-
gemini_cli_key: EventMetadataKey.
|
|
709
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_VERSION,
|
|
689
710
|
value: event.extension_version,
|
|
690
711
|
},
|
|
691
712
|
{
|
|
692
|
-
gemini_cli_key: EventMetadataKey.
|
|
713
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_SOURCE,
|
|
693
714
|
value: event.extension_source,
|
|
694
715
|
},
|
|
695
716
|
{
|
|
696
|
-
gemini_cli_key: EventMetadataKey.
|
|
717
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_INSTALL_STATUS,
|
|
697
718
|
value: event.status,
|
|
698
719
|
},
|
|
699
720
|
];
|
|
700
721
|
this.enqueueLogEvent(this.createLogEvent(EventNames.EXTENSION_INSTALL, data));
|
|
701
|
-
this.
|
|
722
|
+
this.flushToClearcut().catch((error) => {
|
|
723
|
+
console.debug('Error flushing to Clearcut:', error);
|
|
724
|
+
});
|
|
702
725
|
}
|
|
703
726
|
logExtensionUninstallEvent(event) {
|
|
704
727
|
const data = [
|
|
705
728
|
{
|
|
706
|
-
gemini_cli_key: EventMetadataKey.
|
|
729
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_NAME,
|
|
707
730
|
value: event.extension_name,
|
|
708
731
|
},
|
|
709
732
|
{
|
|
710
|
-
gemini_cli_key: EventMetadataKey.
|
|
733
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_UNINSTALL_STATUS,
|
|
711
734
|
value: event.status,
|
|
712
735
|
},
|
|
713
736
|
];
|
|
714
737
|
this.enqueueLogEvent(this.createLogEvent(EventNames.EXTENSION_UNINSTALL, data));
|
|
715
|
-
this.
|
|
738
|
+
this.flushToClearcut().catch((error) => {
|
|
739
|
+
console.debug('Error flushing to Clearcut:', error);
|
|
740
|
+
});
|
|
716
741
|
}
|
|
717
742
|
logToolOutputTruncatedEvent(event) {
|
|
718
743
|
const data = [
|
|
719
744
|
{
|
|
720
|
-
gemini_cli_key: EventMetadataKey.
|
|
745
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_CALL_NAME,
|
|
721
746
|
value: JSON.stringify(event.tool_name),
|
|
722
747
|
},
|
|
723
748
|
{
|
|
724
|
-
gemini_cli_key: EventMetadataKey.
|
|
749
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_OUTPUT_TRUNCATED_ORIGINAL_LENGTH,
|
|
725
750
|
value: JSON.stringify(event.original_content_length),
|
|
726
751
|
},
|
|
727
752
|
{
|
|
728
|
-
gemini_cli_key: EventMetadataKey.
|
|
753
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_OUTPUT_TRUNCATED_TRUNCATED_LENGTH,
|
|
729
754
|
value: JSON.stringify(event.truncated_content_length),
|
|
730
755
|
},
|
|
731
756
|
{
|
|
732
|
-
gemini_cli_key: EventMetadataKey.
|
|
757
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_OUTPUT_TRUNCATED_THRESHOLD,
|
|
733
758
|
value: JSON.stringify(event.threshold),
|
|
734
759
|
},
|
|
735
760
|
{
|
|
736
|
-
gemini_cli_key: EventMetadataKey.
|
|
761
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_TOOL_OUTPUT_TRUNCATED_LINES,
|
|
737
762
|
value: JSON.stringify(event.lines),
|
|
738
763
|
},
|
|
739
764
|
];
|
|
@@ -743,25 +768,25 @@ export class ClearcutLogger {
|
|
|
743
768
|
logModelRoutingEvent(event) {
|
|
744
769
|
const data = [
|
|
745
770
|
{
|
|
746
|
-
gemini_cli_key: EventMetadataKey.
|
|
771
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_ROUTING_DECISION,
|
|
747
772
|
value: event.decision_model,
|
|
748
773
|
},
|
|
749
774
|
{
|
|
750
|
-
gemini_cli_key: EventMetadataKey.
|
|
775
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_ROUTING_DECISION_SOURCE,
|
|
751
776
|
value: event.decision_source,
|
|
752
777
|
},
|
|
753
778
|
{
|
|
754
|
-
gemini_cli_key: EventMetadataKey.
|
|
779
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_ROUTING_LATENCY_MS,
|
|
755
780
|
value: event.routing_latency_ms.toString(),
|
|
756
781
|
},
|
|
757
782
|
{
|
|
758
|
-
gemini_cli_key: EventMetadataKey.
|
|
783
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_ROUTING_FAILURE,
|
|
759
784
|
value: event.failed.toString(),
|
|
760
785
|
},
|
|
761
786
|
];
|
|
762
787
|
if (event.error_message) {
|
|
763
788
|
data.push({
|
|
764
|
-
gemini_cli_key: EventMetadataKey.
|
|
789
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_ROUTING_FAILURE_REASON,
|
|
765
790
|
value: event.error_message,
|
|
766
791
|
});
|
|
767
792
|
}
|
|
@@ -771,17 +796,45 @@ export class ClearcutLogger {
|
|
|
771
796
|
logExtensionEnableEvent(event) {
|
|
772
797
|
const data = [
|
|
773
798
|
{
|
|
774
|
-
gemini_cli_key: EventMetadataKey.
|
|
799
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_NAME,
|
|
775
800
|
value: event.extension_name,
|
|
776
801
|
},
|
|
777
802
|
{
|
|
778
|
-
gemini_cli_key: EventMetadataKey.
|
|
803
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_ENABLE_SETTING_SCOPE,
|
|
779
804
|
value: event.setting_scope,
|
|
780
805
|
},
|
|
781
806
|
];
|
|
782
807
|
this.enqueueLogEvent(this.createLogEvent(EventNames.EXTENSION_ENABLE, data));
|
|
808
|
+
this.flushToClearcut().catch((error) => {
|
|
809
|
+
console.debug('Error flushing to Clearcut:', error);
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
logModelSlashCommandEvent(event) {
|
|
813
|
+
const data = [
|
|
814
|
+
{
|
|
815
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_MODEL_SLASH_COMMAND,
|
|
816
|
+
value: event.model_name,
|
|
817
|
+
},
|
|
818
|
+
];
|
|
819
|
+
this.enqueueLogEvent(this.createLogEvent(EventNames.MODEL_SLASH_COMMAND, data));
|
|
783
820
|
this.flushIfNeeded();
|
|
784
821
|
}
|
|
822
|
+
logExtensionDisableEvent(event) {
|
|
823
|
+
const data = [
|
|
824
|
+
{
|
|
825
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_NAME,
|
|
826
|
+
value: event.extension_name,
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_EXTENSION_DISABLE_SETTING_SCOPE,
|
|
830
|
+
value: event.setting_scope,
|
|
831
|
+
},
|
|
832
|
+
];
|
|
833
|
+
this.enqueueLogEvent(this.createLogEvent(EventNames.EXTENSION_DISABLE, data));
|
|
834
|
+
this.flushToClearcut().catch((error) => {
|
|
835
|
+
console.debug('Error flushing to Clearcut:', error);
|
|
836
|
+
});
|
|
837
|
+
}
|
|
785
838
|
/**
|
|
786
839
|
* Adds default fields to data, and returns a new data array. This fields
|
|
787
840
|
* should exist on all log events.
|
|
@@ -790,43 +843,43 @@ export class ClearcutLogger {
|
|
|
790
843
|
const surface = determineSurface();
|
|
791
844
|
const defaultLogMetadata = [
|
|
792
845
|
{
|
|
793
|
-
gemini_cli_key: EventMetadataKey.
|
|
846
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_SESSION_ID,
|
|
794
847
|
value: this.config?.getSessionId() ?? '',
|
|
795
848
|
},
|
|
796
849
|
{
|
|
797
|
-
gemini_cli_key: EventMetadataKey.
|
|
850
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_AUTH_TYPE,
|
|
798
851
|
value: JSON.stringify(this.config?.getContentGeneratorConfig()?.authType),
|
|
799
852
|
},
|
|
800
853
|
{
|
|
801
|
-
gemini_cli_key: EventMetadataKey.
|
|
854
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_GOOGLE_ACCOUNTS_COUNT,
|
|
802
855
|
value: `${totalAccounts}`,
|
|
803
856
|
},
|
|
804
857
|
{
|
|
805
|
-
gemini_cli_key: EventMetadataKey.
|
|
858
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_SURFACE,
|
|
806
859
|
value: surface,
|
|
807
860
|
},
|
|
808
861
|
{
|
|
809
|
-
gemini_cli_key: EventMetadataKey.
|
|
862
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_VERSION,
|
|
810
863
|
value: CLI_VERSION,
|
|
811
864
|
},
|
|
812
865
|
{
|
|
813
|
-
gemini_cli_key: EventMetadataKey.
|
|
866
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_GIT_COMMIT_HASH,
|
|
814
867
|
value: GIT_COMMIT_INFO,
|
|
815
868
|
},
|
|
816
869
|
{
|
|
817
|
-
gemini_cli_key: EventMetadataKey.
|
|
870
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_PROMPT_ID,
|
|
818
871
|
value: this.promptId,
|
|
819
872
|
},
|
|
820
873
|
{
|
|
821
|
-
gemini_cli_key: EventMetadataKey.
|
|
874
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_OS,
|
|
822
875
|
value: process.platform,
|
|
823
876
|
},
|
|
824
877
|
{
|
|
825
|
-
gemini_cli_key: EventMetadataKey.
|
|
878
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_NODE_VERSION,
|
|
826
879
|
value: process.versions.node,
|
|
827
880
|
},
|
|
828
881
|
{
|
|
829
|
-
gemini_cli_key: EventMetadataKey.
|
|
882
|
+
gemini_cli_key: EventMetadataKey.CELL_CLI_USER_SETTINGS,
|
|
830
883
|
value: safeJsonStringify([
|
|
831
884
|
{
|
|
832
885
|
smart_edit_enabled: this.config?.getUseSmartEdit() ?? false,
|