Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
711cf1c
feat: rename image API routes and schemas from capture_session to tel…
archandatta May 14, 2026
d90bbff
feat: drop liveview and captcha event categories
archandatta May 14, 2026
3f42352
feat: introduce telemetry package, replacing capturesession
archandatta May 14, 2026
ccb50e6
feat: drop liveview and captcha from event category enums in openapi …
archandatta May 14, 2026
87efe18
feat: replace capture_session handlers with telemetry handlers, rewir…
archandatta May 14, 2026
ad68b4b
feat: update all tests for telemetry rename and delete capturesession…
archandatta May 14, 2026
e89a85f
feat: rename PublishEvent and StreamEvents to PublishTelemetryEvent a…
archandatta May 14, 2026
38f5aa1
fix: return 400 when starting telemetry with all categories disabled
archandatta May 14, 2026
e3642a2
review: address bot feedback
archandatta May 14, 2026
a7de080
review: rename telemetrySessionID, fix import order, patch merge sema…
archandatta May 14, 2026
c99f2b6
review: update oapi to match code
archandatta May 14, 2026
e3985a4
review: idempotent all-disabled PUT/PATCH, fix stop response config, …
archandatta May 14, 2026
3db3008
chore: simplify disabledConfig helper
archandatta May 14, 2026
9450ad1
feat: add session, target, and nav_seq context to network events
archandatta May 14, 2026
b0ee0ff
review: return disabled config on idempotent all-disabled PUT
archandatta May 14, 2026
489e25b
review: scrub lifecycle language from telemetry openapi and readme
archandatta May 14, 2026
3459f59
feat: add typed browser telemetry event schemas to openapi
archandatta May 15, 2026
0872666
refactor: use generated BrowserEventSource for internal event envelop…
archandatta May 15, 2026
f36fa76
refactor: use generated TelemetryEventCategory for internal event env…
archandatta May 15, 2026
bd86bf7
feat: add KnownBrowserTelemetryEvent union and construct payloads via…
archandatta May 15, 2026
11738c8
refactor: stable events.Console/Network/Page/Interaction/System categ…
archandatta May 15, 2026
7292759
docs: update cdpmonitor README for browser telemetry event taxonomy c…
archandatta May 15, 2026
5967aa5
fix: avoid nil-map panic in screenshot publish and drop unused navData
archandatta May 15, 2026
c1475ea
review: scrub lifecycle fields from TelemetryState schema
archandatta May 15, 2026
05d6f59
review: add optional applied_at to TelemetryState for observability
archandatta May 15, 2026
d6d80bb
review: snapshot network nav_seq, hoist BrowserTargetType, document p…
archandatta May 15, 2026
29277f1
review: fix test
archandatta May 15, 2026
381ffa4
review: clarify seq is process-monotonic and stream data references B…
archandatta May 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $(RECORDING_DIR):
# 3. go mod tidy to pull deps
oapi-generate:
pnpm i -g @apiture/openapi-down-convert
openapi-down-convert --input openapi.yaml --output openapi-3.0.yaml
openapi-down-convert --input openapi.yaml --output openapi-3.0.yaml --allOf
go tool oapi-codegen -config ./oapi-codegen.yaml ./openapi-3.0.yaml
@echo "Fixing oapi-codegen issue https://github.com/oapi-codegen/oapi-codegen/issues/1764..."
go run ./scripts/oapi/patch_sse_methods -file ./lib/oapi/oapi.go -expected-replacements 4
Expand Down
34 changes: 17 additions & 17 deletions server/cmd/api/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"sync"
"time"

"github.com/kernel/kernel-images/server/lib/capturesession"
"github.com/kernel/kernel-images/server/lib/cdpmonitor"
"github.com/kernel/kernel-images/server/lib/devtoolsproxy"
"github.com/kernel/kernel-images/server/lib/telemetry"
"github.com/kernel/kernel-images/server/lib/events"
"github.com/kernel/kernel-images/server/lib/logger"
"github.com/kernel/kernel-images/server/lib/nekoclient"
Expand Down Expand Up @@ -81,13 +81,13 @@ type ApiService struct {
// when multiple CDP fast-path resizes fire in quick succession.
xvfbResizeMu sync.Mutex

// CDP event pipeline and cdpMonitor.
eventStream *events.EventStream
captureSession *capturesession.CaptureSession
cdpMonitor cdpMonitorController
monitorMu sync.Mutex
lifecycleCtx context.Context
lifecycleCancel context.CancelFunc
// Telemetry event pipeline and CDP monitor.
eventStream *events.EventStream
telemetrySession *telemetry.TelemetrySession
cdpMonitor cdpMonitorController
monitorMu sync.Mutex
lifecycleCtx context.Context
lifecycleCancel context.CancelFunc
}

var _ oapi.StrictServerInterface = (*ApiService)(nil)
Expand All @@ -98,8 +98,8 @@ func New(
upstreamMgr *devtoolsproxy.UpstreamManager,
stz scaletozero.PinnedController,
nekoAuthClient *nekoclient.AuthClient,
captureSession *capturesession.CaptureSession,
eventStream *events.EventStream,
telemetrySession *telemetry.TelemetrySession,
eventStream *events.EventStream,
displayNum int,
) (*ApiService, error) {
switch {
Expand All @@ -111,18 +111,18 @@ func New(
return nil, fmt.Errorf("upstreamMgr cannot be nil")
case nekoAuthClient == nil:
return nil, fmt.Errorf("nekoAuthClient cannot be nil")
case captureSession == nil:
return nil, fmt.Errorf("captureSession cannot be nil")
case telemetrySession == nil:
return nil, fmt.Errorf("telemetrySession cannot be nil")
case eventStream == nil:
return nil, fmt.Errorf("eventStream cannot be nil")
}

mon := cdpmonitor.New(upstreamMgr, captureSession.Publish, displayNum, slog.Default())
mon := cdpmonitor.New(upstreamMgr, telemetrySession.Publish, displayNum, slog.Default())
ctx, cancel := context.WithCancel(context.Background())

return &ApiService{
recordManager: recordManager,
factory: factory,
recordManager: recordManager,
factory: factory,
defaultRecorderID: "default",
watches: make(map[string]*fsWatch),
procs: make(map[string]*processHandle),
Expand All @@ -131,7 +131,7 @@ func New(
nekoAuthClient: nekoAuthClient,
policy: &policy.Policy{},
eventStream: eventStream,
captureSession: captureSession,
telemetrySession: telemetrySession,
cdpMonitor: mon,
lifecycleCtx: ctx,
lifecycleCancel: cancel,
Expand Down Expand Up @@ -357,7 +357,7 @@ func (s *ApiService) Shutdown(ctx context.Context) error {
s.monitorMu.Lock()
s.lifecycleCancel()
s.cdpMonitor.Stop()
s.captureSession.Stop()
s.telemetrySession.Stop()
s.monitorMu.Unlock()
return s.recordManager.StopAll(ctx)
}
12 changes: 6 additions & 6 deletions server/cmd/api/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"log/slog"

"github.com/kernel/kernel-images/server/lib/capturesession"
"github.com/kernel/kernel-images/server/lib/devtoolsproxy"
"github.com/kernel/kernel-images/server/lib/telemetry"
"github.com/kernel/kernel-images/server/lib/events"
"github.com/kernel/kernel-images/server/lib/nekoclient"
oapi "github.com/kernel/kernel-images/server/lib/oapi"
Expand Down Expand Up @@ -305,20 +305,20 @@ func newMockNekoClient(t *testing.T) *nekoclient.AuthClient {
return client
}

func newCaptureSession(t *testing.T) (*capturesession.CaptureSession, *events.EventStream) {
func newTelemetrySession(t *testing.T) (*telemetry.TelemetrySession, *events.EventStream) {
t.Helper()
es, err := events.NewEventStream(events.EventStreamConfig{RingCapacity: 64})
if err != nil {
t.Fatal(err)
}
return capturesession.NewCaptureSession(es), es
return telemetry.NewTelemetrySession(es), es
}

// newSvc constructs an ApiService with a fresh capture session and event stream.
// newSvc constructs an ApiService with a fresh telemetry session and event stream.
func newSvc(t *testing.T, mgr recorder.RecordManager) (*ApiService, error) {
t.Helper()
cs, es := newCaptureSession(t)
return New(mgr, newMockFactory(), newTestUpstreamManager(), scaletozero.NewNoopController(), newMockNekoClient(t), cs, es, 0)
ts, es := newTelemetrySession(t)
return New(mgr, newMockFactory(), newTestUpstreamManager(), scaletozero.NewNoopController(), newMockNekoClient(t), ts, es, 0)
}

func TestApiService_PatchChromiumFlags(t *testing.T) {
Expand Down
147 changes: 0 additions & 147 deletions server/cmd/api/api/capture_session.go

This file was deleted.

Loading
Loading