web

package
v0.0.0-...-0f11aa8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMux

func NewMux(agentsDir string, agentName string, providerID string) *http.ServeMux

NewMux creates a new HTTP serve mux for the UI.

Types

type EngineFactory

type EngineFactory func(ctx context.Context, agentName string, providerID string, agentsFilePath string, hitl llm.HITLHandler, unsafeAllTools bool) (Streamer, *config.InstanceConfig, func(), error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

type Session

type Session struct {
	Engine  Streamer
	Cleanup func()
}

type Streamer

type Streamer interface {
	Stream(ctx context.Context, inputMessage llm.Message) (<-chan llm.Message, error)
}

Streamer interface abstracts the physical Engine for testing

type WebHITL

type WebHITL struct {
	// contains filtered or unexported fields
}

WebHITL implements a synchronous block for human in the loop interactions over HTTP. When ApproveTool is called by the LLM, the execution is blocked via a WaitGroup/Channel until a separate HTTP request `/api/chat/approve` signals the decision.

func NewWebHITL

func NewWebHITL() *WebHITL

func (*WebHITL) ApproveTool

func (w *WebHITL) ApproveTool(ctx context.Context, req llm.ToolRequestPart) (bool, error)

ApproveTool blocks until a decision is made via the API.

func (*WebHITL) Resolve

func (w *WebHITL) Resolve(callID string, approve bool) error

Resolve unblocks a pending tool request with the given decision.

type WebView

type WebView struct {
	// contains filtered or unexported fields
}

WebView implements the different UI Extension features.

func (*WebView) Flush

func (v *WebView) Flush()

func (*WebView) OnCommand

func (v *WebView) OnCommand(cmd string, args []string)

func (*WebView) PromptHITL

func (v *WebView) PromptHITL(req *llm.ToolRequestPart)

func (*WebView) RenderError

func (v *WebView) RenderError(err error)

func (*WebView) RenderTelemetry

func (v *WebView) RenderTelemetry(telemetry llm.TelemetryPart)

func (*WebView) RenderTextChunk

func (v *WebView) RenderTextChunk(chunk string)

func (*WebView) RenderThinkingChunk

func (v *WebView) RenderThinkingChunk(chunk string)

func (*WebView) RenderToolIntent

func (v *WebView) RenderToolIntent(toolName string, args any)

func (*WebView) RenderToolResult

func (v *WebView) RenderToolResult(toolName string, result any, isError bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL