style: fix golangci-lint issues (whitespace, gofumpt, gci, golines)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5d376ce71b
commit
0db2afef68
3 changed files with 24 additions and 6 deletions
|
|
@ -230,9 +230,17 @@ func (h *Handler) apiEvents(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
// Send initial state immediately
|
||||
sendSSEIfChanged(w, flusher, "plan", h.provider.GetPlanInfo(), &lastPlan)
|
||||
sendSSEIfChanged(w, flusher, "session",
|
||||
map[string]any{"stats": h.provider.GetSessionStats(), "sessions": h.provider.GetActiveSessions(), "graph": h.provider.GetSessionGraph()},
|
||||
&lastSession)
|
||||
sendSSEIfChanged(
|
||||
w,
|
||||
flusher,
|
||||
"session",
|
||||
map[string]any{
|
||||
"stats": h.provider.GetSessionStats(),
|
||||
"sessions": h.provider.GetActiveSessions(),
|
||||
"graph": h.provider.GetSessionGraph(),
|
||||
},
|
||||
&lastSession,
|
||||
)
|
||||
sendSSEIfChanged(w, flusher, "skills", h.provider.ListSkills(), &lastSkills)
|
||||
sendSSEIfChanged(w, flusher, "dev", h.devStatus(), &lastDev)
|
||||
sendSSEIfChanged(w, flusher, "context", h.provider.GetContextInfo(), &lastContext)
|
||||
|
|
@ -246,9 +254,17 @@ func (h *Handler) apiEvents(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
case <-ch:
|
||||
sendSSEIfChanged(w, flusher, "plan", h.provider.GetPlanInfo(), &lastPlan)
|
||||
sendSSEIfChanged(w, flusher, "session",
|
||||
map[string]any{"stats": h.provider.GetSessionStats(), "sessions": h.provider.GetActiveSessions(), "graph": h.provider.GetSessionGraph()},
|
||||
&lastSession)
|
||||
sendSSEIfChanged(
|
||||
w,
|
||||
flusher,
|
||||
"session",
|
||||
map[string]any{
|
||||
"stats": h.provider.GetSessionStats(),
|
||||
"sessions": h.provider.GetActiveSessions(),
|
||||
"graph": h.provider.GetSessionGraph(),
|
||||
},
|
||||
&lastSession,
|
||||
)
|
||||
sendSSEIfChanged(w, flusher, "skills", h.provider.ListSkills(), &lastSkills)
|
||||
sendSSEIfChanged(w, flusher, "dev", h.devStatus(), &lastDev)
|
||||
sendSSEIfChanged(w, flusher, "context", h.provider.GetContextInfo(), &lastContext)
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@ func TestMiniApp_StaticFileServerServesAssets(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSSE_AuthRequired(t *testing.T) {
|
||||
notifier := NewStateNotifier()
|
||||
h := NewHandler(&mockDataProvider{}, &mockSender{}, testBotToken, notifier, nil, "")
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"github.com/anthropics/anthropic-sdk-go"
|
||||
anthropicoption "github.com/anthropics/anthropic-sdk-go/option"
|
||||
|
||||
"github.com/sipeed/picoclaw/pkg/providers/protocoltypes"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue