feat: Add cloud sync event emit (#212)

* feat: Add cloud sync event emit

* fix: Linter fixes

* fix: Include malysis metadata in confirmed event

* fix: Code review fixes

* fix: Emit session complet event

* fix: Code review fixes

* chore: Add comment

* chore: Add cloud info in setup info command

* fix: Proxy flow must call install started

* fix: Code review fixes

* fix: Code review fixes

* Update internal/audit/cloud_sink.go

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: Abhisek Datta <abhisek.datta@gmail.com>

* fix: Code review fixes

---------

Signed-off-by: Abhisek Datta <abhisek.datta@gmail.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Abhisek Datta
2026-04-11 12:33:27 +05:30
committed by GitHub
co-authored by devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 0355a5d4fd
commit e67735c1c3
20 changed files with 981 additions and 21 deletions
+40
View File
@@ -6,6 +6,43 @@ import (
packagev1 "buf.build/gen/go/safedep/api/protocolbuffers/go/safedep/messages/package/v1"
)
// SessionData carries aggregate session statistics for session-complete events.
type SessionData struct {
PackageManager string
FlowType FlowType
Outcome Outcome
TotalAnalyzed uint32
AllowedCount uint32
BlockedCount uint32
ConfirmedCount uint32
TrustedSkipped uint32
InsecureBypassed uint32
Duration time.Duration
SandboxEnabled bool
ParanoidMode bool
TransitiveEnabled bool
}
// FlowType identifies how PMG intercepted the package installation.
type FlowType string
const (
FlowTypeGuard FlowType = "guard"
FlowTypeProxy FlowType = "proxy"
)
// Outcome describes the final result of a PMG invocation.
type Outcome string
const (
OutcomeSuccess Outcome = "success"
OutcomeBlocked Outcome = "blocked"
OutcomeUserCancelled Outcome = "user_cancelled"
OutcomeDryRun Outcome = "dry_run"
OutcomeError Outcome = "error"
OutcomeInsecureBypass Outcome = "insecure_bypass"
)
type EventType string
const (
@@ -56,4 +93,7 @@ type AuditEvent struct {
// Error context
Error error
// Session summary data — populated only for EventTypeSessionComplete
SessionData *SessionData
}