model

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TaskTypeImmediate = "immediate"
	TaskTypeCountdown = "countdown"
	TaskTypeScheduled = "scheduled"

	TaskStatusPending   = "pending"
	TaskStatusRunning   = "running"
	TaskStatusCompleted = "completed"
	TaskStatusFailed    = "failed"
	TaskStatusCancelled = "cancelled"

	TaskStatusActive = TaskStatusPending + "," + TaskStatusRunning
)
View Source
const (
	UserStatusActive   = "active"
	UserStatusDisabled = "disabled"
)

User status constants.

View Source
const RoleIDSuperAdmin = "sysrole_superadmin"

RoleIDSuperAdmin is the sole seed system role (inserted by migration v47).

View Source
const SystemConfigKeyDefaultEngine = "default_engine"

SystemConfigKeyDefaultEngine is the key for the default bee engine.

View Source
const SystemConfigKeyEngineArgsBee = "engine_args_bee"

SystemConfigKeyEngineArgsBee is the key for bee-level engine args.

View Source
const SystemConfigKeyEngineArgsGlobal = "engine_args_global"

SystemConfigKeyEngineArgsGlobal is the key for global engine args (applied to all workers).

Variables

Functions

This section is empty.

Types

type Department

type Department struct {
	ID        string  `json:"id" db:"id"`
	Name      string  `json:"name" db:"name"`
	ParentID  *string `json:"parent_id" db:"parent_id"`
	SortOrder int     `json:"sort_order" db:"sort_order"`
	CreatedAt int64   `json:"created_at" db:"created_at"`
	UpdatedAt int64   `json:"updated_at" db:"updated_at"`
}

Department represents a department node in a tree hierarchy.

type DepartmentBrief added in v0.0.22

type DepartmentBrief struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

DepartmentBrief is a lightweight department summary used in list and detail responses.

func ToDepartmentBriefs added in v0.0.22

func ToDepartmentBriefs(depts []Department) []DepartmentBrief

ToDepartmentBriefs converts a slice of Department to a slice of DepartmentBrief.

type DepartmentTree

type DepartmentTree struct {
	Department
	Children []DepartmentTree `json:"children"`
}

DepartmentTree is a Department with its nested children for tree responses.

type EnvConfig added in v0.0.24

type EnvConfig struct {
	ID        string  `json:"id"         db:"id"`
	Scope     string  `json:"scope"      db:"scope"`
	ScopeID   *string `json:"scope_id"   db:"scope_id"`
	Key       string  `json:"key"        db:"key"`
	EncValue  string  `json:"-"          db:"enc_value"`
	Masked    string  `json:"masked"     db:"masked"`
	CreatedAt int64   `json:"created_at" db:"created_at"`
	UpdatedAt int64   `json:"updated_at" db:"updated_at"`
}

type ExecutionStatus

type ExecutionStatus string
const (
	ExecStatusPending   ExecutionStatus = "pending"
	ExecStatusRunning   ExecutionStatus = "running"
	ExecStatusCompleted ExecutionStatus = "completed"
	ExecStatusFailed    ExecutionStatus = "failed"
)

type FailureInfo

type FailureInfo struct {
	Reason     string // raw error (exec.Result or err.Error())
	WorkerName string // worker or bee name for identification
}

FailureInfo carries context for a task failure notification sent to the user.

type Role added in v0.0.42

type Role struct {
	ID          string `json:"id" db:"id"`
	Name        string `json:"name" db:"name"`
	Description string `json:"description" db:"description"`
	IsSystem    bool   `json:"is_system" db:"is_system"`
	CreatedAt   int64  `json:"created_at" db:"created_at"`
	UpdatedAt   int64  `json:"updated_at" db:"updated_at"`
}

Role is an RBAC role.

type RoleWithPermissions added in v0.0.42

type RoleWithPermissions struct {
	Role
	Permissions []string `json:"permissions"`
}

RoleWithPermissions is a role plus its permission keys.

type SystemConfig added in v0.0.26

type SystemConfig struct {
	Key       string `db:"key"`
	Value     string `db:"value"`
	UpdatedAt int64  `db:"updated_at"`
}

SystemConfig is a global key/value system setting.

type Task

type Task struct {
	ID          string
	MessageID   string
	SessionKey  string
	Platform    string
	WorkerID    string
	Instruction string
	Type        string // TaskTypeImmediate | TaskTypeCountdown | TaskTypeScheduled
	Status      string // TaskStatus*
	ScheduledAt *int64 // ms; countdown: absolute trigger time
	CronExpr    string
	NextRunAt   *int64 // ms; scheduled tasks only
	CreatedAt   int64
	UpdatedAt   int64
}

Task represents a unit of work created by bee and dispatched to a worker.

type TokenStats added in v0.0.32

type TokenStats struct {
	ID                  string `json:"id" db:"id"`
	SessionID           string `json:"session_id" db:"session_id"`
	AgentType           string `json:"agent_type" db:"agent_type"`
	Model               string `json:"model" db:"model"`
	InputTokens         int64  `json:"input_tokens" db:"input_tokens"`
	OutputTokens        int64  `json:"output_tokens" db:"output_tokens"`
	CacheCreationTokens int64  `json:"cache_creation_tokens" db:"cache_creation_tokens"`
	CacheReadTokens     int64  `json:"cache_read_tokens" db:"cache_read_tokens"`
	TotalTokens         int64  `json:"total_tokens" db:"total_tokens"`
	SyncedAt            int64  `json:"synced_at" db:"synced_at"`
}

type User added in v0.0.42

type User struct {
	ID           string `json:"id" db:"id"`
	Username     string `json:"username" db:"username"`
	PasswordHash string `json:"-" db:"password_hash"`
	DisplayName  string `json:"display_name" db:"display_name"`
	Status       string `json:"status" db:"status"`
	CreatedBy    string `json:"created_by" db:"created_by"`
	CreatedAt    int64  `json:"created_at" db:"created_at"`
	UpdatedAt    int64  `json:"updated_at" db:"updated_at"`
	// PasswordChangedAt is the millisecond timestamp (floored to the second) of
	// the last password change. Access/refresh tokens issued before this instant
	// are rejected, forcing a re-login after any password change or admin reset.
	PasswordChangedAt int64 `json:"-" db:"password_changed_at"`
}

User is a human account that can log in to the web console.

type UserWithRoles added in v0.0.42

type UserWithRoles struct {
	User
	Roles []Role `json:"roles"`
}

UserWithRoles is a user plus its assigned roles, for list/detail responses.

type Worker

type Worker struct {
	ID               string       `json:"id" db:"id"`
	Name             string       `json:"name" db:"name"`
	Description      string       `json:"description" db:"description"`
	Constraints      string       `json:"constraints" db:"constraints"`
	WorkDir          string       `json:"work_dir" db:"work_dir"`
	Engine           string       `json:"engine" db:"engine"`
	EngineArgs       string       `json:"engine_args" db:"engine_args"`
	Status           WorkerStatus `json:"status" db:"status"`
	PermissionScopes string       `json:"permission_scopes" db:"permission_scopes"`
	CreatedAt        int64        `json:"created_at" db:"created_at"`
	UpdatedAt        int64        `json:"updated_at" db:"updated_at"`
}

type WorkerDepartment

type WorkerDepartment struct {
	WorkerID     string `json:"worker_id" db:"worker_id"`
	DepartmentID string `json:"department_id" db:"department_id"`
	CreatedAt    int64  `json:"created_at" db:"created_at"`
}

WorkerDepartment represents the many-to-many link between a Worker and a Department.

type WorkerExecution

type WorkerExecution struct {
	ID           string          `json:"id" db:"id"`
	TaskID       string          `json:"task_id,omitempty" db:"task_id"`
	WorkerID     *string         `json:"worker_id,omitempty" db:"worker_id"`
	WorkerName   string          `json:"worker_name,omitempty" db:"-"`
	SessionID    string          `json:"session_id" db:"session_id"`
	Engine       string          `json:"engine,omitempty" db:"engine"`
	TriggerInput string          `json:"trigger_input,omitempty" db:"trigger_input"`
	Status       ExecutionStatus `json:"status" db:"status"`
	Result       string          `json:"result,omitempty" db:"result"`
	LogPath      string          `json:"log_path,omitempty" db:"log_path"`
	AIProcessPID int             `json:"ai_process_pid,omitempty" db:"ai_process_pid"`
	StartedAt    *int64          `json:"started_at,omitempty" db:"started_at"`
	CompletedAt  *int64          `json:"completed_at,omitempty" db:"completed_at"`
}

type WorkerStatus

type WorkerStatus string
const (
	WorkerStatusIdle    WorkerStatus = "idle"
	WorkerStatusWorking WorkerStatus = "working"
	WorkerStatusError   WorkerStatus = "error"
)

type WorkerWithDepartments added in v0.0.22

type WorkerWithDepartments struct {
	Worker
	Departments []DepartmentBrief `json:"departments"`
}

WorkerWithDepartments is a Worker with its associated department summaries.

Jump to

Keyboard shortcuts

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