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
- Variables
- func J(v any) string
- func Now() float64
- func UnjList(s string) []any
- func UnjObj(s string) map[string]any
- func UnjStrings(s string) []string
- type Approval
- type Attempt
- type DB
- func (db *DB) Approval(id int64) (*Approval, error)
- func (db *DB) ApprovalsByStatus(status string) ([]*Approval, error)
- func (db *DB) Attempt(id int64) (*Attempt, error)
- func (db *DB) AttemptByToken(token string) (*Attempt, error)
- func (db *DB) AttemptsWhere(where string, args ...any) ([]*Attempt, error)
- func (db *DB) BeginWorkspaceOperation(sessionID int64, oldPlan, newPlan string) (*WorkspaceOperation, error)
- func (db *DB) CancelWorkspaceOperation(id int64) error
- func (db *DB) Count(table, where string, args ...any) (int, error)
- func (db *DB) DeleteLaunchProfile(id int64) error
- func (db *DB) DeleteMaterialization(id int64) error
- func (db *DB) DeleteMedia(id int64) error
- func (db *DB) DeleteProjectSkill(id int64) error
- func (db *DB) DueRoutines(now float64) ([]*Routine, error)
- func (db *DB) Exists(table, where string, args ...any) bool
- func (db *DB) FinishWorkspaceOperation(id int64, state, detail, actualPlan string) error
- func (db *DB) InsertApproval(attemptID int64, tool, inputJSON string) (int64, error)
- func (db *DB) InsertAttempt(a *Attempt) (*Attempt, error)
- func (db *DB) InsertEvent(attemptID int64, seq int64, typ string, payloadJSON string) error
- func (db *DB) InsertMedia(m *Media) (*Media, error)
- func (db *DB) InsertNote(projectID int64, note string, attemptID *int64) (int64, error)
- func (db *DB) InsertProject(p *Project) (*Project, error)
- func (db *DB) InsertProjectSkill(x *ProjectSkill) (*ProjectSkill, error)
- func (db *DB) InsertRoutine(r *Routine) (*Routine, error)
- func (db *DB) InsertSession(s *Session) (*Session, error)
- func (db *DB) InsertTarget(t *Target) (*Target, error)
- func (db *DB) InsertTask(t *Task) (*Task, error)
- func (db *DB) InsertWrap(w *Wrap) (int64, error)
- func (db *DB) LatestAttempt(taskID int64) (*Attempt, error)
- func (db *DB) LaunchProfile(id int64) (*LaunchProfile, error)
- func (db *DB) LaunchProfiles() ([]*LaunchProfile, error)
- func (db *DB) LiveSessionByTmux(name string) (int64, error)
- func (db *DB) LiveSessions() ([]*Session, error)
- func (db *DB) Materializations(attachmentID int64) ([]*SkillMaterialization, error)
- func (db *DB) MaterializationsAt(targetID int64, path string) ([]*SkillMaterialization, error)
- func (db *DB) MaxEventSeq(attemptID int64) (int64, error)
- func (db *DB) MediaByID(id int64) (*Media, error)
- func (db *DB) MediaList(sessionID int64, limit int) ([]*Media, error)
- func (db *DB) NoteWorkspaceOperation(id int64, detail string) error
- func (db *DB) OneAttemptWhere(where string, args ...any) (*Attempt, error)
- func (db *DB) Project(id int64) (*Project, error)
- func (db *DB) ProjectForAttempt(attemptID int64) (*Project, error)
- func (db *DB) ProjectForTask(taskID int64) (*Project, error)
- func (db *DB) ProjectNotes(projectID int64, limit int) ([]*Memory, error)
- func (db *DB) ProjectSkill(id int64) (*ProjectSkill, error)
- func (db *DB) ProjectSkills(projectID int64, agent string) ([]*ProjectSkill, error)
- func (db *DB) Projects() ([]*Project, error)
- func (db *DB) PromoteNewProjectAndBind(ctx context.Context, p *Project, sessionID int64, ...) (*Project, error)
- func (db *DB) RecentClosedSessions(limit int) ([]*Session, error)
- func (db *DB) Routine(id int64) (*Routine, error)
- func (db *DB) Routines() ([]*Routine, error)
- func (db *DB) SaveLaunchProfile(p *LaunchProfile) (*LaunchProfile, error)
- func (db *DB) ScratchSessions() ([]*ScratchSession, error)
- func (db *DB) Session(id int64) (*Session, error)
- func (db *DB) SessionByTmux(targetID int64, tmuxName string) (*Session, error)
- func (db *DB) SessionWorkdir(targetID int64, path string) bool
- func (db *DB) SessionWraps(sessionID int64) ([]*Wrap, error)
- func (db *DB) Sessions(includeEnded bool) ([]*Session, error)
- func (db *DB) SetSetting(key, value string) error
- func (db *DB) Setting(key string) string
- func (db *DB) Takeover(taskID int64) (*Takeover, error)
- func (db *DB) Target(id int64) (*Target, error)
- func (db *DB) TargetByName(name string) (*Target, error)
- func (db *DB) Targets() ([]*Target, error)
- func (db *DB) Task(id int64) (*Task, error)
- func (db *DB) TaskAttempts(taskID int64) ([]*Attempt, error)
- func (db *DB) TaskEvents(taskID int64, afterSeq int64, attemptN *int) ([]*Event, error)
- func (db *DB) TaskMessages(taskID int64) ([]*TaskMessage, error)
- func (db *DB) Tasks(f TaskFilter) ([]*Task, error)
- func (db *DB) TasksWhere(where string, args ...any) ([]*Task, error)
- func (db *DB) Update(table string, id int64, fields map[string]any) error
- func (db *DB) UpsertMaterialization(x *SkillMaterialization) error
- func (db *DB) WorkspaceOperation(id int64) (*WorkspaceOperation, error)
- func (db *DB) WorkspaceOperations(sessionID int64, activeOnly bool) ([]*WorkspaceOperation, error)
- func (db *DB) Wraps(projectID int64, limit int) ([]*Wrap, error)
- type Event
- type LaunchProfile
- type Media
- type Memory
- type Project
- type ProjectSkill
- type Routine
- type ScratchSession
- type Session
- type SkillMaterialization
- type Takeover
- type Target
- type Task
- type TaskFilter
- type TaskMessage
- type WorkspaceOperation
- type Wrap
Constants ¶
const Schema = `` /* 11091-byte string literal not displayed */
Schema is the whole database. Plain SQL, WAL, homelab scale, zero magic.
Variables ¶
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 UnjList ¶
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 ¶
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 ¶
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 ¶
DB wraps the connection pool.
func Open ¶
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) ApprovalsByStatus ¶
ApprovalsByStatus lists approvals in one state, newest first.
func (*DB) AttemptByToken ¶
AttemptByToken resolves the per-attempt hook token an agent presents.
func (*DB) AttemptsWhere ¶
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) DeleteLaunchProfile ¶
func (*DB) DeleteMaterialization ¶
func (*DB) DeleteMedia ¶
func (*DB) DeleteProjectSkill ¶
func (*DB) DueRoutines ¶
DueRoutines returns the enabled, scheduled routines whose time has come.
func (*DB) FinishWorkspaceOperation ¶
func (*DB) InsertApproval ¶
InsertApproval records a tool call awaiting a decision.
func (*DB) InsertAttempt ¶
InsertAttempt writes a new attempt and returns it with its assigned id.
func (*DB) InsertEvent ¶
InsertEvent appends one normalised agent event.
func (*DB) InsertNote ¶
InsertNote records a durable project note left by an agent.
func (*DB) InsertProject ¶
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 ¶
InsertRoutine saves a new routine.
func (*DB) InsertSession ¶
InsertSession writes a new session row.
func (*DB) InsertTarget ¶
InsertTarget writes a new target and returns it with its assigned id.
func (*DB) InsertTask ¶
InsertTask writes a new task and returns it with its assigned id.
func (*DB) InsertWrap ¶
InsertWrap records a handoff summary.
func (*DB) LatestAttempt ¶
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 ¶
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 ¶
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 ¶
MaxEventSeq is the highest sequence number stored for an attempt.
func (*DB) NoteWorkspaceOperation ¶
func (*DB) OneAttemptWhere ¶
OneAttemptWhere returns the first matching attempt, or ErrNotFound.
func (*DB) ProjectForAttempt ¶
ProjectForAttempt resolves the project an attempt is running for.
func (*DB) ProjectForTask ¶
ProjectForTask resolves the project a task belongs to.
func (*DB) ProjectNotes ¶
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) 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 ¶
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) 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) SessionByTmux ¶
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 ¶
Session workspaces remain the operator's even after a terminal is closed.
func (*DB) SessionWraps ¶
SessionWraps lists the handoffs a single session produced.
func (*DB) Sessions ¶
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 ¶
SetSetting upserts one settings row.
func (*DB) TargetByName ¶
TargetByName fetches one target by its unique name.
func (*DB) TaskAttempts ¶
TaskAttempts lists a task's attempts oldest first.
func (*DB) TaskEvents ¶
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 ¶
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 ¶
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)
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 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 ¶
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.