store

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 11 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

Overview

Package store is lectern's SQLite persistence layer: schema, typed row accessors, and the small JSON helpers the rest of the service shares.

Index

Constants

View Source
const Schema = `` /* 11091-byte string literal not displayed */

Schema is the whole database. Plain SQL, WAL, homelab scale, zero magic.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned by the One* accessors when a row does not exist. It is deliberately distinct from sql.ErrNoRows so callers never have to import database/sql just to branch on "missing".

Functions

func J

func J(v any) string

J marshals to a compact JSON string for a *_json column.

func Now

func Now() float64

Now is the float epoch seconds every timestamp column stores.

func UnjList

func UnjList(s string) []any

UnjList parses a *_json column into a list. diff_stat_json defaults to '{}' before a diff is captured, which parses as an object — returning an empty list there is what keeps a running card renderable.

func UnjObj

func UnjObj(s string) map[string]any

UnjObj parses a *_json column into an object, tolerating empty and malformed values — a bad blob must degrade a card, never take down the board.

It never returns nil, including for the literal "null", which unmarshals into a nil map without erroring. Callers write into the result (the scheduler adds an "error" key when finalising, and a "review" key when a reviewer gate lands), and writing to a nil map panics — inside the scheduler tick, which would stall every other running attempt.

func UnjStrings

func UnjStrings(s string) []string

UnjStrings parses a *_json column into a string list (context paths, labels).

Types

type Approval

type Approval struct {
	ID        int64    `json:"id"`
	AttemptID int64    `json:"attempt_id"`
	ToolName  string   `json:"tool_name"`
	InputJSON string   `json:"-"`
	Status    string   `json:"status"`
	DecidedBy string   `json:"decided_by"`
	Note      string   `json:"note"`
	CreatedAt float64  `json:"created_at"`
	DecidedAt *float64 `json:"decided_at"`

	Input     map[string]any `json:"input"`
	TaskID    int64          `json:"task_id,omitempty"`
	AttemptN  int            `json:"attempt_n,omitempty"`
	TaskTitle string         `json:"task_title,omitempty"`
}

Approval is one tool call a gated agent is blocked on.

type Attempt

type Attempt struct {
	ID            int64    `json:"id"`
	TaskID        int64    `json:"task_id"`
	N             int      `json:"n"`
	Status        string   `json:"status"`
	Token         string   `json:"token"`
	Prompt        string   `json:"prompt"`
	ResumeSession string   `json:"resume_session"`
	Model         string   `json:"model"`
	SandboxVMID   string   `json:"sandbox_vmid"`
	WorktreePath  string   `json:"worktree_path"`
	Branch        string   `json:"branch"`
	TmuxSession   string   `json:"tmux_session"`
	SessionID     string   `json:"session_id"`
	LogOffset     int64    `json:"log_offset"`
	StartedAt     *float64 `json:"started_at"`
	FinishedAt    *float64 `json:"finished_at"`
	ExitCode      *int     `json:"exit_code"`
	ResultJSON    string   `json:"result_json"`
	DiffStatJSON  string   `json:"diff_stat_json"`
	VerifyJSON    string   `json:"verify_json"`
	// MCPJSON and StrictMCP snapshot the project launch policy for takeover;
	// they are internal because MCP declarations can contain credentials.
	MCPJSON          string `json:"-"`
	StrictMCP        int    `json:"-"`
	MCPSnapshot      int    `json:"-"`
	LaunchConfigJSON string `json:"-"`
}

Attempt is a single agent run against a task. Retries, follow-ups and the parallel B side of an A/B dispatch are all attempts.

type DB

type DB struct{ *sql.DB }

DB wraps the connection pool.

func Open

func Open(path string) (*DB, error)

Open creates (or migrates) the database at path.

The pragmas go through modernc's `_pragma=` DSN parameter: the cgo driver's `_journal_mode=`/`_busy_timeout=` spelling is silently IGNORED here, which leaves the database in rollback-journal mode with no busy timeout — writes then fail under any concurrency instead of waiting.

func (*DB) Approval

func (db *DB) Approval(id int64) (*Approval, error)

Approval fetches one approval by id, joined with its owning task.

func (*DB) ApprovalsByStatus

func (db *DB) ApprovalsByStatus(status string) ([]*Approval, error)

ApprovalsByStatus lists approvals in one state, newest first.

func (*DB) Attempt

func (db *DB) Attempt(id int64) (*Attempt, error)

Attempt fetches one attempt by id.

func (*DB) AttemptByToken

func (db *DB) AttemptByToken(token string) (*Attempt, error)

AttemptByToken resolves the per-attempt hook token an agent presents.

func (*DB) AttemptsWhere

func (db *DB) AttemptsWhere(where string, args ...any) ([]*Attempt, error)

AttemptsWhere runs an arbitrary predicate against the attempts table.

func (*DB) BeginWorkspaceOperation

func (db *DB) BeginWorkspaceOperation(sessionID int64, oldPlan, newPlan string) (*WorkspaceOperation, error)

Reserve the operation and its intended allocation in one durable transaction.

func (*DB) CancelWorkspaceOperation

func (db *DB) CancelWorkspaceOperation(id int64) error

func (*DB) Count

func (db *DB) Count(table, where string, args ...any) (int, error)

Count runs a COUNT(*) with the given WHERE clause.

func (*DB) DeleteLaunchProfile

func (db *DB) DeleteLaunchProfile(id int64) error

func (*DB) DeleteMaterialization

func (db *DB) DeleteMaterialization(id int64) error

func (*DB) DeleteMedia

func (db *DB) DeleteMedia(id int64) error

func (*DB) DeleteProjectSkill

func (db *DB) DeleteProjectSkill(id int64) error

func (*DB) DueRoutines

func (db *DB) DueRoutines(now float64) ([]*Routine, error)

DueRoutines returns the enabled, scheduled routines whose time has come.

func (*DB) Exists

func (db *DB) Exists(table, where string, args ...any) bool

Exists reports whether any row matches.

func (*DB) FinishWorkspaceOperation

func (db *DB) FinishWorkspaceOperation(id int64, state, detail, actualPlan string) error

func (*DB) InsertApproval

func (db *DB) InsertApproval(attemptID int64, tool, inputJSON string) (int64, error)

InsertApproval records a tool call awaiting a decision.

func (*DB) InsertAttempt

func (db *DB) InsertAttempt(a *Attempt) (*Attempt, error)

InsertAttempt writes a new attempt and returns it with its assigned id.

func (*DB) InsertEvent

func (db *DB) InsertEvent(attemptID int64, seq int64, typ string, payloadJSON string) error

InsertEvent appends one normalised agent event.

func (*DB) InsertMedia

func (db *DB) InsertMedia(m *Media) (*Media, error)

func (*DB) InsertNote

func (db *DB) InsertNote(projectID int64, note string, attemptID *int64) (int64, error)

InsertNote records a durable project note left by an agent.

func (*DB) InsertProject

func (db *DB) InsertProject(p *Project) (*Project, error)

InsertProject writes a new project and returns it with its assigned id.

func (*DB) InsertProjectSkill

func (db *DB) InsertProjectSkill(x *ProjectSkill) (*ProjectSkill, error)

func (*DB) InsertRoutine

func (db *DB) InsertRoutine(r *Routine) (*Routine, error)

InsertRoutine saves a new routine.

func (*DB) InsertSession

func (db *DB) InsertSession(s *Session) (*Session, error)

InsertSession writes a new session row.

func (*DB) InsertTarget

func (db *DB) InsertTarget(t *Target) (*Target, error)

InsertTarget writes a new target and returns it with its assigned id.

func (*DB) InsertTask

func (db *DB) InsertTask(t *Task) (*Task, error)

InsertTask writes a new task and returns it with its assigned id.

func (*DB) InsertWrap

func (db *DB) InsertWrap(w *Wrap) (int64, error)

InsertWrap records a handoff summary.

func (*DB) LatestAttempt

func (db *DB) LatestAttempt(taskID int64) (*Attempt, error)

LatestAttempt is the highest-numbered attempt of a task.

func (*DB) LaunchProfile

func (db *DB) LaunchProfile(id int64) (*LaunchProfile, error)

func (*DB) LaunchProfiles

func (db *DB) LaunchProfiles() ([]*LaunchProfile, error)

func (*DB) LiveSessionByTmux

func (db *DB) LiveSessionByTmux(name string) (int64, error)

LiveSessionByTmux resolves the session an agent is posting from. Tmux names are reused across a session's life only by that session, but an ended row can share one, so the live row wins and the newest breaks a tie.

func (*DB) LiveSessions

func (db *DB) LiveSessions() ([]*Session, error)

LiveSessions are the ones the poller still has to watch.

func (*DB) Materializations

func (db *DB) Materializations(attachmentID int64) ([]*SkillMaterialization, error)

func (*DB) MaterializationsAt

func (db *DB) MaterializationsAt(targetID int64, path string) ([]*SkillMaterialization, error)

func (*DB) MaxEventSeq

func (db *DB) MaxEventSeq(attemptID int64) (int64, error)

MaxEventSeq is the highest sequence number stored for an attempt.

func (*DB) MediaByID

func (db *DB) MediaByID(id int64) (*Media, error)

func (*DB) MediaList

func (db *DB) MediaList(sessionID int64, limit int) ([]*Media, error)

MediaList is newest first. sessionID 0 means every session.

func (*DB) NoteWorkspaceOperation

func (db *DB) NoteWorkspaceOperation(id int64, detail string) error

func (*DB) OneAttemptWhere

func (db *DB) OneAttemptWhere(where string, args ...any) (*Attempt, error)

OneAttemptWhere returns the first matching attempt, or ErrNotFound.

func (*DB) Project

func (db *DB) Project(id int64) (*Project, error)

Project fetches one project by id.

func (*DB) ProjectForAttempt

func (db *DB) ProjectForAttempt(attemptID int64) (*Project, error)

ProjectForAttempt resolves the project an attempt is running for.

func (*DB) ProjectForTask

func (db *DB) ProjectForTask(taskID int64) (*Project, error)

ProjectForTask resolves the project a task belongs to.

func (*DB) ProjectNotes

func (db *DB) ProjectNotes(projectID int64, limit int) ([]*Memory, error)

ProjectNotes lists a project's agent-written notes, newest first.

func (*DB) ProjectSkill

func (db *DB) ProjectSkill(id int64) (*ProjectSkill, error)

func (*DB) ProjectSkills

func (db *DB) ProjectSkills(projectID int64, agent string) ([]*ProjectSkill, error)

func (*DB) Projects

func (db *DB) Projects() ([]*Project, error)

Projects lists projects joined with their target's name and kind.

func (*DB) PromoteNewProjectAndBind

func (db *DB) PromoteNewProjectAndBind(ctx context.Context, p *Project, sessionID int64, tmux, originalBoot, boot, originalTracking, newTracking, cid, launchConfig string) (*Project, error)

PromoteNewProjectAndBind atomically creates a project and binds one exact live session. A stale preview cannot leave an orphan project behind.

func (*DB) RecentClosedSessions

func (db *DB) RecentClosedSessions(limit int) ([]*Session, error)

RecentClosedSessions returns the newest ended, non-archived interactive records. Ordering by ended_at preserves the operator's actual recent history; session IDs are allocation order and can be misleading after long uptime.

func (*DB) Routine

func (db *DB) Routine(id int64) (*Routine, error)

Routine fetches one by id.

func (*DB) Routines

func (db *DB) Routines() ([]*Routine, error)

Routines lists every saved routine, newest first.

func (*DB) SaveLaunchProfile

func (db *DB) SaveLaunchProfile(p *LaunchProfile) (*LaunchProfile, error)

func (*DB) ScratchSessions

func (db *DB) ScratchSessions() ([]*ScratchSession, error)

ScratchSessions lists every session, ended ones included: an ended session is what makes a directory's history knowable.

func (*DB) Session

func (db *DB) Session(id int64) (*Session, error)

Session fetches one session by id.

func (*DB) SessionByTmux

func (db *DB) SessionByTmux(targetID int64, tmuxName string) (*Session, error)

SessionByTmux finds a live session by its tmux name on a target. Discovery uses it to tell "already adopted" from "new to us".

func (*DB) SessionWorkdir

func (db *DB) SessionWorkdir(targetID int64, path string) bool

Session workspaces remain the operator's even after a terminal is closed.

func (*DB) SessionWraps

func (db *DB) SessionWraps(sessionID int64) ([]*Wrap, error)

SessionWraps lists the handoffs a single session produced.

func (*DB) Sessions

func (db *DB) Sessions(includeEnded bool) ([]*Session, error)

Sessions lists sessions newest first, joined with their project and target. `includeEnded` brings back the ones whose process is gone — the record is the point, so a dead session is still worth showing until it is dismissed.

func (*DB) SetSetting

func (db *DB) SetSetting(key, value string) error

SetSetting upserts one settings row.

func (*DB) Setting

func (db *DB) Setting(key string) string

Setting reads one settings row, returning "" when unset.

func (*DB) Takeover

func (db *DB) Takeover(taskID int64) (*Takeover, error)

func (*DB) Target

func (db *DB) Target(id int64) (*Target, error)

Target fetches one target by id.

func (*DB) TargetByName

func (db *DB) TargetByName(name string) (*Target, error)

TargetByName fetches one target by its unique name.

func (*DB) Targets

func (db *DB) Targets() ([]*Target, error)

Targets lists every target, name-ordered — the order the UI renders.

func (*DB) Task

func (db *DB) Task(id int64) (*Task, error)

Task fetches one task by id.

func (*DB) TaskAttempts

func (db *DB) TaskAttempts(taskID int64) ([]*Attempt, error)

TaskAttempts lists a task's attempts oldest first.

func (*DB) TaskEvents

func (db *DB) TaskEvents(taskID int64, afterSeq int64, attemptN *int) ([]*Event, error)

TaskEvents returns a task's timeline, optionally one attempt's slice of it and optionally only what follows a sequence number (SSE catch-up).

func (*DB) TaskMessages

func (db *DB) TaskMessages(taskID int64) ([]*TaskMessage, error)

func (*DB) Tasks

func (db *DB) Tasks(f TaskFilter) ([]*Task, error)

Tasks lists the board in render order: priority first, then most recent.

func (*DB) TasksWhere

func (db *DB) TasksWhere(where string, args ...any) ([]*Task, error)

TasksWhere runs an arbitrary predicate against the tasks table. Used by the scheduler for the handful of queries that don't fit TaskFilter.

func (*DB) Update

func (db *DB) Update(table string, id int64, fields map[string]any) error

Update sets the given columns on one row by id. Column names come only from call sites in this repo, never from request data.

func (*DB) UpsertMaterialization

func (db *DB) UpsertMaterialization(x *SkillMaterialization) error

func (*DB) WorkspaceOperation

func (db *DB) WorkspaceOperation(id int64) (*WorkspaceOperation, error)

func (*DB) WorkspaceOperations

func (db *DB) WorkspaceOperations(sessionID int64, activeOnly bool) ([]*WorkspaceOperation, error)

func (*DB) Wraps

func (db *DB) Wraps(projectID int64, limit int) ([]*Wrap, error)

Wraps lists a project's handoffs, newest first — the thread of a long project across every context that has worked on it.

type Event

type Event struct {
	ID          int64   `json:"id"`
	AttemptID   int64   `json:"attempt_id"`
	Seq         int64   `json:"seq"`
	TS          float64 `json:"ts"`
	Type        string  `json:"type"`
	PayloadJSON string  `json:"-"`

	// filled by the API layer
	Payload  map[string]any `json:"payload"`
	AttemptN int            `json:"attempt_n"`
}

Event is one normalised line of an agent's output stream.

type LaunchProfile

type LaunchProfile struct {
	ID      int64  `json:"id"`
	Name    string `json:"name"`
	Agent   string `json:"agent"`
	Command string `json:"command"`
	Model   string `json:"model"`
	EnvJSON string `json:"env_json"`
}

LaunchProfile holds explicit overrides for future interactive sessions. Environment values are configuration data and must not enter session events.

type Media

type Media struct {
	ID        int64   `json:"id"`
	SessionID *int64  `json:"session_id"`
	Kind      string  `json:"kind"`
	Title     string  `json:"title"`
	Note      string  `json:"note"`
	Name      string  `json:"name"`
	Mime      string  `json:"mime"`
	Size      int64   `json:"size"`
	Blob      string  `json:"-"`
	URL       string  `json:"url"`
	Source    string  `json:"source"`
	CreatedAt float64 `json:"created_at"`

	// joined so the feed can say who posted without a second request
	SessionName string `json:"session_name,omitempty"`
}

Media is one thing an agent posted for the operator to look at.

type Memory

type Memory struct {
	ID               int64   `json:"id"`
	ProjectID        int64   `json:"project_id"`
	Note             string  `json:"note"`
	CreatedByAttempt *int64  `json:"created_by_attempt"`
	CreatedAt        float64 `json:"created_at"`
}

Memory is a durable note an agent left for the agents that come after it.

type Project

type Project struct {
	SetupCmd          string `json:"setup_cmd"`
	ID                int64  `json:"id"`
	Name              string `json:"name"`
	TargetID          int64  `json:"target_id"`
	RepoPath          string `json:"repo_path"`
	DefaultBaseBranch string `json:"default_base_branch"`
	WorkrootOverride  string `json:"workroot_override"`
	PolicyJSON        string `json:"policy_json"`
	VerifyCmd         string `json:"verify_cmd"`
	KeepWorktrees     int    `json:"keep_worktrees"`
	ReviewGate        int    `json:"review_gate"`
	EnvJSON           string `json:"env_json"`
	ContextJSON       string `json:"context_json"`
	// MCPJSON is credential-bearing storage and is exposed only through the
	// redacted /projects/{id}/mcp endpoint. Never serialize it in a project row.
	MCPJSON               string  `json:"-"`
	StrictMCP             int     `json:"strict_mcp"`
	PermissionsJSON       string  `json:"permissions_json"`
	GateMatcher           string  `json:"gate_matcher"`
	DefaultAgent          string  `json:"default_agent"`
	CapabilityProfile     string  `json:"capability_profile"`
	DefaultPermissionMode string  `json:"default_permission_mode"`
	SkillSourcesJSON      string  `json:"skill_sources_json"`
	MemoryTopic           string  `json:"memory_topic"`
	MemoryStatus          string  `json:"memory_status"`
	CreatedAt             float64 `json:"created_at"`

	// joined for the projects list — the UI names a project's target inline
	TargetName string `json:"target_name,omitempty"`
	TargetKind string `json:"target_kind,omitempty"`
}

Project is a repository on a target, plus every policy that governs agents dispatched against it.

type ProjectSkill

type ProjectSkill struct {
	ID            int64   `json:"id"`
	ProjectID     int64   `json:"project_id"`
	TargetID      int64   `json:"target_id"`
	Agent         string  `json:"agent"`
	SkillID       string  `json:"skill_id"`
	SourceID      string  `json:"source_id"`
	SourcePath    string  `json:"source_path"`
	EntryName     string  `json:"entry_name"`
	TargetRel     string  `json:"target_rel"`
	SourceDigest  string  `json:"source_digest"`
	ExcludeMarker string  `json:"exclude_marker"`
	CreatedAt     float64 `json:"created_at"`
}

ProjectSkill is a desired project attachment. The source is deliberately target-local: it is never copied into the control plane or another user's home directory.

type Routine

type Routine struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	// Prompt is what the agent is asked to do, once per project.
	Prompt string `json:"prompt"`
	// Title prefixes the tasks it creates, so a board full of them is readable.
	Title string `json:"title"`
	// ProjectIDs is every project this runs against — one task each.
	ProjectIDs []int64 `json:"project_ids"`

	Agent          string `json:"agent"`
	Model          string `json:"model"`
	PermissionMode string `json:"permission_mode"`

	// Schedule empty means manual only. See routines.ParseSchedule.
	Schedule string `json:"schedule"`
	Enabled  bool   `json:"enabled"`
	// Dispatch runs the tasks immediately rather than leaving them queued.
	Dispatch bool `json:"dispatch"`

	LastRunAt *float64 `json:"last_run_at"`
	NextRunAt *float64 `json:"next_run_at"`
	CreatedAt float64  `json:"created_at"`
}

Routine is a job you saved because you keep asking for it.

It is the difference between typing "go through every open PR on librarr, sglang and gamarr, test it end to end, fix what is wrong, and merge once CI is green" for the fifth time, and pressing one button. A routine carries the prompt and everything a dispatch needs, and can run on a schedule or only when you ask.

type ScratchSession

type ScratchSession struct {
	ID        int64
	TargetID  int64
	Name      string
	Agent     string
	Workdir   string
	ProjectID *int64
	EndedAt   *float64
	LastSeen  float64
	ResumeID  string
	NativeCID string
}

ScratchSession is the little the scratch sweep needs from a session row: who claims a directory, whether they still do, and whether a conversation was ever recorded there.

type Session

type Session struct {
	SetupCancelRequested bool     `json:"setup_cancel_requested,omitempty"`
	SetupState           string   `json:"setup_state,omitempty"`
	SetupError           string   `json:"setup_error,omitempty"`
	LaunchConfigJSON     string   `json:"-"`
	ArchivedAt           *float64 `json:"archived_at"`
	ResumeID             string   `json:"resume_id,omitempty"`
	NativeRecoveryCID    string   `json:"-"`
	BootID               string   `json:"-"`
	TrackingIdentity     string   `json:"-"`
	GroupPath            string   `json:"group_path"`
	WorktreeJSON         string   `json:"-"`
	ID                   int64    `json:"id"`
	ProjectID            *int64   `json:"project_id"`
	TargetID             int64    `json:"target_id"`
	Name                 string   `json:"name"`
	Agent                string   `json:"agent"`
	Model                string   `json:"model"`
	Workdir              string   `json:"workdir"`
	TmuxSession          string   `json:"tmux_session"`
	Status               string   `json:"status"`
	Origin               string   `json:"origin"`
	PaneHash             string   `json:"-"`
	PaneTail             string   `json:"pane_tail"`
	ContextPct           *int     `json:"context_pct"`
	LastActivityAt       *float64 `json:"last_activity_at"`
	CreatedAt            float64  `json:"created_at"`
	UpdatedAt            float64  `json:"updated_at"`
	EndedAt              *float64 `json:"ended_at"`

	// joined for the UI, which groups sessions by project and names their host
	ProjectName string `json:"project_name,omitempty"`
	TargetName  string `json:"target_name,omitempty"`
	TargetKind  string `json:"target_kind,omitempty"`
}

Session is an interactive agent the operator works WITH, as opposed to a task, which is work they hand OFF. Its tmux session is the process; this row is the durable record that outlives it.

type SkillMaterialization

type SkillMaterialization struct {
	ID           int64  `json:"id"`
	AttachmentID int64  `json:"attachment_id"`
	TargetID     int64  `json:"target_id"`
	WorktreePath string `json:"worktree_path"`
	TargetPath   string `json:"target_path"`
	SourcePath   string `json:"source_path"`
	TargetRel    string `json:"target_rel"`
	// State records the filesystem fact separately from desired attachment
	// intent. pending means the link has not been proven; owned means Lectern
	// created it; preexisting means the destination was native and must never
	// be removed during detach.
	State     string  `json:"state"`
	CreatedAt float64 `json:"created_at"`
}

type Takeover

type Takeover struct {
	TaskID    int64  `json:"task_id"`
	AttemptID int64  `json:"attempt_id"`
	SessionID *int64 `json:"session_id"`
	Status    string `json:"status"`
	Error     string `json:"error"`
}

type Target

type Target struct {
	ID            int64  `json:"id"`
	Name          string `json:"name"`
	Kind          string `json:"kind"`
	Host          string `json:"host"`
	Port          int    `json:"port"`
	User          string `json:"user"`
	KeyPath       string `json:"key_path"`
	Workroot      string `json:"workroot"`
	MaxConcurrent int    `json:"max_concurrent"`
	Sandbox       int    `json:"sandbox"`
	Status        string `json:"status"`
	InfoJSON      string `json:"info_json"`
	ContextJSON   string `json:"context_json"`
	MemoryDir     string `json:"memory_dir"`
	// CommandPrefix wraps every command run on this target. It exists for hosts
	// whose SSH lands somewhere other than where the work is — a Windows box
	// where the toolchain lives in WSL needs `wsl -e bash -lc`, and without it
	// the target probes as "no tmux, no python3" and nothing can run.
	CommandPrefix string  `json:"command_prefix"`
	CreatedAt     float64 `json:"created_at"`
}

Target is a machine lectern can dispatch onto.

type Task

type Task struct {
	ID               int64   `json:"id"`
	ProjectID        int64   `json:"project_id"`
	Title            string  `json:"title"`
	Prompt           string  `json:"prompt"`
	Status           string  `json:"status"`
	Priority         int     `json:"priority"`
	LabelsJSON       string  `json:"labels_json"`
	Agent            string  `json:"agent"`
	Model            string  `json:"model"`
	PermissionMode   string  `json:"permission_mode"`
	BaseBranch       string  `json:"base_branch"`
	ParentTaskID     *int64  `json:"parent_task_id"`
	CreatedBy        string  `json:"created_by"`
	CreatedByAttempt *int64  `json:"created_by_attempt"`
	CreatedAt        float64 `json:"created_at"`
	UpdatedAt        float64 `json:"updated_at"`
}

Task is one unit of work on the board.

type TaskFilter

type TaskFilter struct {
	Status    string
	ProjectID int64
}

TaskFilter narrows the board query. A zero value lists everything.

type TaskMessage

type TaskMessage struct {
	ID        int64   `json:"id"`
	TaskID    int64   `json:"task_id"`
	RequestID string  `json:"request_id"`
	Text      string  `json:"text"`
	Interrupt bool    `json:"interrupt"`
	Status    string  `json:"status"`
	AttemptID *int64  `json:"attempt_id"`
	Error     string  `json:"error,omitempty"`
	CreatedAt float64 `json:"created_at"`
}

TaskMessage is an operator instruction and its delivery receipt.

type WorkspaceOperation

type WorkspaceOperation struct {
	ID              int64   `json:"id"`
	SessionID       int64   `json:"session_id"`
	PlanJSON        string  `json:"-"`
	State           string  `json:"state"`
	Error           string  `json:"error,omitempty"`
	CancelRequested bool    `json:"cancel_requested"`
	CreatedAt       float64 `json:"created_at"`
	UpdatedAt       float64 `json:"updated_at"`
}

func (*WorkspaceOperation) Active

func (o *WorkspaceOperation) Active() bool

type Wrap

type Wrap struct {
	ID            int64   `json:"id"`
	SessionID     int64   `json:"session_id"`
	ProjectID     *int64  `json:"project_id"`
	Summary       string  `json:"summary"`
	Transcript    string  `json:"transcript,omitempty"`
	NextSessionID *int64  `json:"next_session_id"`
	CreatedAt     float64 `json:"created_at"`
}

Wrap is one session handoff: the summary an agent wrote for its successor.

Jump to

Keyboard shortcuts

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