@clinebot/core 0.0.18 → 0.0.21
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/account/cline-account-service.d.ts +3 -2
- package/dist/account/cline-account-service.d.ts.map +1 -0
- package/dist/account/index.d.ts +1 -0
- package/dist/account/index.d.ts.map +1 -0
- package/dist/account/rpc.d.ts +1 -0
- package/dist/account/rpc.d.ts.map +1 -0
- package/dist/account/types.d.ts +1 -0
- package/dist/account/types.d.ts.map +1 -0
- package/dist/agents/agent-config-loader.d.ts +1 -0
- package/dist/agents/agent-config-loader.d.ts.map +1 -0
- package/dist/agents/agent-config-parser.d.ts +1 -0
- package/dist/agents/agent-config-parser.d.ts.map +1 -0
- package/dist/agents/hooks-config-loader.d.ts +1 -0
- package/dist/agents/hooks-config-loader.d.ts.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/plugin-config-loader.d.ts +1 -0
- package/dist/agents/plugin-config-loader.d.ts.map +1 -0
- package/dist/agents/plugin-loader.d.ts +1 -0
- package/dist/agents/plugin-loader.d.ts.map +1 -0
- package/dist/agents/plugin-sandbox.d.ts +1 -0
- package/dist/agents/plugin-sandbox.d.ts.map +1 -0
- package/dist/agents/unified-config-file-watcher.d.ts +1 -0
- package/dist/agents/unified-config-file-watcher.d.ts.map +1 -0
- package/dist/agents/user-instruction-config-loader.d.ts +1 -0
- package/dist/agents/user-instruction-config-loader.d.ts.map +1 -0
- package/dist/auth/client.d.ts +1 -0
- package/dist/auth/client.d.ts.map +1 -0
- package/dist/auth/cline.d.ts +1 -0
- package/dist/auth/cline.d.ts.map +1 -0
- package/dist/auth/codex.d.ts +1 -0
- package/dist/auth/codex.d.ts.map +1 -0
- package/dist/auth/oca.d.ts +1 -0
- package/dist/auth/oca.d.ts.map +1 -0
- package/dist/auth/server.d.ts +1 -0
- package/dist/auth/server.d.ts.map +1 -0
- package/dist/auth/types.d.ts +1 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/utils.d.ts +1 -0
- package/dist/auth/utils.d.ts.map +1 -0
- package/dist/chat/chat-schema.d.ts +13 -12
- package/dist/chat/chat-schema.d.ts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.node.d.ts +2 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/index.node.js +303 -302
- package/dist/input/file-indexer.d.ts +1 -0
- package/dist/input/file-indexer.d.ts.map +1 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input/mention-enricher.d.ts +1 -0
- package/dist/input/mention-enricher.d.ts.map +1 -0
- package/dist/mcp/config-loader.d.ts +1 -0
- package/dist/mcp/config-loader.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/manager.d.ts +1 -0
- package/dist/mcp/manager.d.ts.map +1 -0
- package/dist/mcp/types.d.ts +1 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/providers/local-provider-registry.d.ts +36 -0
- package/dist/providers/local-provider-registry.d.ts.map +1 -0
- package/dist/providers/local-provider-service.d.ts +2 -1
- package/dist/providers/local-provider-service.d.ts.map +1 -0
- package/dist/runtime/commands.d.ts +1 -0
- package/dist/runtime/commands.d.ts.map +1 -0
- package/dist/runtime/hook-file-hooks.d.ts +1 -0
- package/dist/runtime/hook-file-hooks.d.ts.map +1 -0
- package/dist/runtime/rules.d.ts +1 -0
- package/dist/runtime/rules.d.ts.map +1 -0
- package/dist/runtime/runtime-builder.d.ts +1 -0
- package/dist/runtime/runtime-builder.d.ts.map +1 -0
- package/dist/runtime/sandbox/subprocess-sandbox.d.ts +1 -0
- package/dist/runtime/sandbox/subprocess-sandbox.d.ts.map +1 -0
- package/dist/runtime/session-runtime.d.ts +2 -0
- package/dist/runtime/session-runtime.d.ts.map +1 -0
- package/dist/runtime/skills.d.ts +1 -0
- package/dist/runtime/skills.d.ts.map +1 -0
- package/dist/runtime/tool-approval.d.ts +1 -0
- package/dist/runtime/tool-approval.d.ts.map +1 -0
- package/dist/runtime/workflows.d.ts +1 -0
- package/dist/runtime/workflows.d.ts.map +1 -0
- package/dist/session/default-session-manager.d.ts +4 -0
- package/dist/session/default-session-manager.d.ts.map +1 -0
- package/dist/session/file-session-service.d.ts +1 -0
- package/dist/session/file-session-service.d.ts.map +1 -0
- package/dist/session/rpc-session-service.d.ts +1 -0
- package/dist/session/rpc-session-service.d.ts.map +1 -0
- package/dist/session/rpc-spawn-lease.d.ts +1 -0
- package/dist/session/rpc-spawn-lease.d.ts.map +1 -0
- package/dist/session/runtime-oauth-token-manager.d.ts +1 -0
- package/dist/session/runtime-oauth-token-manager.d.ts.map +1 -0
- package/dist/session/session-agent-events.d.ts +20 -1
- package/dist/session/session-agent-events.d.ts.map +1 -0
- package/dist/session/session-artifacts.d.ts +1 -0
- package/dist/session/session-artifacts.d.ts.map +1 -0
- package/dist/session/session-config-builder.d.ts +1 -0
- package/dist/session/session-config-builder.d.ts.map +1 -0
- package/dist/session/session-graph.d.ts +1 -0
- package/dist/session/session-graph.d.ts.map +1 -0
- package/dist/session/session-host.d.ts +1 -0
- package/dist/session/session-host.d.ts.map +1 -0
- package/dist/session/session-manager.d.ts +1 -0
- package/dist/session/session-manager.d.ts.map +1 -0
- package/dist/session/session-manifest.d.ts +2 -1
- package/dist/session/session-manifest.d.ts.map +1 -0
- package/dist/session/session-service.d.ts +1 -0
- package/dist/session/session-service.d.ts.map +1 -0
- package/dist/session/session-team-coordination.d.ts +1 -0
- package/dist/session/session-team-coordination.d.ts.map +1 -0
- package/dist/session/session-telemetry.d.ts +3 -1
- package/dist/session/session-telemetry.d.ts.map +1 -0
- package/dist/session/sqlite-rpc-session-backend.d.ts +1 -0
- package/dist/session/sqlite-rpc-session-backend.d.ts.map +1 -0
- package/dist/session/unified-session-persistence-service.d.ts +1 -0
- package/dist/session/unified-session-persistence-service.d.ts.map +1 -0
- package/dist/session/utils/helpers.d.ts +1 -0
- package/dist/session/utils/helpers.d.ts.map +1 -0
- package/dist/session/utils/types.d.ts +1 -0
- package/dist/session/utils/types.d.ts.map +1 -0
- package/dist/session/utils/usage.d.ts +1 -0
- package/dist/session/utils/usage.d.ts.map +1 -0
- package/dist/session/workspace-manager.d.ts +1 -0
- package/dist/session/workspace-manager.d.ts.map +1 -0
- package/dist/session/workspace-manifest.d.ts +1 -0
- package/dist/session/workspace-manifest.d.ts.map +1 -0
- package/dist/storage/file-team-store.d.ts +1 -0
- package/dist/storage/file-team-store.d.ts.map +1 -0
- package/dist/storage/provider-settings-legacy-migration.d.ts +1 -0
- package/dist/storage/provider-settings-legacy-migration.d.ts.map +1 -0
- package/dist/storage/provider-settings-manager.d.ts +1 -0
- package/dist/storage/provider-settings-manager.d.ts.map +1 -0
- package/dist/storage/sqlite-session-store.d.ts +1 -0
- package/dist/storage/sqlite-session-store.d.ts.map +1 -0
- package/dist/storage/sqlite-team-store.d.ts +1 -0
- package/dist/storage/sqlite-team-store.d.ts.map +1 -0
- package/dist/storage/team-store.d.ts +1 -0
- package/dist/storage/team-store.d.ts.map +1 -0
- package/dist/team/index.d.ts +1 -0
- package/dist/team/index.d.ts.map +1 -0
- package/dist/team/projections.d.ts +1 -0
- package/dist/team/projections.d.ts.map +1 -0
- package/dist/telemetry/ITelemetryAdapter.d.ts +1 -0
- package/dist/telemetry/ITelemetryAdapter.d.ts.map +1 -0
- package/dist/telemetry/LoggerTelemetryAdapter.d.ts +1 -0
- package/dist/telemetry/LoggerTelemetryAdapter.d.ts.map +1 -0
- package/dist/telemetry/OpenTelemetryAdapter.d.ts +1 -0
- package/dist/telemetry/OpenTelemetryAdapter.d.ts.map +1 -0
- package/dist/telemetry/OpenTelemetryProvider.d.ts +1 -0
- package/dist/telemetry/OpenTelemetryProvider.d.ts.map +1 -0
- package/dist/telemetry/TelemetryService.d.ts +1 -0
- package/dist/telemetry/TelemetryService.d.ts.map +1 -0
- package/dist/telemetry/core-events.d.ts +55 -22
- package/dist/telemetry/core-events.d.ts.map +1 -0
- package/dist/telemetry/opentelemetry.d.ts +1 -0
- package/dist/telemetry/opentelemetry.d.ts.map +1 -0
- package/dist/tools/constants.d.ts +1 -0
- package/dist/tools/constants.d.ts.map +1 -0
- package/dist/tools/definitions.d.ts +8 -1
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/executors/apply-patch-parser.d.ts +1 -0
- package/dist/tools/executors/apply-patch-parser.d.ts.map +1 -0
- package/dist/tools/executors/apply-patch.d.ts +1 -0
- package/dist/tools/executors/apply-patch.d.ts.map +1 -0
- package/dist/tools/executors/bash.d.ts +2 -1
- package/dist/tools/executors/bash.d.ts.map +1 -0
- package/dist/tools/executors/editor.d.ts +1 -0
- package/dist/tools/executors/editor.d.ts.map +1 -0
- package/dist/tools/executors/file-read.d.ts +1 -0
- package/dist/tools/executors/file-read.d.ts.map +1 -0
- package/dist/tools/executors/index.d.ts +14 -7
- package/dist/tools/executors/index.d.ts.map +1 -0
- package/dist/tools/executors/search.d.ts +1 -0
- package/dist/tools/executors/search.d.ts.map +1 -0
- package/dist/tools/executors/web-fetch.d.ts +1 -0
- package/dist/tools/executors/web-fetch.d.ts.map +1 -0
- package/dist/tools/helpers.d.ts +15 -0
- package/dist/tools/helpers.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/model-tool-routing.d.ts +1 -0
- package/dist/tools/model-tool-routing.d.ts.map +1 -0
- package/dist/tools/presets.d.ts +1 -0
- package/dist/tools/presets.d.ts.map +1 -0
- package/dist/tools/schemas.d.ts +41 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/types.d.ts +3 -2
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/types/common.d.ts +1 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/events.d.ts +1 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/provider-settings.d.ts +1 -0
- package/dist/types/provider-settings.d.ts.map +1 -0
- package/dist/types/sessions.d.ts +1 -0
- package/dist/types/sessions.d.ts.map +1 -0
- package/dist/types/storage.d.ts +1 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/workspace.d.ts +1 -0
- package/dist/types/workspace.d.ts.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +8 -6
- package/src/account/cline-account-service.test.ts +0 -101
- package/src/account/cline-account-service.ts +0 -287
- package/src/account/index.ts +0 -22
- package/src/account/rpc.test.ts +0 -62
- package/src/account/rpc.ts +0 -172
- package/src/account/types.ts +0 -98
- package/src/agents/agent-config-loader.test.ts +0 -236
- package/src/agents/agent-config-loader.ts +0 -108
- package/src/agents/agent-config-parser.ts +0 -198
- package/src/agents/hooks-config-loader.test.ts +0 -20
- package/src/agents/hooks-config-loader.ts +0 -118
- package/src/agents/index.ts +0 -85
- package/src/agents/plugin-config-loader.test.ts +0 -140
- package/src/agents/plugin-config-loader.ts +0 -97
- package/src/agents/plugin-loader.test.ts +0 -228
- package/src/agents/plugin-loader.ts +0 -172
- package/src/agents/plugin-sandbox-bootstrap.ts +0 -445
- package/src/agents/plugin-sandbox.test.ts +0 -317
- package/src/agents/plugin-sandbox.ts +0 -341
- package/src/agents/unified-config-file-watcher.test.ts +0 -196
- package/src/agents/unified-config-file-watcher.ts +0 -483
- package/src/agents/user-instruction-config-loader.test.ts +0 -158
- package/src/agents/user-instruction-config-loader.ts +0 -438
- package/src/auth/client.test.ts +0 -40
- package/src/auth/client.ts +0 -25
- package/src/auth/cline.test.ts +0 -130
- package/src/auth/cline.ts +0 -420
- package/src/auth/codex.test.ts +0 -170
- package/src/auth/codex.ts +0 -491
- package/src/auth/oca.test.ts +0 -215
- package/src/auth/oca.ts +0 -573
- package/src/auth/server.ts +0 -216
- package/src/auth/types.ts +0 -81
- package/src/auth/utils.test.ts +0 -128
- package/src/auth/utils.ts +0 -247
- package/src/chat/chat-schema.ts +0 -82
- package/src/index.node.ts +0 -285
- package/src/index.ts +0 -211
- package/src/input/file-indexer.d.ts +0 -11
- package/src/input/file-indexer.test.ts +0 -127
- package/src/input/file-indexer.ts +0 -327
- package/src/input/index.ts +0 -7
- package/src/input/mention-enricher.test.ts +0 -85
- package/src/input/mention-enricher.ts +0 -122
- package/src/mcp/config-loader.test.ts +0 -238
- package/src/mcp/config-loader.ts +0 -219
- package/src/mcp/index.ts +0 -26
- package/src/mcp/manager.test.ts +0 -106
- package/src/mcp/manager.ts +0 -262
- package/src/mcp/types.ts +0 -88
- package/src/providers/local-provider-service.ts +0 -608
- package/src/runtime/commands.test.ts +0 -98
- package/src/runtime/commands.ts +0 -83
- package/src/runtime/hook-file-hooks.test.ts +0 -237
- package/src/runtime/hook-file-hooks.ts +0 -859
- package/src/runtime/index.ts +0 -37
- package/src/runtime/rules.ts +0 -34
- package/src/runtime/runtime-builder.team-persistence.test.ts +0 -202
- package/src/runtime/runtime-builder.test.ts +0 -371
- package/src/runtime/runtime-builder.ts +0 -589
- package/src/runtime/runtime-parity.test.ts +0 -143
- package/src/runtime/sandbox/subprocess-sandbox.ts +0 -231
- package/src/runtime/session-runtime.ts +0 -46
- package/src/runtime/skills.ts +0 -44
- package/src/runtime/tool-approval.ts +0 -104
- package/src/runtime/workflows.test.ts +0 -119
- package/src/runtime/workflows.ts +0 -45
- package/src/session/default-session-manager.e2e.test.ts +0 -384
- package/src/session/default-session-manager.test.ts +0 -1741
- package/src/session/default-session-manager.ts +0 -1233
- package/src/session/file-session-service.ts +0 -280
- package/src/session/index.ts +0 -42
- package/src/session/rpc-session-service.ts +0 -107
- package/src/session/rpc-spawn-lease.test.ts +0 -49
- package/src/session/rpc-spawn-lease.ts +0 -122
- package/src/session/runtime-oauth-token-manager.test.ts +0 -137
- package/src/session/runtime-oauth-token-manager.ts +0 -272
- package/src/session/session-agent-events.ts +0 -159
- package/src/session/session-artifacts.ts +0 -106
- package/src/session/session-config-builder.ts +0 -113
- package/src/session/session-graph.ts +0 -92
- package/src/session/session-host.test.ts +0 -29
- package/src/session/session-host.ts +0 -242
- package/src/session/session-manager.ts +0 -69
- package/src/session/session-manifest.ts +0 -29
- package/src/session/session-service.team-persistence.test.ts +0 -48
- package/src/session/session-service.ts +0 -673
- package/src/session/session-team-coordination.ts +0 -229
- package/src/session/session-telemetry.ts +0 -95
- package/src/session/sqlite-rpc-session-backend.ts +0 -303
- package/src/session/unified-session-persistence-service.test.ts +0 -85
- package/src/session/unified-session-persistence-service.ts +0 -996
- package/src/session/utils/helpers.ts +0 -139
- package/src/session/utils/types.ts +0 -57
- package/src/session/utils/usage.ts +0 -32
- package/src/session/workspace-manager.ts +0 -98
- package/src/session/workspace-manifest.ts +0 -100
- package/src/storage/artifact-store.ts +0 -1
- package/src/storage/file-team-store.ts +0 -257
- package/src/storage/index.ts +0 -11
- package/src/storage/provider-settings-legacy-migration.test.ts +0 -307
- package/src/storage/provider-settings-legacy-migration.ts +0 -689
- package/src/storage/provider-settings-manager.test.ts +0 -145
- package/src/storage/provider-settings-manager.ts +0 -150
- package/src/storage/session-store.ts +0 -1
- package/src/storage/sqlite-session-store.ts +0 -275
- package/src/storage/sqlite-team-store.ts +0 -454
- package/src/storage/team-store.ts +0 -40
- package/src/team/index.ts +0 -4
- package/src/team/projections.ts +0 -285
- package/src/telemetry/ITelemetryAdapter.ts +0 -94
- package/src/telemetry/LoggerTelemetryAdapter.test.ts +0 -42
- package/src/telemetry/LoggerTelemetryAdapter.ts +0 -114
- package/src/telemetry/OpenTelemetryAdapter.test.ts +0 -157
- package/src/telemetry/OpenTelemetryAdapter.ts +0 -348
- package/src/telemetry/OpenTelemetryProvider.test.ts +0 -113
- package/src/telemetry/OpenTelemetryProvider.ts +0 -322
- package/src/telemetry/TelemetryService.test.ts +0 -134
- package/src/telemetry/TelemetryService.ts +0 -141
- package/src/telemetry/core-events.ts +0 -344
- package/src/telemetry/opentelemetry.ts +0 -20
- package/src/tools/constants.ts +0 -35
- package/src/tools/definitions.test.ts +0 -658
- package/src/tools/definitions.ts +0 -726
- package/src/tools/executors/apply-patch-parser.ts +0 -520
- package/src/tools/executors/apply-patch.ts +0 -359
- package/src/tools/executors/bash.ts +0 -205
- package/src/tools/executors/editor.test.ts +0 -35
- package/src/tools/executors/editor.ts +0 -219
- package/src/tools/executors/file-read.test.ts +0 -49
- package/src/tools/executors/file-read.ts +0 -110
- package/src/tools/executors/index.ts +0 -75
- package/src/tools/executors/search.ts +0 -278
- package/src/tools/executors/web-fetch.ts +0 -259
- package/src/tools/index.ts +0 -168
- package/src/tools/model-tool-routing.test.ts +0 -86
- package/src/tools/model-tool-routing.ts +0 -132
- package/src/tools/presets.test.ts +0 -62
- package/src/tools/presets.ts +0 -168
- package/src/tools/schemas.ts +0 -284
- package/src/tools/types.ts +0 -328
- package/src/types/common.ts +0 -14
- package/src/types/config.ts +0 -84
- package/src/types/events.ts +0 -74
- package/src/types/index.ts +0 -24
- package/src/types/provider-settings.ts +0 -43
- package/src/types/sessions.ts +0 -16
- package/src/types/storage.ts +0 -64
- package/src/types/workspace.ts +0 -7
- package/src/types.ts +0 -128
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
import type { ITelemetryService, TelemetryProperties } from "@clinebot/shared";
|
|
2
|
-
|
|
3
|
-
const MAX_ERROR_MESSAGE_LENGTH = 500;
|
|
4
|
-
|
|
5
|
-
export const LegacyTelemetryEvents = {
|
|
6
|
-
USER: {
|
|
7
|
-
AUTH_STARTED: "user.auth_started",
|
|
8
|
-
AUTH_SUCCEEDED: "user.auth_succeeded",
|
|
9
|
-
AUTH_FAILED: "user.auth_failed",
|
|
10
|
-
AUTH_LOGGED_OUT: "user.auth_logged_out",
|
|
11
|
-
},
|
|
12
|
-
TASK: {
|
|
13
|
-
CREATED: "task.created",
|
|
14
|
-
RESTARTED: "task.restarted",
|
|
15
|
-
COMPLETED: "task.completed",
|
|
16
|
-
CONVERSATION_TURN: "task.conversation_turn",
|
|
17
|
-
TOKEN_USAGE: "task.tokens",
|
|
18
|
-
MODE_SWITCH: "task.mode",
|
|
19
|
-
TOOL_USED: "task.tool_used",
|
|
20
|
-
SKILL_USED: "task.skill_used",
|
|
21
|
-
DIFF_EDIT_FAILED: "task.diff_edit_failed",
|
|
22
|
-
PROVIDER_API_ERROR: "task.provider_api_error",
|
|
23
|
-
MENTION_USED: "task.mention_used",
|
|
24
|
-
MENTION_FAILED: "task.mention_failed",
|
|
25
|
-
MENTION_SEARCH_RESULTS: "task.mention_search_results",
|
|
26
|
-
SUBAGENT_STARTED: "task.subagent_started",
|
|
27
|
-
SUBAGENT_COMPLETED: "task.subagent_completed",
|
|
28
|
-
},
|
|
29
|
-
HOOKS: {
|
|
30
|
-
DISCOVERY_COMPLETED: "hooks.discovery_completed",
|
|
31
|
-
},
|
|
32
|
-
} as const;
|
|
33
|
-
|
|
34
|
-
function emit(
|
|
35
|
-
telemetry: ITelemetryService | undefined,
|
|
36
|
-
event: string,
|
|
37
|
-
properties?: TelemetryProperties,
|
|
38
|
-
): void {
|
|
39
|
-
telemetry?.capture({ event, properties });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function truncateErrorMessage(errorMessage?: string): string | undefined {
|
|
43
|
-
if (!errorMessage) {
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
return errorMessage.substring(0, MAX_ERROR_MESSAGE_LENGTH);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function captureAuthStarted(
|
|
50
|
-
telemetry: ITelemetryService | undefined,
|
|
51
|
-
provider?: string,
|
|
52
|
-
): void {
|
|
53
|
-
emit(telemetry, LegacyTelemetryEvents.USER.AUTH_STARTED, { provider });
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function captureAuthSucceeded(
|
|
57
|
-
telemetry: ITelemetryService | undefined,
|
|
58
|
-
provider?: string,
|
|
59
|
-
): void {
|
|
60
|
-
emit(telemetry, LegacyTelemetryEvents.USER.AUTH_SUCCEEDED, { provider });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function captureAuthFailed(
|
|
64
|
-
telemetry: ITelemetryService | undefined,
|
|
65
|
-
provider?: string,
|
|
66
|
-
errorMessage?: string,
|
|
67
|
-
): void {
|
|
68
|
-
emit(telemetry, LegacyTelemetryEvents.USER.AUTH_FAILED, {
|
|
69
|
-
provider,
|
|
70
|
-
errorMessage: truncateErrorMessage(errorMessage),
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function captureAuthLoggedOut(
|
|
75
|
-
telemetry: ITelemetryService | undefined,
|
|
76
|
-
provider?: string,
|
|
77
|
-
reason?: string,
|
|
78
|
-
): void {
|
|
79
|
-
emit(telemetry, LegacyTelemetryEvents.USER.AUTH_LOGGED_OUT, {
|
|
80
|
-
provider,
|
|
81
|
-
reason,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function identifyAccount(
|
|
86
|
-
telemetry: ITelemetryService | undefined,
|
|
87
|
-
account: {
|
|
88
|
-
id?: string;
|
|
89
|
-
email?: string;
|
|
90
|
-
provider?: string;
|
|
91
|
-
organizationId?: string;
|
|
92
|
-
organizationName?: string;
|
|
93
|
-
memberId?: string;
|
|
94
|
-
},
|
|
95
|
-
): void {
|
|
96
|
-
const distinctId = account.id?.trim();
|
|
97
|
-
if (distinctId) {
|
|
98
|
-
telemetry?.setDistinctId(distinctId);
|
|
99
|
-
}
|
|
100
|
-
telemetry?.updateCommonProperties({
|
|
101
|
-
account_id: account.id,
|
|
102
|
-
account_email: account.email,
|
|
103
|
-
provider: account.provider,
|
|
104
|
-
organization_id: account.organizationId,
|
|
105
|
-
organization_name: account.organizationName,
|
|
106
|
-
member_id: account.memberId,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export function captureTaskCreated(
|
|
111
|
-
telemetry: ITelemetryService | undefined,
|
|
112
|
-
properties: {
|
|
113
|
-
ulid: string;
|
|
114
|
-
apiProvider?: string;
|
|
115
|
-
openAiCompatibleDomain?: string;
|
|
116
|
-
},
|
|
117
|
-
): void {
|
|
118
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.CREATED, properties);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export function captureTaskRestarted(
|
|
122
|
-
telemetry: ITelemetryService | undefined,
|
|
123
|
-
properties: {
|
|
124
|
-
ulid: string;
|
|
125
|
-
apiProvider?: string;
|
|
126
|
-
openAiCompatibleDomain?: string;
|
|
127
|
-
},
|
|
128
|
-
): void {
|
|
129
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.RESTARTED, properties);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export function captureTaskCompleted(
|
|
133
|
-
telemetry: ITelemetryService | undefined,
|
|
134
|
-
properties: {
|
|
135
|
-
ulid: string;
|
|
136
|
-
provider?: string;
|
|
137
|
-
modelId?: string;
|
|
138
|
-
mode?: string;
|
|
139
|
-
durationMs?: number;
|
|
140
|
-
},
|
|
141
|
-
): void {
|
|
142
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.COMPLETED, properties);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export function captureConversationTurnEvent(
|
|
146
|
-
telemetry: ITelemetryService | undefined,
|
|
147
|
-
properties: {
|
|
148
|
-
ulid: string;
|
|
149
|
-
provider?: string;
|
|
150
|
-
model?: string;
|
|
151
|
-
source: "user" | "assistant";
|
|
152
|
-
mode?: string;
|
|
153
|
-
tokensIn?: number;
|
|
154
|
-
tokensOut?: number;
|
|
155
|
-
cacheWriteTokens?: number;
|
|
156
|
-
cacheReadTokens?: number;
|
|
157
|
-
totalCost?: number;
|
|
158
|
-
isNativeToolCall?: boolean;
|
|
159
|
-
},
|
|
160
|
-
): void {
|
|
161
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.CONVERSATION_TURN, {
|
|
162
|
-
...properties,
|
|
163
|
-
timestamp: new Date().toISOString(),
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export function captureTokenUsage(
|
|
168
|
-
telemetry: ITelemetryService | undefined,
|
|
169
|
-
properties: {
|
|
170
|
-
ulid: string;
|
|
171
|
-
tokensIn: number;
|
|
172
|
-
tokensOut: number;
|
|
173
|
-
model: string;
|
|
174
|
-
},
|
|
175
|
-
): void {
|
|
176
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.TOKEN_USAGE, properties);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export function captureModeSwitch(
|
|
180
|
-
telemetry: ITelemetryService | undefined,
|
|
181
|
-
ulid: string,
|
|
182
|
-
mode?: string,
|
|
183
|
-
): void {
|
|
184
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.MODE_SWITCH, { ulid, mode });
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export function captureToolUsage(
|
|
188
|
-
telemetry: ITelemetryService | undefined,
|
|
189
|
-
properties: {
|
|
190
|
-
ulid: string;
|
|
191
|
-
tool: string;
|
|
192
|
-
modelId?: string;
|
|
193
|
-
provider?: string;
|
|
194
|
-
autoApproved?: boolean;
|
|
195
|
-
success: boolean;
|
|
196
|
-
isNativeToolCall?: boolean;
|
|
197
|
-
},
|
|
198
|
-
): void {
|
|
199
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.TOOL_USED, properties);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export function captureSkillUsed(
|
|
203
|
-
telemetry: ITelemetryService | undefined,
|
|
204
|
-
properties: {
|
|
205
|
-
ulid: string;
|
|
206
|
-
skillName: string;
|
|
207
|
-
skillSource: "global" | "project";
|
|
208
|
-
skillsAvailableGlobal: number;
|
|
209
|
-
skillsAvailableProject: number;
|
|
210
|
-
provider?: string;
|
|
211
|
-
modelId?: string;
|
|
212
|
-
},
|
|
213
|
-
): void {
|
|
214
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.SKILL_USED, properties);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export function captureDiffEditFailure(
|
|
218
|
-
telemetry: ITelemetryService | undefined,
|
|
219
|
-
properties: {
|
|
220
|
-
ulid: string;
|
|
221
|
-
modelId?: string;
|
|
222
|
-
provider?: string;
|
|
223
|
-
errorType?: string;
|
|
224
|
-
isNativeToolCall?: boolean;
|
|
225
|
-
},
|
|
226
|
-
): void {
|
|
227
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.DIFF_EDIT_FAILED, properties);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export function captureProviderApiError(
|
|
231
|
-
telemetry: ITelemetryService | undefined,
|
|
232
|
-
properties: {
|
|
233
|
-
ulid: string;
|
|
234
|
-
model: string;
|
|
235
|
-
errorMessage: string;
|
|
236
|
-
provider?: string;
|
|
237
|
-
errorStatus?: number;
|
|
238
|
-
requestId?: string;
|
|
239
|
-
isNativeToolCall?: boolean;
|
|
240
|
-
},
|
|
241
|
-
): void {
|
|
242
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.PROVIDER_API_ERROR, {
|
|
243
|
-
...properties,
|
|
244
|
-
errorMessage: truncateErrorMessage(properties.errorMessage) ?? "unknown",
|
|
245
|
-
timestamp: new Date().toISOString(),
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export function captureMentionUsed(
|
|
250
|
-
telemetry: ITelemetryService | undefined,
|
|
251
|
-
mentionType:
|
|
252
|
-
| "file"
|
|
253
|
-
| "folder"
|
|
254
|
-
| "url"
|
|
255
|
-
| "problems"
|
|
256
|
-
| "terminal"
|
|
257
|
-
| "git-changes"
|
|
258
|
-
| "commit",
|
|
259
|
-
contentLength?: number,
|
|
260
|
-
): void {
|
|
261
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.MENTION_USED, {
|
|
262
|
-
mentionType,
|
|
263
|
-
contentLength,
|
|
264
|
-
timestamp: new Date().toISOString(),
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export function captureMentionFailed(
|
|
269
|
-
telemetry: ITelemetryService | undefined,
|
|
270
|
-
mentionType:
|
|
271
|
-
| "file"
|
|
272
|
-
| "folder"
|
|
273
|
-
| "url"
|
|
274
|
-
| "problems"
|
|
275
|
-
| "terminal"
|
|
276
|
-
| "git-changes"
|
|
277
|
-
| "commit",
|
|
278
|
-
errorType:
|
|
279
|
-
| "not_found"
|
|
280
|
-
| "permission_denied"
|
|
281
|
-
| "network_error"
|
|
282
|
-
| "parse_error"
|
|
283
|
-
| "unknown",
|
|
284
|
-
errorMessage?: string,
|
|
285
|
-
): void {
|
|
286
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.MENTION_FAILED, {
|
|
287
|
-
mentionType,
|
|
288
|
-
errorType,
|
|
289
|
-
errorMessage: truncateErrorMessage(errorMessage),
|
|
290
|
-
timestamp: new Date().toISOString(),
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
export function captureMentionSearchResults(
|
|
295
|
-
telemetry: ITelemetryService | undefined,
|
|
296
|
-
query: string,
|
|
297
|
-
resultCount: number,
|
|
298
|
-
searchType: "file" | "folder" | "all",
|
|
299
|
-
isEmpty: boolean,
|
|
300
|
-
): void {
|
|
301
|
-
emit(telemetry, LegacyTelemetryEvents.TASK.MENTION_SEARCH_RESULTS, {
|
|
302
|
-
queryLength: query.length,
|
|
303
|
-
resultCount,
|
|
304
|
-
searchType,
|
|
305
|
-
isEmpty,
|
|
306
|
-
timestamp: new Date().toISOString(),
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export function captureSubagentExecution(
|
|
311
|
-
telemetry: ITelemetryService | undefined,
|
|
312
|
-
properties: {
|
|
313
|
-
ulid: string;
|
|
314
|
-
durationMs: number;
|
|
315
|
-
outputLines: number;
|
|
316
|
-
success: boolean;
|
|
317
|
-
},
|
|
318
|
-
): void {
|
|
319
|
-
emit(
|
|
320
|
-
telemetry,
|
|
321
|
-
properties.success
|
|
322
|
-
? LegacyTelemetryEvents.TASK.SUBAGENT_COMPLETED
|
|
323
|
-
: LegacyTelemetryEvents.TASK.SUBAGENT_STARTED,
|
|
324
|
-
{
|
|
325
|
-
...properties,
|
|
326
|
-
timestamp: new Date().toISOString(),
|
|
327
|
-
},
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
export function captureHookDiscovery(
|
|
332
|
-
telemetry: ITelemetryService | undefined,
|
|
333
|
-
hookName: string,
|
|
334
|
-
globalCount: number,
|
|
335
|
-
workspaceCount: number,
|
|
336
|
-
): void {
|
|
337
|
-
emit(telemetry, LegacyTelemetryEvents.HOOKS.DISCOVERY_COMPLETED, {
|
|
338
|
-
hookName,
|
|
339
|
-
globalCount,
|
|
340
|
-
workspaceCount,
|
|
341
|
-
totalCount: globalCount + workspaceCount,
|
|
342
|
-
timestamp: new Date().toISOString(),
|
|
343
|
-
});
|
|
344
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
ITelemetryAdapter,
|
|
3
|
-
TelemetryArray,
|
|
4
|
-
TelemetryMetadata,
|
|
5
|
-
TelemetryObject,
|
|
6
|
-
TelemetryPrimitive,
|
|
7
|
-
TelemetryProperties,
|
|
8
|
-
TelemetryValue,
|
|
9
|
-
} from "./ITelemetryAdapter";
|
|
10
|
-
export {
|
|
11
|
-
OpenTelemetryAdapter,
|
|
12
|
-
type OpenTelemetryAdapterOptions,
|
|
13
|
-
} from "./OpenTelemetryAdapter";
|
|
14
|
-
export {
|
|
15
|
-
type CreateOpenTelemetryTelemetryServiceOptions,
|
|
16
|
-
createConfiguredTelemetryService,
|
|
17
|
-
createOpenTelemetryTelemetryService,
|
|
18
|
-
OpenTelemetryProvider,
|
|
19
|
-
type OpenTelemetryProviderOptions,
|
|
20
|
-
} from "./OpenTelemetryProvider";
|
package/src/tools/constants.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constants for Default Tools
|
|
3
|
-
*
|
|
4
|
-
* Tool name constants and utility arrays.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { DefaultToolName } from "./types.js";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Constants for default tool names
|
|
11
|
-
*/
|
|
12
|
-
export const DefaultToolNames = {
|
|
13
|
-
READ_FILES: "read_files",
|
|
14
|
-
SEARCH_CODEBASE: "search_codebase",
|
|
15
|
-
RUN_COMMANDS: "run_commands",
|
|
16
|
-
FETCH_WEB_CONTENT: "fetch_web_content",
|
|
17
|
-
APPLY_PATCH: "apply_patch",
|
|
18
|
-
EDITOR: "editor",
|
|
19
|
-
SKILLS: "skills",
|
|
20
|
-
ASK: "ask_question",
|
|
21
|
-
} as const;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Array of all default tool names
|
|
25
|
-
*/
|
|
26
|
-
export const ALL_DEFAULT_TOOL_NAMES: DefaultToolName[] = [
|
|
27
|
-
DefaultToolNames.READ_FILES,
|
|
28
|
-
DefaultToolNames.SEARCH_CODEBASE,
|
|
29
|
-
DefaultToolNames.RUN_COMMANDS,
|
|
30
|
-
DefaultToolNames.FETCH_WEB_CONTENT,
|
|
31
|
-
DefaultToolNames.APPLY_PATCH,
|
|
32
|
-
DefaultToolNames.EDITOR,
|
|
33
|
-
DefaultToolNames.SKILLS,
|
|
34
|
-
DefaultToolNames.ASK,
|
|
35
|
-
];
|