Versions in this module Expand all Collapse all v0 v0.1.12 Nov 19, 2026 v0.1.11 Nov 19, 2026 v0.1.10 Nov 19, 2026 v0.1.9 Nov 18, 2026 v0.1.8 Nov 18, 2026 v0.1.7 Nov 18, 2026 v0.1.6 Nov 18, 2026 v0.1.5 Nov 18, 2026 v0.1.4 Nov 18, 2026 v0.1.3 Nov 18, 2026 v0.1.2 Nov 18, 2026 v0.1.1 Nov 18, 2026 Changes in this version + const AgentUploadsDir + const NoRoundID + const ReplayHeadroom + const RoundAbort + const RoundError + const RoundInput + const RoundOk + const RoundRefuse + const UserUploadsDir + var DiscardedArguments = json.RawMessage("!discarded-arguments") + var ErrAskInIsland = errors.New("an ask tool cannot be an island app function") + var ErrCanceledByUser = errors.New("canceled by user") + var ErrCompactionFailed = errors.New(...) + var ErrDisabled = errors.New("neui for this session is disabled") + var ErrDrift = errors.New("thread advanced") + var ErrExists = errors.New("id already taken") + var ErrInputTooLarge = errors.New(...) + var ErrInvalidName = errors.New("invalid file name") + var ErrMeasuredTooLarge = errors.New("provider refused a request measured as fitting") + var ErrNoProvider = errors.New("no provider: set WithProvider on the app or pass OptionProvider to Enable") + var ErrNotFound = errors.New("not found") + var ErrOutOfRange = errors.New("read offset past end of file") + var ErrQuota = errors.New("workspace quota exceeded; delete files no longer needed to free space") + var ErrReadOnly = errors.New(...) + var ErrReserved = errors.New(...) + var ErrTooLarge = errors.New("file too large") + var ErrTooMany = errors.New("too many files") + var ErrToolNotFound = errors.New("tool not found") + var ErrUnlinked = errors.New("instance was detached from the thread") + var ErrVirtual = errors.New(...) + var ErrWrongState = errors.New("thread is in the wrong state to perform this action") + var NoCompaction = Compaction + func Final(e ChatEvent) bool + type Chat interface + Update func(ctx context.Context, e ChatEvent) + type ChatAsk struct + Button gox.Elem + Cancel func(context.Context) + Error doors.Beam[string] + Form gox.Elem + type ChatEvent interface + type ChatEventAsk struct + Ask ChatAsk + type ChatEventAskDone struct + type ChatEventCompacting struct + CanCompact bool + Final bool + Running bool + Usage EventUsage + type ChatEventCriticalError struct + Err error + type ChatEventIndexed struct + Event IndexedEvent + type ChatEventInputPending struct + Pending bool + type ChatEventName struct + Name string + type ChatEventRoundEnd struct + CanCompact bool + Error string + Final bool + Round RoundID + State RoundState + Usage EventUsage + type ChatEventRoundStart struct + CanCompact bool + Round Round + Truncate RoundID + Usage EventUsage + type ChatEventRoundUsage struct + Round RoundID + Usage EventUsage + type ChatEventTasks struct + Tasks []Task + type ChatEventThreadCreated struct + type ChatEventToolResults struct + Final bool + Results map[string]ContentToolResult + Round RoundID + type ChatFactory interface + Chat func(thread ChatThread, state ChatState) Chat + Placeholder func(enabled doors.Beam[bool]) gox.Elem + type ChatInput struct + Pending bool + type ChatState struct + Ask *ChatAsk + CanCompact bool + Compaction bool + ID ThreadID + Input ChatInput + Meta any + Name string + Round *Round + Tasks []Task + Usage EventUsage + type ChatThread interface + Compact func(ctx context.Context) error + Config func() ThreadConfig + FS func() FS + Input func(ctx context.Context, input Input) error + Model func() Model + Reload func(ctx context.Context) + Retry func(ctx context.Context) error + Rewind func(ctx context.Context, round RoundID, input Input) error + RoundAfter func(ctx context.Context, start RoundID, limit int) ([]Round, error) + RoundBefore func(ctx context.Context, start RoundID, limit int) ([]Round, error) + Send func(ctx context.Context, input Input) error + Stop func(ctx context.Context) error + Unsend func(ctx context.Context) error + type Compaction struct + Base int + Output int + Tail RoundID + Target RoundID + Text string + func (c Compaction) IsValid() bool + type Container interface + Content func() UserContent + ContentType func() string + type Content interface + type ContentDocument struct + Data []byte + Meta json.RawMessage + Mime string + Name string + func (c ContentDocument) MarshalJSON() ([]byte, error) + type ContentImage struct + Data []byte + Meta json.RawMessage + Mime string + func (c ContentImage) MarshalJSON() ([]byte, error) + type ContentOpaque struct + Data json.RawMessage + Deltas []string + Kind string + Model string + func (c ContentOpaque) MarshalJSON() ([]byte, error) + type ContentReasoning struct + Meta json.RawMessage + Model string + Summary Indexed[string] + Thoughts Indexed[string] + func (c ContentReasoning) MarshalJSON() ([]byte, error) + type ContentText struct + Meta json.RawMessage + Text string + func (c ContentText) MarshalJSON() ([]byte, error) + type ContentToolResult struct + Content UserContents + Error ToolError + ID string + func NewContentToolResult(id string, content UserContents, err error) ContentToolResult + func (c ContentToolResult) MarshalJSON() ([]byte, error) + func (c ContentToolResult) Refused() ContentToolResult + type ContentToolUse struct + ID string + Input json.RawMessage + Meta json.RawMessage + Name string + func (c ContentToolUse) LostResult() ContentToolResult + func (c ContentToolUse) MarshalJSON() ([]byte, error) + type Contents []Content + func (cs *Contents) UnmarshalJSON(data []byte) error + type Cursor struct + Created time.Time + Round RoundID + Thread ThreadID + type DiscardedArgumentsError struct + Raw string + func (e DiscardedArgumentsError) Error() string + type Document struct + Data []byte + Mime DocumentMime + func (d Document) Content() UserContent + func (d Document) ContentType() string + type DocumentMime string + const DocumentCSV + const DocumentDOC + const DocumentDOCX + const DocumentHTML + const DocumentJSON + const DocumentMarkdown + const DocumentPDF + const DocumentPPTX + const DocumentRTF + const DocumentText + const DocumentXLS + const DocumentXLSX + const DocumentXML + const DocumentYAML + func (m DocumentMime) IsValid() bool + type ErrCode string + const CodeAccess + const CodeBusy + const CodeCapped + const CodeContextLength + const CodeInvalid + const CodeNetwork + const CodeRefused + const CodeTooLarge + const CodeUnknown + type Event interface + type EventClose struct + Index int + func (e EventClose) At() int + func (e EventClose) Offset(n int) IndexedEvent + type EventErr struct + Code ErrCode + Err error + type EventMeta struct + Data json.RawMessage + Index int + func (e EventMeta) At() int + func (e EventMeta) Offset(n int) IndexedEvent + type EventOk struct + Code OkCode + type EventOpaque struct + Data json.RawMessage + Delta string + Index int + Kind string + func (e EventOpaque) At() int + func (e EventOpaque) Offset(n int) IndexedEvent + type EventStart struct + ID string + Model string + type EventSummary struct + Index int + Part int + Text string + func (e EventSummary) At() int + func (e EventSummary) Offset(n int) IndexedEvent + type EventText struct + Index int + Text string + func (e EventText) At() int + func (e EventText) Offset(n int) IndexedEvent + type EventThinking struct + Index int + Part int + Text string + func (e EventThinking) At() int + func (e EventThinking) Offset(n int) IndexedEvent + type EventTool struct + Args string + ID string + Index int + Name string + func (e EventTool) At() int + func (e EventTool) Offset(n int) IndexedEvent + type EventUsage struct + CacheRead int + CacheWrite int + Input int + Output int + Reasoning int + func (u EventUsage) Total() int + type FS interface + Append func(name string) (io.WriteCloser, error) + Copy func(ctx context.Context, src, dst string) error + Create func(name string) (io.WriteCloser, error) + DeleteUpload func(ctx context.Context, name string) error + LocalPath func(ctx context.Context, name string) (string, error) + ReadAll func(ctx context.Context, name string) (io.ReadCloser, error) + ReadDir func(ctx context.Context, name string) ([]FSEntry, error) + ReadRange func(ctx context.Context, name string, off, n int64) (io.ReadCloser, error) + Remove func(ctx context.Context, name string) error + Rename func(oldname, newname string) error + Stat func(ctx context.Context, name string) (FSEntry, error) + TempDir func() (string, error) + UploadStat func(ctx context.Context, name string) (FSEntry, error) + UserUpload func(ctx context.Context, name string, r io.Reader) (FSEntry, error) + type FSEntry struct + Dir bool + MIME string + ModTime time.Time + Name string + Size int64 + Virtual bool + type File struct + CreatedAt time.Time + Draft bool + MIME string + Name string + Origin Origin + Size int64 + ThreadID ThreadID + type FilesConfig struct + DocumentLimit int + EditLimit int + ImageFileLimit int + MaxBytes int64 + MaxFiles int + ReadLimit int + TempDir string + UnzipFiles int + UnzipLimit int64 + type Hit struct + Created time.Time + Round RoundID + Snippet string + Thread ThreadID + type Image struct + Data []byte + Mime ImageMime + func (i Image) Content() UserContent + func (i Image) ContentType() string + type ImageMime string + const ImageGIF + const ImageJPEG + const ImagePNG + const ImageWEBP + func (m ImageMime) IsValid() bool + type Indexed map[int]T + func (i Indexed[T]) Iter() iter.Seq[T] + func (i Indexed[T]) Ordered() []T + type IndexedEvent interface + At func() int + Offset func(int) IndexedEvent + type Input struct + Attachments []string + Text string + func (in Input) Content() []Content + func (in Input) Len() int + type Instance interface + Chats func() doors.Beam[map[ThreadID]InstanceChat] + Emit func(ctx context.Context, name string, attrs map[string]string, data any) error + ID func() string + Location func() *time.Location + Render func(factory ChatFactory) gox.Elem + RoundSearch func(ctx context.Context, thread ThreadID, exclude bool, query string, from *Cursor, ...) ([]Hit, error) + State func() doors.Beam[InstanceState] + ThreadClone func(ctx context.Context, id ThreadID) (ThreadID, error) + ThreadDelete func(ctx context.Context, id ThreadID) error + ThreadGet func(ctx context.Context, id ThreadID) (Thread, error) + ThreadList func(ctx context.Context, from, to time.Time, asc bool, limit int, name string) ([]Thread, error) + ThreadNew func(ctx context.Context) error + ThreadOpen func(ctx context.Context, id ThreadID, meta any) error + ThreadRename func(ctx context.Context, id ThreadID, name string) error + type InstanceChat struct + InstanceID string + State InstanceState + type InstanceState struct + Status InstanceStatus + Thread InstanceThread + type InstanceStatus int + const InstanceDisabled + const InstanceEnabled + const InstanceLoading + type InstanceThread struct + ID ThreadID + Name string + New bool + Updated time.Time + type IslandConfig struct + FnMemory int + FnTime time.Duration + MaxCallDepth int + MaxItems int + MaxOps int + MaxQueue int + Memory int + TurnTime time.Duration + type Message struct + Content Contents + Role Role + type MessageStorage interface + CompactionCreate func(ctx context.Context, thread ThreadID, seq Seq, compaction Compaction) (Seq, error) + CompactionGet func(ctx context.Context, thread ThreadID, beforeTail RoundID) (Compaction, error) + RecordAdd func(ctx context.Context, thread ThreadID, seq Seq, origin RoundID, kind string, ...) (RecordID, Seq, error) + RecordList func(ctx context.Context, thread ThreadID) ([]Record, error) + RecordPin func(ctx context.Context, thread ThreadID, seq Seq, pin RoundID, records []RecordID) (Seq, error) + RoundAbort func(ctx context.Context, thread ThreadID, seq Seq, round RoundID, usage EventUsage, ...) (Seq, error) + RoundAfter func(ctx context.Context, thread ThreadID, start RoundID, limit int) ([]Round, error) + RoundBefore func(ctx context.Context, thread ThreadID, start RoundID, limit int) ([]Round, error) + RoundError func(ctx context.Context, thread ThreadID, seq Seq, round RoundID, err string, ...) (Seq, error) + RoundInput func(ctx context.Context, thread ThreadID, seq Seq, input Input) (RoundID, Seq, error) + RoundOk func(ctx context.Context, thread ThreadID, seq Seq, round RoundID, usage EventUsage, ...) (Seq, error) + RoundRange func(ctx context.Context, thread ThreadID, start RoundID, end RoundID) iter.Seq2[Round, error] + RoundRefuse func(ctx context.Context, thread ThreadID, seq Seq, round RoundID, usage EventUsage, ...) (Seq, error) + RoundResult func(ctx context.Context, thread ThreadID, seq Seq, round RoundID, ...) (Seq, error) + RoundSearch func(ctx context.Context, thread ThreadID, exclude bool, query string, from *Cursor, ...) ([]Hit, error) + ThreadBump func(ctx context.Context, thread ThreadID) (Thread, error) + ThreadClone func(ctx context.Context, source ThreadID, target ThreadID) (Thread, error) + ThreadCreate func(ctx context.Context, id ThreadID) (Thread, error) + ThreadCut func(ctx context.Context, id ThreadID, seq Seq, round RoundID) (Seq, error) + ThreadDelete func(ctx context.Context, id ThreadID) error + ThreadGet func(ctx context.Context, thread ThreadID) (Thread, error) + ThreadList func(ctx context.Context, from, to time.Time, asc bool, limit int, name string) ([]Thread, error) + ThreadRename func(ctx context.Context, id ThreadID, seq Seq, name string) (Seq, error) + type Model struct + Context int + ImageBytes int + ImagePixels int + ImageSide int + ImagesPerRequest int + Name string + RequestBytes int + type MultiContainer interface + Contents func() []UserContent + type OkCode string + const CodeTurn + type Origin string + const OriginAgent + const OriginUser + func (o Origin) Valid() bool + type Provider interface + Model func() Model + Name func() string + Stream func(ctx context.Context, req Request) <-chan Event + type Record struct + Attrs map[string]any + Data any + ID RecordID + Kind string + Origin RoundID + Pin RoundID + type RecordID int + type Request struct + Messages []Message + System string + ToolChoice ToolChoice + Tools []Tool + type Role string + const RoleAssistant + const RoleUser + type Round struct + Created time.Time + Error string + ID RoundID + Input Input + PinnedRecords []Record + Response Indexed[Content] + Results map[string]ContentToolResult + State RoundState + Thread ThreadID + Usage EventUsage + type RoundID int + type RoundState string + type Seq int + type Task struct + Cancel context.CancelCauseFunc + Comment string + ID uint + Meta map[string]any + Module string + Name string + type Thread struct + Created time.Time + ID ThreadID + Name string + Seq Seq + Updated time.Time + type ThreadConfig struct + CompactionAllowed float32 + CompactionPreserve float32 + CompactionTrigger float32 + ReplayItemShare float32 + ThreadMemoryLimit int64 + ToolCallLimit int + type ThreadID string + type Tool struct + Desc string + Name string + Schema any + type ToolChoice string + const ToolChoiceAny + const ToolChoiceAuto + const ToolChoiceNone + func (c ToolChoice) Tool() (string, bool) + type ToolError string + const ToolErrJSON + const ToolErrRuntime + const ToolOk + func (e *ToolError) UnmarshalJSON(data []byte) error + type UploadStorage interface + FileCommit func(ctx context.Context, threadID ThreadID, origin Origin, name string) error + FileDelete func(ctx context.Context, threadID ThreadID, origin Origin, name string) error + FileDeleteAll func(ctx context.Context, threadID ThreadID) error + FileDiscardDrafts func(ctx context.Context, threadID ThreadID, origin Origin, keep []string) error + FileList func(ctx context.Context, threadID ThreadID, origin Origin) iter.Seq2[File, error] + FilePut func(ctx context.Context, threadID ThreadID, origin Origin, name string, ...) (File, error) + FileRead func(ctx context.Context, threadID ThreadID, origin Origin, name string, off int64, ...) (io.ReadCloser, error) + FileStat func(ctx context.Context, threadID ThreadID, origin Origin, name string) (File, error) + type UserContent interface + type UserContents []UserContent + func NewToolContents(output any) (UserContents, error) + func (cs *UserContents) UnmarshalJSON(data []byte) error + type Widget interface + Update func(ctx context.Context, patch P) + type Workspace struct + Dir string + Root *os.Root + func (w *Workspace) Close() error + type WorkspaceStorage interface + WorkspaceDelete func(threadID ThreadID) error + WorkspaceOpen func(threadID ThreadID) (Workspace, error) v0.1.0 Nov 18, 2026