Documentation
¶
Overview ¶
Package web implements the jcode web server and API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SSEBroker ¶
type SSEBroker struct {
// contains filtered or unexported fields
}
SSEBroker manages multiple SSE client connections and broadcasts events.
func (*SSEBroker) ClientCount ¶
ClientCount returns the number of connected clients.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the jcode web server.
func (*Server) Handler ¶
func (s *Server) Handler() *handler.WebHandler
Handler returns the underlying WebHandler for external wiring (e.g. approval routing).
func (*Server) SubmitMessage ¶ added in v0.1.1
SubmitMessage submits a message for agent processing from an external source (e.g. WeChat inbound message). Returns false if the agent is busy.
type ServerConfig ¶
type ServerConfig struct {
Port int
Host string
Pwd string
Agent *adk.ChatModelAgent
CreateAgent func(providerName, modelName string) (*adk.ChatModelAgent, error)
SwitchProject func(newPwd string) (*adk.ChatModelAgent, *session.Recorder, error)
TodoStore *tools.TodoStore
Recorder *session.Recorder
Tracer *telemetry.LangfuseTracer
Env *tools.Env
ProviderName string
ModelName string
Config *config.Config
Registry *model.ModelRegistry
ApprovalState *runner.ApprovalState
SkillLoader *skills.Loader
WechatClient channel.Channel // optional WeChat channel
WebHandler *handler.WebHandler // optional: pre-created handler for sharing with tools
EventHandler handler.AgentEventHandler // optional: handler for runner (e.g. NotifyingHandler)
}
ServerConfig holds the configuration for creating a new Server.
type WSBroker ¶
type WSBroker struct {
// contains filtered or unexported fields
}
WSBroker manages WebSocket client connections and broadcasts events.
func (*WSBroker) ClientCount ¶
ClientCount returns the number of connected clients.
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
WSClient represents a connected WebSocket client.
type WSIncoming ¶
type WSIncoming struct {
Type string `json:"type"`
Data json.RawMessage `json:"data,omitempty"`
}
WSIncoming represents a message from the client over WebSocket.