- Go 1.26
helmfor the chart checks- Optional:
golangci-lint,gofumpt,pre-commit
go build ./...
make test # what CI runs: go test ./... (race detector when cgo is available)
make lint # golangci-lint with gosec + goconst
helm lint helm/klaus-gateway
helm template t helm/klaus-gateway
pre-commit run --all-files # includes the values-schema and helm-docs regeneration checksCI additionally installs the chart on a kind cluster through app-test-suite (tests/).
# Slack channel adapter (enabled by --slack-enabled)
POST /channels/slack/events Events API webhook endpoint
POST /channels/slack/interactions block actions, view submissions, shortcuts
POST /channels/slack/commands slash commands
# Slack OBO account linking (enabled by --obo-enabled)
GET /auth/slack/link
GET /auth/slack/callback
GET /auth/slack/client.json the CIMD document the OAuth client_id points at
GET /auth/slack/return muster's browser return after a URL elicitation (?prompt=<key>[&elicitationId=|&server=])
# Team reviews (enabled by --reviews-enabled)
POST /reviews
POST /reviews/{id}/results
POST /notices
# Admin (default :8081)
GET /healthz
GET /readyz
GET /metrics
See docs/api.md for the team-review and admin surfaces, and docs/channels-slack.md for the Slack one.
main.go entrypoint; wires the store, the kagent client, the Slack adapter, the server
pkg/channels/ Gateway interface (turns, resumes, sessions, thread records) + its Facade
pkg/channels/slack/ Slack channel adapter (/channels/slack/*)
pkg/routing/store/ Store interface + memory / bolt / valkey backends (thread state, team reviews)
pkg/auth/musterlink/ Slack OBO: muster account linking + the link Store (memory, bolt file, Kubernetes Secret)
pkg/auth/satoken/ TokenReview verifier of the team-review endpoint
pkg/reviews/ the team-review endpoint
pkg/muster/ muster tool client used by an approved review
pkg/server/ http.Server wiring, middleware, admin mux
pkg/a2a/ kagent API v2 client (A2A v1 gRPC, Agents, Sessions, HITL)
pkg/kagent/gen/ generated kagent.api.v1alpha1 stubs (`make generate-kagent`)
pkg/observability/ OTel traces + Prometheus metrics
internal/config/ env-var + flag config (KLAUS_GATEWAY_* prefix)
internal/version/ ldflags-injected version metadata
Slack is the only channel. A second one would follow the Slack adapter:
- Create
pkg/channels/<name>/with an adapter that has, likepkg/channels/slack:Start(ctx, gw channels.Gateway) error— keep thechannels.Gatewayfacade.Stop(ctx) error— clean up background goroutines.Mount(r chi.Router)— register HTTP routes. Its channel name (ChannelName) is the store key'sChannelfield.
- Normalise inbound events into
channels.InboundMessage{Channel: ChannelName, AgentRef: ..., ...}. - Call
gw.SendCompletion(ctx, msg)and render the deltas. - Wire the adapter in
main.gobehind a config flag (follow thecfg.Slack.Enabledpattern): start it, mount it, and stop it next to the Slack adapter once the servers drain (stopSlack). SetInboundMessage.BearerTokento the caller's token: the kagent client refuses a call without one (pkga2a.ErrNoIdentity). - Add a
KLAUS_GATEWAY_<NAME>_ENABLEDenv var ininternal/config/config.go. - Add channel-specific docs in
docs/channels-<name>.md.