all.go

 1package event
 2
 3import (
 4	"time"
 5)
 6
 7var appStartTime time.Time
 8
 9func AppInitialized() {
10	appStartTime = time.Now()
11	send("app initialized")
12}
13
14func AppExited() {
15	duration := time.Since(appStartTime).Truncate(time.Second)
16	send(
17		"app exited",
18		"app duration pretty", duration.String(),
19		"app duration in seconds", int64(duration.Seconds()),
20	)
21	Flush()
22}
23
24func SessionCreated() {
25	send("session created")
26}
27
28func SessionDeleted() {
29	send("session deleted")
30}
31
32func SessionSwitched() {
33	send("session switched")
34}
35
36func FilePickerOpened() {
37	send("filepicker opened")
38}
39
40func PromptSent(props ...any) {
41	send(
42		"prompt sent",
43		props...,
44	)
45}
46
47func TokensUsed(props ...any) {
48	send(
49		"tokens used",
50		props...,
51	)
52}