Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
57 lines
1.2 KiB
Go
57 lines
1.2 KiB
Go
package reporter
|
|
|
|
import "context"
|
|
|
|
// DebugReporter publishes final analytics payloads only to the debug sink.
|
|
type DebugReporter struct {
|
|
common reporterCommon
|
|
debug DebugPublisher
|
|
}
|
|
|
|
func newDebugReporter(config Config) (*DebugReporter, error) {
|
|
common, err := newReporterCommon(config)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &DebugReporter{
|
|
common: common,
|
|
debug: config.DebugPublisher,
|
|
}, nil
|
|
}
|
|
|
|
func (r *DebugReporter) Track(ctx context.Context, events ...Event) {
|
|
if r.debug == nil || len(events) == 0 {
|
|
return
|
|
}
|
|
|
|
common, _ := r.common.snapshot()
|
|
header := r.common.teaHeader()
|
|
normalized := normalizeEvents(events, common, header)
|
|
if len(normalized) == 0 {
|
|
return
|
|
}
|
|
debugEvents := make([]DebugEvent, 0, len(normalized))
|
|
for _, event := range normalized {
|
|
params := copyParams(event.Params)
|
|
if params == nil {
|
|
params = map[string]any{}
|
|
}
|
|
for key, value := range common {
|
|
params[key] = value
|
|
}
|
|
for key, value := range header.presetParams() {
|
|
params[key] = value
|
|
}
|
|
debugEvents = append(debugEvents, DebugEvent{
|
|
Name: event.Name,
|
|
ClientTS: event.ClientTS,
|
|
Params: params,
|
|
})
|
|
}
|
|
r.debug.PublishAnalyticsDebugEvents(ctx, debugEvents)
|
|
}
|
|
|
|
func (*DebugReporter) Close() error {
|
|
return nil
|
|
}
|