mirror of
https://github.com/cline/cline.git
synced 2026-10-29 17:42:34 +08:00
* feat: Modular telemetry architecture with Jitsu provider support - Add dual-provider telemetry architecture supporting both Jitsu and PostHog - Implement JitsuTelemetryProvider with full API compatibility - Add required telemetry bypass for critical system health events - Create modular event handler base class for future extensibility - Add Jitsu configuration with environment variable controls - Update TelemetryService to support multiple providers with error isolation - Add .env.example template for development setup - Maintain backward compatibility with existing PostHog integration - Enable easy PostHog removal via POSTHOG_TELEMETRY_ENABLED=false - Install dotenv for local development environment support Key benefits: - Dual tracking during transition period - Error isolation between providers - Memory efficient static method architecture - Easy provider enable/disable via environment variables - Wednesday deployment ready for Jitsu migration * fix(build): Load environment variables from .env file during development builds - Add dotenv.config() to esbuild.mjs to load .env variables - Include all telemetry-related environment variables in build injection: - TELEMETRY_SERVICE_API_KEY (PostHog) - ERROR_SERVICE_API_KEY (PostHog error tracking) - JITSU_WRITE_KEY (Jitsu telemetry) - JITSU_HOST (Jitsu host URL) - JITSU_ENABLED (Jitsu provider control) - POSTHOG_TELEMETRY_ENABLED (PostHog provider control) This ensures telemetry services work correctly in development builds by properly injecting API keys and configuration from .env file. Also updates TelemetryService tests to support multi-provider architecture. * fix(telemetry): Replace Record<string, unknown> with proper JSON-serializable types - Add TelemetryPrimitive, TelemetryValue, TelemetryObject, and TelemetryProperties types to ITelemetryProvider - Update JitsuTelemetryProvider to use TelemetryProperties instead of Record<string, unknown> - Update PostHogTelemetryProvider to use TelemetryProperties instead of Record<string, unknown> - Update TelemetryService to use TelemetryProperties for type-safe telemetry data - Ensures all telemetry properties are JSON-serializable, preventing runtime errors - Fixes TypeScript compatibility issue between Jitsu's JSONObject type and Record<string, unknown> * moved and organized the telemetry files and updated the example env file to be more descriptive * refactor: remove Jitsu telemetry provider - Remove Jitsu provider implementation and config files - Remove Jitsu environment variables from .env.example - Remove Jitsu build configuration from esbuild.mjs - Update TelemetryProviderFactory to only support PostHog - Uninstall @jitsu/js dependency - Add .env to .gitignore to prevent committing local env files * chore: add changeset for Jitsu removal * removed jitsu * fix: update import paths after PostHogClientProvider relocation * fix: remove race condition in captureToProviders and reorganize PostHog providers - Changed captureToProviders from async to synchronous method - Removed unnecessary Promise.allSettled overhead since provider.log() and provider.logRequired() are synchronous - Changed from .map() to .forEach() for better clarity - Moved PostHog provider files into posthog/ subdirectory for better organization - Updated all import paths to reflect new folder structure * refactor(telemetry): remove unnecessary addProperties method and improve type safety - Remove addProperties helper method that used 'any' types - Replace with inline typed spread operations in capture(), captureRequired(), and identifyAccount() - Fix type errors in captureConversationTurnEvent and captureBrowserError - All telemetry properties now properly typed as TelemetryProperties - Ensures OpenTelemetry compatibility through type system enforcement * refactor: remove dotenv dependency and use launch.json envFile - Remove dotenv import and config() call from esbuild.mjs - Add envFile parameter to all launch.json configurations to load .env - Remove dotenv from package.json devDependencies Environment variables are now loaded via VSCode's envFile feature for local development, while CI/production continues to inject via GitHub Actions. This provides cleaner separation between build-time and runtime environment handling. * feat(telemetry): add browser telemetry properties and improve typing - Add remoteBrowserHost and endpoint fields to browser telemetry events - Replace generic Record<string, unknown> with TelemetryObject type in EventHandlerBase for better type safety - Import TelemetryObject type from ITelemetryProvider These changes enhance browser telemetry tracking capabilities and improve type consistency across the telemetry service.
171 lines
4.4 KiB
JSON
171 lines
4.4 KiB
JSON
// A launch configuration that compiles the extension and then opens it inside a new window
|
|
// Use IntelliSense to learn about possible attributes.
|
|
// Hover to view descriptions of existing attributes.
|
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
{
|
|
"version": "0.2.0",
|
|
"configurations": [
|
|
{
|
|
"name": "Run Extension (production)",
|
|
"type": "extensionHost",
|
|
"request": "launch",
|
|
"args": [
|
|
"--extensionDevelopmentPath=${workspaceFolder}",
|
|
"--disable-workspace-trust",
|
|
"--disable-extensions", // Avoid conflicts with installed extensions
|
|
"${workspaceFolder}"
|
|
],
|
|
"outFiles": [
|
|
"${workspaceFolder}/dist/**/*.js"
|
|
],
|
|
"preLaunchTask": "${defaultBuildTask}",
|
|
"envFile": "${workspaceFolder}/.env",
|
|
"env": {
|
|
"IS_DEV": "true",
|
|
"DEV_WORKSPACE_FOLDER": "${workspaceFolder}",
|
|
"CLINE_ENVIRONMENT": "production"
|
|
}
|
|
},
|
|
{
|
|
"name": "Run Extension (staging)",
|
|
"type": "extensionHost",
|
|
"request": "launch",
|
|
"args": [
|
|
"--extensionDevelopmentPath=${workspaceFolder}",
|
|
"--disable-workspace-trust",
|
|
"--disable-extensions", // Avoid conflicts with installed extensions
|
|
"${workspaceFolder}"
|
|
],
|
|
"outFiles": [
|
|
"${workspaceFolder}/dist/**/*.js"
|
|
],
|
|
"preLaunchTask": "${defaultBuildTask}",
|
|
"envFile": "${workspaceFolder}/.env",
|
|
"env": {
|
|
"IS_DEV": "true",
|
|
"DEV_WORKSPACE_FOLDER": "${workspaceFolder}",
|
|
"CLINE_ENVIRONMENT": "staging"
|
|
}
|
|
},
|
|
{
|
|
"name": "Run Extension (local)",
|
|
"type": "extensionHost",
|
|
"request": "launch",
|
|
"args": [
|
|
"--extensionDevelopmentPath=${workspaceFolder}",
|
|
"--disable-workspace-trust",
|
|
"--disable-extensions", // Avoid conflicts with installed extensions
|
|
"${workspaceFolder}"
|
|
],
|
|
"outFiles": [
|
|
"${workspaceFolder}/dist/**/*.js"
|
|
],
|
|
"preLaunchTask": "${defaultBuildTask}",
|
|
"envFile": "${workspaceFolder}/.env",
|
|
"env": {
|
|
"IS_DEV": "true",
|
|
"DEV_WORKSPACE_FOLDER": "${workspaceFolder}",
|
|
"CLINE_ENVIRONMENT": "local"
|
|
}
|
|
},
|
|
{
|
|
"name": "Run Extension (Fresh Install Mode)",
|
|
"type": "extensionHost",
|
|
"request": "launch",
|
|
"runtimeExecutable": "${execPath}",
|
|
"args": [
|
|
"--user-data-dir=${workspaceFolder}/dist/tmp/user",
|
|
"--profile-temp",
|
|
"--sync=off",
|
|
"--disable-extensions", // Avoid conflicts with installed extensions
|
|
"--extensionDevelopmentPath=${workspaceFolder}",
|
|
"${workspaceFolder}"
|
|
],
|
|
"outFiles": [
|
|
"${workspaceFolder}/dist/**/*.js"
|
|
],
|
|
"preLaunchTask": "clean-tmp-user",
|
|
"internalConsoleOptions": "openOnSessionStart",
|
|
"postDebugTask": "stop",
|
|
"envFile": "${workspaceFolder}/.env",
|
|
"env": {
|
|
"IS_DEV": "true",
|
|
"TEMP_PROFILE": "true",
|
|
"DEV_WORKSPACE_FOLDER": "${workspaceFolder}",
|
|
"CLINE_ENVIRONMENT": "production"
|
|
}
|
|
},
|
|
{
|
|
"type": "node",
|
|
"request": "launch",
|
|
"name": "Debug Test Standalone Core Api Server (test:sca-server)",
|
|
"skipFiles": [
|
|
"<node_internals>/**"
|
|
],
|
|
"sourceMaps": true,
|
|
"resolveSourceMapLocations": [
|
|
"${workspaceFolder}/**",
|
|
"!**/node_modules/**"
|
|
],
|
|
"cwd": "${workspaceFolder}",
|
|
"outFiles": [
|
|
"${workspaceFolder}/dist/**/*.js",
|
|
"${workspaceFolder}/dist-standalone/**/*.js"
|
|
],
|
|
"preLaunchTask": "compile-standalone",
|
|
"runtimeExecutable": "npx",
|
|
"runtimeArgs": [
|
|
"tsx"
|
|
],
|
|
"program": "scripts/test-standalone-core-api-server.ts",
|
|
"envFile": "${workspaceFolder}/.env",
|
|
"env": {
|
|
"PROTOBUS_PORT": "26040",
|
|
"HOSTBRIDGE_PORT": "26041",
|
|
"WORKSPACE_DIR": "${workspaceFolder}",
|
|
"E2E_TEST": "true",
|
|
"CLINE_ENVIRONMENT": "local"
|
|
},
|
|
"console": "integratedTerminal",
|
|
"internalConsoleOptions": "neverOpen"
|
|
},
|
|
{
|
|
"type": "node",
|
|
"request": "launch",
|
|
"name": "Debug Current Test File",
|
|
"skipFiles": [
|
|
"<node_internals>/**"
|
|
],
|
|
"sourceMaps": true,
|
|
"resolveSourceMapLocations": [
|
|
"${workspaceFolder}/**",
|
|
"!**/node_modules/**"
|
|
],
|
|
"cwd": "${workspaceFolder}",
|
|
"runtimeExecutable": "npx",
|
|
"runtimeArgs": [
|
|
"mocha"
|
|
],
|
|
"args": [
|
|
"--require",
|
|
"ts-node/register",
|
|
"--require",
|
|
"source-map-support/register",
|
|
"--require",
|
|
"./src/test/requires.ts",
|
|
"--exit",
|
|
"${file}"
|
|
],
|
|
"envFile": "${workspaceFolder}/.env",
|
|
"env": {
|
|
"TS_NODE_PROJECT": "./tsconfig.unit-test.json",
|
|
"NODE_ENV": "test",
|
|
"IS_DEV": "true",
|
|
"CLINE_ENVIRONMENT": "local"
|
|
},
|
|
"console": "integratedTerminal",
|
|
"internalConsoleOptions": "openOnSessionStart"
|
|
}
|
|
]
|
|
}
|