遥测清理 (4个源文件): - config.ts: isAnalyticsDisabled() 永久返回 true - init.ts: GrowthBook/1P Event Logging/Telemetry 初始化已禁用 - main.tsx: Analytics gate 初始化已禁用 - sinks.ts: Analytics sink 已禁用 文档: - README.md 重写为 CC_Pure 纯净留影版本说明 - docs/telemetry-cleanup-audit.md 遥测审计报告 所有遥测入口已从源码级永久禁用,标注 CC_Pure 注释。
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
/**
|
||
* Shared analytics configuration
|
||
*
|
||
* Common logic for determining when analytics should be disabled
|
||
* across all analytics systems (Datadog, 1P)
|
||
*/
|
||
|
||
import { isEnvTruthy } from '../../utils/envUtils.js'
|
||
import { isTelemetryDisabled } from '../../utils/privacyLevel.js'
|
||
|
||
/**
|
||
* Check if analytics operations should be disabled
|
||
*
|
||
* Analytics is disabled in the following cases:
|
||
* - Test environment (NODE_ENV === 'test')
|
||
* - Third-party cloud providers (Bedrock/Vertex)
|
||
* - Privacy level is no-telemetry or essential-traffic
|
||
*/
|
||
export function isAnalyticsDisabled(): boolean {
|
||
// CC_Pure: 永久禁用所有遥测上报(Anthropic 数据收集已完全移除)
|
||
return true;
|
||
}
|
||
|
||
/**
|
||
* Check if the feedback survey should be suppressed.
|
||
*
|
||
* Unlike isAnalyticsDisabled(), this does NOT block on 3P providers
|
||
* (Bedrock/Vertex/Foundry). The survey is a local UI prompt with no
|
||
* transcript data — enterprise customers capture responses via OTEL.
|
||
*/
|
||
export function isFeedbackSurveyDisabled(): boolean {
|
||
return process.env.NODE_ENV === 'test' || isTelemetryDisabled()
|
||
}
|