inital commit

This commit is contained in:
KingKDot
2026-03-05 00:04:26 -06:00
commit f8515a2883
269 changed files with 47081 additions and 0 deletions
@@ -0,0 +1,25 @@
package handlers
import (
"context"
"log"
"overlord-client/cmd/agent/runtime"
"overlord-client/cmd/agent/wire"
"time"
)
func HandlePing(ctx context.Context, env *runtime.Env, envelope map[string]interface{}) error {
ts := extractTimestamp(envelope["ts"])
if ts == 0 {
ts = time.Now().UnixMilli()
}
log.Printf("ping: received ts=%d, sending pong", ts)
pong := wire.Pong{Type: "pong", TS: ts}
if err := wire.WriteMsg(ctx, env.Conn, pong); err != nil {
log.Printf("ping: failed to send pong: %v", err)
return err
}
log.Printf("ping: pong sent successfully")
return nil
}