chat

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Overview

Package chat runs app-bound conversations in Airlock through the shared Sol runtime. Apps execute capabilities, never model prompt loops.

Index

Constants

This section is empty.

Variables

View Source
var ErrShuttingDown = errors.New("hosted chat is shutting down")

Functions

This section is empty.

Types

type Backend

type Backend interface {
	PrepareChat(context.Context, capabilities.Scope, wire.PromptInput) (chatruntime.Input, error)
	SettleChat(context.Context, *dbq.Queries, uuid.UUID, string) error
}

Backend supplies service-owned runtime operations. Start and the capability broker authorize callers before passing host-derived scope to these methods; SettleChat runs inside the lease owner's completion or recovery transaction.

type Service

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

func New

func New(database *db.DB, broker *capabilities.Service, backend Backend, executors container.JSExecutorManager, logger *zap.Logger) *Service

func (*Service) Recover

func (s *Service) Recover(ctx context.Context) error

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

Shutdown rejects admission, interrupts hosted chat, and waits for runtime, executor, lease-heartbeat and settlement work. It does not cancel durable jobs or persist user cancellation. Interrupted owners stop renewing their DB leases; Recover settles those leases after expiry. A deadline error means dependencies must remain open until Shutdown succeeds or the process exits.

func (*Service) Start

func (s *Service) Start(ctx context.Context, p authz.Principal, agentID uuid.UUID, input wire.PromptInput) (io.ReadCloser, uuid.UUID, error)

Jump to

Keyboard shortcuts

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