session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextManager

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

ContextManager manages user context for MCP sessions

func NewContextManager

func NewContextManager(client *gitopia.Client) *ContextManager

NewContextManager creates a new context manager

func (*ContextManager) GetContext

func (cm *ContextManager) GetContext() *UserContext

GetContext returns the current user context

func (*ContextManager) GetContextSummary

func (cm *ContextManager) GetContextSummary() string

GetContextSummary returns a human-readable summary of the current context

func (*ContextManager) GetOwnerID

func (cm *ContextManager) GetOwnerID() string

GetOwnerID returns the appropriate owner ID for operations If activeDAO is set, returns DAO ID, otherwise returns username

func (*ContextManager) GetUsername

func (cm *ContextManager) GetUsername() string

GetUsername returns the current username

func (*ContextManager) InitializeFromWallet

func (cm *ContextManager) InitializeFromWallet(walletAddress string) error

InitializeFromWallet initializes user context from wallet address

func (*ContextManager) IsInitialized

func (cm *ContextManager) IsInitialized() bool

IsInitialized returns true if context is initialized

func (*ContextManager) RefreshContext

func (cm *ContextManager) RefreshContext() error

RefreshContext refreshes the user context from Gitopia

func (*ContextManager) SetActiveDAO

func (cm *ContextManager) SetActiveDAO(daoName string) error

SetActiveDAO sets the active DAO for operations

func (*ContextManager) SetContext

func (cm *ContextManager) SetContext(ctx *UserContext)

SetContext sets the user context

type DAO

type DAO struct {
	Name        string   `json:"name"`
	ID          string   `json:"id"`
	Address     string   `json:"address"`
	IsOwner     bool     `json:"is_owner"`
	Permissions []string `json:"permissions,omitempty"`
}

DAO represents a DAO that the user is a member of

type UserContext

type UserContext struct {
	Username    string    `json:"username"`
	Address     string    `json:"address"`
	UserID      string    `json:"user_id"`
	DAOs        []DAO     `json:"daos,omitempty"`
	ActiveDAO   *DAO      `json:"active_dao,omitempty"`
	LastUpdated time.Time `json:"last_updated"`
}

UserContext holds the current user session information

Jump to

Keyboard shortcuts

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