ctx

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatContextPartProvider

type ChatContextPartProvider interface {
	ContextPartProvider
}

ChatContextPartProvider manages chat context for a single session

func NewChatCtxManager

func NewChatCtxManager(eventBus events.EventBus) ChatContextPartProvider

NewChatCtxManager creates a new chat context manager

type ContextManager

type ContextManager interface {
	GetContextParts(ctx context.Context) (map[string]string, error) // Returns all context parts
	ClearContext() error
}

ContextManager manages conversation context

func NewContextManager

func NewContextManager(registry *ContextPartProviderRegistry) ContextManager

NewContextManager creates a new context manager with registry

type ContextPart

type ContextPart struct {
	Key     string
	Content string
}

ContextPart represents a part of the context with its key

type ContextPartProvider

type ContextPartProvider interface {
	GetPart(ctx context.Context) (ContextPart, error)
	ClearPart() error
}

ContextPartProvider provides context from various sources

type ContextPartProviderRegistry

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

ContextPartProviderRegistry manages multiple context providers

func NewContextPartProviderRegistry

func NewContextPartProviderRegistry() *ContextPartProviderRegistry

NewContextPartProviderRegistry creates a new context registry

func (*ContextPartProviderRegistry) GetProviders

GetProviders returns all registered providers

func (*ContextPartProviderRegistry) Register

func (r *ContextPartProviderRegistry) Register(provider ContextPartProvider)

Register adds a provider to the registry

type FileContextPartsProvider

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

func NewFileContextPartsProvider

func NewFileContextPartsProvider(eventBus events.EventBus) *FileContextPartsProvider

func (*FileContextPartsProvider) ClearPart

func (p *FileContextPartsProvider) ClearPart() error

func (*FileContextPartsProvider) GetOrderedFiles

func (p *FileContextPartsProvider) GetOrderedFiles() []string

GetOrderedFiles returns the ordered list of file paths (for testing)

func (*FileContextPartsProvider) GetPart

func (*FileContextPartsProvider) GetStoredFiles

func (p *FileContextPartsProvider) GetStoredFiles() map[string]string

GetStoredFiles returns the map of stored file paths to content (for testing)

type InMemoryChatContextPartProvider

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

InMemoryChatContextPartProvider implements ChatCtxManager with in-memory storage

func (*InMemoryChatContextPartProvider) ClearPart

func (m *InMemoryChatContextPartProvider) ClearPart() error

ClearPart removes all context

func (*InMemoryChatContextPartProvider) GetPart

GetPart returns the formatted conversation context

type InMemoryManager

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

InMemoryManager implements ContextManager with registry-based providers

func (*InMemoryManager) ClearContext

func (m *InMemoryManager) ClearContext() error

ClearContext clears the chat context only (maintains current behavior)

func (*InMemoryManager) GetContextParts

func (m *InMemoryManager) GetContextParts(ctx context.Context) (map[string]string, error)

GetContextParts retrieves all context parts from registered providers

type Message

type Message struct {
	User      string
	Assistant string
}

Message represents a user/assistant conversation pair

type ProjectContextPartProvider

type ProjectContextPartProvider interface {
	ContextPartProvider
}

ProjectContextPartProvider manages project-specific context files (GENIE.md/CLAUDE.md)

func NewProjectCtxManager

func NewProjectCtxManager(subscriber events.Subscriber) ProjectContextPartProvider

NewProjectCtxManager creates a new project context manager

type TodoContextPartProvider

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

TodoContextPartProvider manages todo context by listening to TodoWrite executions

func NewTodoContextPartProvider

func NewTodoContextPartProvider(eventBus events.EventBus) *TodoContextPartProvider

NewTodoContextPartProvider creates a new todo context provider

func (*TodoContextPartProvider) ClearPart

func (p *TodoContextPartProvider) ClearPart() error

ClearPart clears the stored todos

func (*TodoContextPartProvider) GetPart

GetPart returns the current todos as context

func (*TodoContextPartProvider) GetTodosJSON

func (p *TodoContextPartProvider) GetTodosJSON() string

GetTodosJSON returns the current todos JSON (for testing)

Jump to

Keyboard shortcuts

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