registry

package
v0.1.55 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 29 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 registry owns the workspace's saved agent profiles, projects and chat links. Harness transcripts and configuration stay in their native stores. Only the daemon writes this SQLite database; clients synchronize snapshots/revisions over HTTP.

Index

Constants

View Source
const AgentDiscoveryVersion = 1
View Source
const AppsVersion = 2
View Source
const BotsVersion = 8
View Source
const ChatSchedulesVersion = 1
View Source
const HandoffVersion = 2
View Source
const NotificationPreferencesVersion = 2
View Source
const ProjectLibraryVersion = 1
View Source
const ProjectOperationsVersion = 1
View Source
const Version = 1

Variables

View Source
var (
	ErrConflict = errors.New("record changed on another client; refresh and try again")
	ErrDeleted  = errors.New("record was deleted from this workspace")
	ErrInvalid  = errors.New("invalid workspace record")
)
View Source
var ErrNotFound = errors.New("workspace record not found")
View Source
var ErrScheduleDeferred = errors.New("waiting for this conversation to become available")

Functions

func LocalAppURL

func LocalAppURL(raw string) bool

func MasterBotID

func MasterBotID(projectID string) string

func ScheduleEventID

func ScheduleEventID(job AppSchedule) string

func SyncKey

func SyncKey(parts ...string) string

SyncKey identifies a logical record without exposing machine-local paths. Local IDs remain workspace-specific, so two replicas cannot collide in client caches.

Types

type Agent

type Agent struct {
	Record
	Name          string `json:"name"`
	AgentType     string `json:"agentType"`
	AgentTypeName string `json:"agentTypeName,omitempty"`
	// Daemon-observed executable presence. Empty means not checked by this daemon.
	// Clients cannot set this field; profiles/chat links survive an uninstall.
	Installation string `json:"installation,omitempty"`
	// A profile-level mute applies to all of its chats, including future ones.
	NotificationsMuted *bool `json:"notificationsMuted,omitempty"`
}

type AgentDiscoveryIssue

type AgentDiscoveryIssue struct {
	Agent   string `json:"agent"`
	Message string `json:"message"`
}

type AgentInstallation

type AgentInstallation struct {
	AgentType string
	Name      string
	State     string // installed | missing | repair; failed observations are omitted
}

type AppSchedule

type AppSchedule struct {
	AppScheduleSpec
	AppID       string `json:"appId,omitempty"`
	ChatID      string `json:"chatId,omitempty"`
	RunID       string `json:"runId,omitempty"`
	LastRunID   string `json:"lastRunId,omitempty"`
	Revision    int64  `json:"revision"`
	Active      bool   `json:"active"`
	NextRunAt   string `json:"nextRunAt,omitempty"`
	LastRunAt   string `json:"lastRunAt,omitempty"`
	State       string `json:"state"`
	LastError   string `json:"lastError,omitempty"`
	Occurrence  string `json:"occurrence,omitempty"`
	RetryAt     string `json:"retryAt,omitempty"`
	Attempts    int    `json:"attempts"`
	CommandDone bool   `json:"commandDone,omitempty"`
	LeaseUntil  string `json:"leaseUntil,omitempty"`
}

func (AppSchedule) Next

func (job AppSchedule) Next(after time.Time) (time.Time, error)

type AppScheduleSpec

type AppScheduleSpec struct {
	ID               string `json:"id,omitempty"`
	ExpectedRevision *int64 `json:"expectedRevision,omitempty"`
	Name             string `json:"name"`
	RunAt            string `json:"runAt,omitempty"`
	IntervalSeconds  int    `json:"intervalSeconds,omitempty"`
	LocalTime        string `json:"localTime,omitempty"`
	TimeZone         string `json:"timeZone,omitempty"`
	Weekdays         []int  `json:"weekdays,omitempty"`
	Command          string `json:"command,omitempty"`
	Prompt           string `json:"prompt,omitempty"`
	Title            string `json:"title,omitempty"`
	Body             string `json:"body,omitempty"`
	Enabled          *bool  `json:"enabled,omitempty"`
}

type AppShortcut

type AppShortcut struct {
	Record
	ProjectID          string   `json:"projectId"`
	BotID              string   `json:"botId,omitempty"`
	Name               string   `json:"name"`
	Icon               string   `json:"icon,omitempty"`
	URL                string   `json:"url"`
	StartupCommand     string   `json:"startupCommand,omitempty"`
	HealthPath         string   `json:"healthPath,omitempty"`
	Archived           bool     `json:"archived"`
	ChannelIDs         []string `json:"channelIds,omitempty"`
	NotificationsMuted bool     `json:"notificationsMuted"`
	Automation         bool     `json:"automation,omitempty"`
	StaticDirectory    string   `json:"staticDirectory,omitempty"`
	PublicURL          string   `json:"publicUrl,omitempty"`
}

AppShortcut is a saved application destination, owned by its computer. The startup command is an optional, idempotent ensure script, never a new AI turn.

type AppShortcutPatch

type AppShortcutPatch struct {
	ExpectedRevision   int64     `json:"expectedRevision"`
	Name               *string   `json:"name,omitempty"`
	Icon               *string   `json:"icon,omitempty"`
	URL                *string   `json:"url,omitempty"`
	StartupCommand     *string   `json:"startupCommand,omitempty"`
	HealthPath         *string   `json:"healthPath,omitempty"`
	Archived           *bool     `json:"archived,omitempty"`
	ChannelIDs         *[]string `json:"channelIds,omitempty"`
	NotificationsMuted *bool     `json:"notificationsMuted,omitempty"`
	StaticDirectory    *string   `json:"staticDirectory,omitempty"`
	PublicURL          *string   `json:"publicUrl,omitempty"`
}

type Bot

type Bot struct {
	Record
	AgentID      string         `json:"agentId"`
	ProjectID    string         `json:"projectId"` // Optional default working folder, not bot ownership.
	Name         string         `json:"name"`
	Icon         string         `json:"icon,omitempty"`
	Purpose      string         `json:"purpose"`
	Instructions string         `json:"instructions"`
	Memory       string         `json:"memory"`
	Knowledge    []BotKnowledge `json:"knowledge"`
	Skills       []string       `json:"skills"` // nil = unassigned; [] explicitly removes skills
	// Raw keeps a named conversation group without injecting bot context or tools.
	// Creation-only: changing this on a resumed session could retain its previous persona.
	Raw                bool  `json:"raw,omitempty"`
	IsMaster           bool  `json:"isMaster"`
	Archived           bool  `json:"archived"`
	NotificationsMuted *bool `json:"notificationsMuted,omitempty"`
}

Bots are saved profiles that reuse a real agent/project, never another transcript or credential store. Knowledge and memory stay with this profile.

type BotKnowledge

type BotKnowledge struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Content string `json:"content"`
}

type BotPatch

type BotPatch struct {
	AgentID            *string         `json:"agentId,omitempty"`
	ExpectedRevision   int64           `json:"expectedRevision"`
	Name               *string         `json:"name,omitempty"`
	Icon               *string         `json:"icon,omitempty"`
	Purpose            *string         `json:"purpose,omitempty"`
	Instructions       *string         `json:"instructions,omitempty"`
	Memory             *string         `json:"memory,omitempty"`
	Knowledge          *[]BotKnowledge `json:"knowledge,omitempty"`
	Skills             *[]string       `json:"skills,omitempty"`
	Archived           *bool           `json:"archived,omitempty"`
	NotificationsMuted *bool           `json:"notificationsMuted,omitempty"`
}

type Chat

type Chat struct {
	HandoffFrom *HandoffOrigin `json:"handoffFrom,omitempty"`
	Record
	SyncID         string `json:"syncId,omitempty"`
	AgentID        string `json:"agentId"`
	BotID          string `json:"botId,omitempty"` // Optional saved profile; absent for unbound native chats.
	ProjectID      string `json:"projectId"`
	Title          string `json:"title"`
	NativeTitle    string `json:"nativeTitle,omitempty"` // cached harness title, retained underneath a user's override
	TitleIsUserSet bool   `json:"titleIsUserSet,omitempty"`
	SessionID      string `json:"sessionId,omitempty"` // native reference; a newer active mapping in the session store wins
	UpdatedAt      string `json:"updatedAt,omitempty"` // activity reported by the native harness, not an app-open timestamp
	// Explicit false clears this chat's mute; it does not override its agent's mute.
	NotificationsMuted *bool `json:"notificationsMuted,omitempty"`
}

type Deletion

type Deletion struct {
	Kind     string `json:"kind"`
	ID       string `json:"id"`
	Revision int64  `json:"revision"`
}

type EnsureAgentRequest

type EnsureAgentRequest struct {
	AgentType string `json:"agentType"`
	Name      string `json:"name,omitempty"`
}

type EnsureAgentResult

type EnsureAgentResult struct {
	AgentID  string   `json:"agentId"`
	Snapshot Snapshot `json:"snapshot"`
}

type GitIdentity

type GitIdentity struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

GitIdentity is explicit, user-provided attribution for author settings. Legacy commit intents may also carry a repository author so retries retain it.

type GitOperation

type GitOperation struct {
	GitSpec
	Status    string `json:"status"`
	Output    string `json:"output,omitempty"`
	Error     string `json:"error,omitempty"`
	ErrorCode string `json:"errorCode,omitempty"`
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
	Sequence  int64  `json:"sequence"`
}

func (GitOperation) Active

func (o GitOperation) Active() bool

type GitSpec

type GitSpec struct {
	ID             string       `json:"id"`
	ProjectID      string       `json:"projectId"`
	Path           string       `json:"path"`
	Action         string       `json:"action"`
	Paths          []string     `json:"paths,omitempty"`
	Message        string       `json:"message,omitempty"`
	Branch         string       `json:"branch,omitempty"`
	Remote         bool         `json:"remote,omitempty"`
	NewName        string       `json:"newName,omitempty"`
	ExpectedTip    string       `json:"expectedTip,omitempty"`
	Force          bool         `json:"force,omitempty"`
	Identity       *GitIdentity `json:"identity,omitempty"`
	CommitID       string       `json:"commitId,omitempty"`
	ExpectedHead   string       `json:"expectedHead,omitempty"`
	ExpectedBranch string       `json:"expectedBranch,omitempty"`
}

GitSpec is the non-secret intent and idempotency key. Path is the canonical repository root, resolved by the daemon rather than supplied by the client.

func (GitSpec) IsRemoteTransfer

func (s GitSpec) IsRemoteTransfer() bool

IsRemoteTransfer identifies operations that exchange committed objects without replacing working files or the index. Pull also updates the checkout, so it must retain the active-work guard.

type HandoffOrigin added in v0.1.54

type HandoffOrigin struct {
	ChatID  string `json:"chatId"`
	AgentID string `json:"agentId"`
	Title   string `json:"title"`
	RunID   string `json:"runId,omitempty"`
}

HandoffOrigin is immutable provenance, not a native session to resume.

type HandoffReceipt added in v0.1.54

type HandoffReceipt struct {
	ChatID         string `json:"chatId"`
	SourceChatID   string `json:"sourceChatId"`
	TargetAgentID  string `json:"targetAgentId"`
	RequestID      string `json:"requestId"`
	Digest         string `json:"digest"`
	Message        string `json:"message"`
	ContextVersion int    `json:"contextVersion,omitempty"`
	ContextDigest  string `json:"contextDigest,omitempty"`
	Codec          string `json:"codec,omitempty"`
}

HandoffReceipt retains the reviewed prompt so retries cannot capture newer source context or execute a different task under the same receipt.

type Import

type Import struct {
	Agents   []Agent   `json:"agents"`
	Projects []Project `json:"projects"`
	Chats    []Chat    `json:"chats"`
	Bots     []Bot     `json:"bots"`
}

type NativeInventory

type NativeInventory struct {
	ProjectID, CWD, AgentType, AgentName string
	AgentID                              string // preferred profile for an explicit open, never a reassignment
	Sessions                             []agent.NativeSession
}
type NativeSessionLink struct {
	ProjectID, AgentType, SessionID, ChatID string
	Hidden                                  bool
}

NativeSessionLink exposes reference/suppression metadata to the read-only global browser. Messages remain exclusively in the harness's own storage.

type Project

type Project struct {
	Record
	SyncID        string                `json:"syncId,omitempty"` // logical identity shared by preserved workspace copies
	Name          string                `json:"name"`
	Path          string                `json:"path"`
	RepoURL       string                `json:"repoUrl,omitempty"`
	GitConnection *gitaccess.Connection `json:"gitConnection,omitempty"`
	IconPath      *string               `json:"iconPath,omitempty"`
}

type ProjectFolder

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

type ProjectLibrary

type ProjectLibrary struct {
	Version    int               `json:"version"`
	Revision   int64             `json:"revision"`
	Folders    []ProjectFolder   `json:"folders"`
	Membership map[string]string `json:"membership"`
	Order      []string          `json:"order"`
}

ProjectLibrary is presentation metadata. None of its operations move files or touch native harness transcripts. Order and membership use this registry's project IDs.

type ProjectLibraryEdit

type ProjectLibraryEdit struct {
	ExpectedRevision int64              `json:"expectedRevision"`
	Folders          []ProjectFolder    `json:"folders,omitempty"`
	DeleteFolders    []string           `json:"deleteFolders,omitempty"`
	Placements       []ProjectPlacement `json:"placements,omitempty"`
	Order            []string           `json:"order,omitempty"`
	FolderOrder      []string           `json:"folderOrder,omitempty"`
	ImportIfEmpty    bool               `json:"importIfEmpty,omitempty"`
}

Edits are partial, atomic and conditional. Retrying an already applied edit succeeds without a new revision; a stale, different intent returns ErrConflict.

type ProjectOperation

type ProjectOperation struct {
	ProjectSpec
	Status    string   `json:"status"` // queued, running, cancelling, succeeded, failed, cancelled, interrupted
	Phase     string   `json:"phase"`
	Progress  *float64 `json:"progress,omitempty"`
	Log       string   `json:"log,omitempty"` // bounded, redacted tail, never a command containing credentials
	Error     string   `json:"error,omitempty"`
	ProjectID string   `json:"projectId,omitempty"`
	CreatedAt string   `json:"createdAt"`
	UpdatedAt string   `json:"updatedAt"`
	Sequence  int64    `json:"sequence"`
	Attempt   int      `json:"attempt"`
}

func (ProjectOperation) Active

func (o ProjectOperation) Active() bool

func (ProjectOperation) Retryable

func (o ProjectOperation) Retryable() bool

type ProjectPlacement

type ProjectPlacement struct {
	ProjectID string  `json:"projectId"`
	FolderID  *string `json:"folderId"` // null returns a project to the flat list
}

type ProjectSpec

type ProjectSpec struct {
	ID               string                `json:"id"`
	Source           string                `json:"source"` // folder, create, clone, delete
	Name             string                `json:"name"`
	Path             string                `json:"path"`
	RepoURL          string                `json:"repoUrl,omitempty"`
	Branch           string                `json:"branch,omitempty"`
	AuthKind         string                `json:"authKind,omitempty"` // token, ssh, gh; empty uses native git auth
	GitConnection    *gitaccess.Connection `json:"gitConnection,omitempty"`
	ExpectedRevision int64                 `json:"expectedRevision,omitempty"` // deletion's confirmed project version
}

ProjectSpec is the durable, non-secret intent. ID is also the idempotency key. Credentials are deliberately absent; retrying after a restart can supply fresh auth.

type Record

type Record struct {
	ID          string `json:"id"`
	WorkspaceID string `json:"workspaceId"`
	CreatedAt   string `json:"createdAt"`
	Revision    int64  `json:"revision"`
}

type Schedule added in v0.1.55

type Schedule = AppSchedule

type ScheduleSpec added in v0.1.55

type ScheduleSpec = AppScheduleSpec

Both targets share the same calendar, durable claims and worker lifecycle. Neutral names preserve the existing App SDK types and embedded field names.

type SessionDiscoveryIssue

type SessionDiscoveryIssue struct {
	ProjectID string `json:"projectId"`
	Agent     string `json:"agent"`
	Message   string `json:"message"`
}

SessionDiscoveryIssue means cached membership was retained because a native listing could not be completed. It is independent of workspace availability.

type Snapshot

type Snapshot struct {
	Import
	Apps                   []AppShortcut           `json:"apps"`
	Version                int                     `json:"version"`
	WorkspaceID            string                  `json:"workspaceId"` // identity of this registry, independent of a cloud/SSH provider
	Revision               int64                   `json:"revision"`
	Full                   bool                    `json:"full"`
	Deleted                []Deletion              `json:"deleted"`
	SessionDiscoveryIssues []SessionDiscoveryIssue `json:"sessionDiscoveryIssues,omitempty"`
	AgentDiscoveryIssues   []AgentDiscoveryIssue   `json:"agentDiscoveryIssues,omitempty"`
	ProjectLibrary         *ProjectLibrary         `json:"projectLibrary,omitempty"`
}

type Store

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

func Open

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

func (*Store) AddAppToken

func (st *Store) AddAppToken(id, token string) error

AddAppToken prepares a replacement grant without revoking a working grant. The service retires old grants only after the protected file is published.

func (*Store) AllAppSchedules

func (st *Store) AllAppSchedules() ([]AppSchedule, error)

func (*Store) App

func (st *Store) App(id string) (AppShortcut, error)

func (*Store) AppDirectory

func (st *Store) AppDirectory(app AppShortcut) (string, error)

func (*Store) AppScheduleCommandDone

func (st *Store) AppScheduleCommandDone(id, occurrence string) error

func (*Store) AppSchedules

func (st *Store) AppSchedules(appID string) ([]AppSchedule, error)

func (*Store) Apps

func (st *Store) Apps() ([]AppShortcut, error)

func (*Store) AttachScheduleRun added in v0.1.55

func (st *Store) AttachScheduleRun(id, occurrence, runID string) error

A crash between starting a turn and attaching its run is safe: the occurrence receipt is committed by the ordinary turn path and is reused on recovery.

func (*Store) Bot

func (st *Store) Bot(id string) (Bot, error)

func (*Store) BotChats

func (st *Store) BotChats(botID string) ([]Chat, error)

func (*Store) Bots

func (st *Store) Bots(projectID string, includeArchived bool) ([]Bot, error)

func (*Store) ChangeGitOperation

func (st *Store) ChangeGitOperation(id string, change func(*GitOperation)) (GitOperation, error)

func (*Store) ChangeProjectOperation

func (st *Store) ChangeProjectOperation(id string, change func(*ProjectOperation) error) (ProjectOperation, error)

ChangeProjectOperation gives cancellation/progress/retries a compare-and-swap sequence. A stale worker can never overwrite a terminal result or a new attempt.

func (*Store) ChatContext

func (st *Store) ChatContext(id string) (*Chat, *Agent, *Project, error)

func (*Store) ChatSchedules added in v0.1.55

func (st *Store) ChatSchedules(chatID string) ([]Schedule, error)

func (*Store) CheckAppToken

func (st *Store) CheckAppToken(id, token string) bool

func (*Store) CheckProjectPath

func (st *Store) CheckProjectPath(path string) error

CheckProjectPath protects project changes against all Git, sync and removal reservations. Chat work uses CheckWorkPath so a transfer does not pause it.

func (*Store) CheckSyncPath

func (st *Store) CheckSyncPath(path string) error

CheckSyncPath protects file/terminal execution, including paths that do not exist yet. Call under the shared admission mutex before starting a mutation.

func (*Store) CheckWorkPath

func (st *Store) CheckWorkPath(path string) error

CheckWorkPath gates agent admission and interaction under the transport's shared mutex. Fetch and push remain reserved against project changes and other managed Git writes, but do not block work on the current checkout.

func (*Store) ClaimAppNotification

func (st *Store) ClaimAppNotification(appID, eventID string) (bool, error)

func (*Store) ClaimAppSchedule

func (st *Store) ClaimAppSchedule(id, occurrence string) (AppSchedule, error)

func (*Store) Close

func (st *Store) Close() error

func (*Store) CommitRemoval

func (st *Store) CommitRemoval(id string) (ProjectOperation, error)

CommitRemoval records the irreversible boundary with the membership tombstones. From this point recovery only cleans the owned quarantine, never the original path.

func (*Store) CompleteProject

func (st *Store) CompleteProject(id string) (ProjectOperation, error)

CompleteProject commits BOTH the canonical project and terminal operation in one transaction. Files are reconciled separately by the service's owned staging marker.

func (*Store) CompleteSync

func (st *Store) CompleteSync(batch Import, syncID, checkpoint, operationID string, artifacts map[string]json.RawMessage, forkPending map[string]bool) error

CompleteSync atomically publishes replica membership and its acknowledged checkpoint after the recoverable filesystem transaction finishes. No unrelated profile, project, chat, credential, deletion or native link is replaced. The reservation remains until FinishSyncOperation publishes the operation result.

func (*Store) CreateBot

func (st *Store) CreateBot(bot Bot) (Bot, error)

func (*Store) CreateBotChat

func (st *Store) CreateBotChat(botID, chatID, title string, projectIDs ...string) (Chat, error)

func (*Store) CreateHandoff added in v0.1.54

func (st *Store) CreateHandoff(chat Chat, receipt HandoffReceipt) error

CreateHandoff saves the new chat and its receipt in one registry transaction. The caller serializes this with ordinary chat mutations and run admission.

func (*Store) Delete

func (st *Store) Delete(kind, id string, expected *int64, force bool, native ...*session.Store) error

Delete removes registry membership (not files/native transcripts). Child chat links get durable tombstones in the same transaction. force is reserved for the existing DELETE /chats API.

func (*Store) DeleteAppSchedule

func (st *Store) DeleteAppSchedule(appID, id string) error

func (*Store) DeleteChatSchedule added in v0.1.55

func (st *Store) DeleteChatSchedule(chatID, id string) error

func (*Store) Directory

func (st *Store) Directory() string

func (*Store) DiscardAppToken

func (st *Store) DiscardAppToken(id, token string) error

func (*Store) EditProjectLibrary

func (st *Store) EditProjectLibrary(edit ProjectLibraryEdit) error

func (*Store) EnsureAgent

func (st *Store) EnsureAgent(input EnsureAgentRequest, catalogName string) (Agent, error)

EnsureAgent is setup admission, not persona creation. All clients opening setup for one harness reuse its existing profile, including one discovered from native chats. Selection matches the native-session index; old names, mutes and IDs win.

func (*Store) EnsureMaster

func (st *Store) EnsureMaster(agentID, projectID string) (Bot, error)

EnsureMaster creates a manager for the requested project. It is atomic and repeatable; other projects and already assigned chats are untouched.

func (*Store) EnsureSyncIdentity

func (st *Store) EnsureSyncIdentity(projectID string) error

EnsureSyncIdentity changes only membership metadata, never the source files or transcripts. IDs survive renames and old-client writes.

func (*Store) FinishAppNotification

func (st *Store) FinishAppNotification(appID, eventID string, deliveryErr error) error

func (*Store) FinishAppSchedule

func (st *Store) FinishAppSchedule(id, occurrence string, runErr error, recovering bool) error

func (*Store) FinishSyncOperation

func (st *Store) FinishSyncOperation(id string, operation any) error

FinishSyncOperation publishes a terminal result and releases its reservation in one transaction. A client that observes the result can immediately use the path; a failed write leaves both the prior status and its protection intact. Operations that require journal recovery must keep their reservation instead.

func (*Store) ForkChat

func (st *Store) ForkChat(src, newID string, native *session.Store, options ...session.ForkOptions) (bool, error)

ForkChat forks registered membership and native mappings together. false means an unregistered legacy chat, which the caller handles in the native store. The caller serializes chat mutations.

func (*Store) GitOperation

func (st *Store) GitOperation(id string) (GitOperation, error)

func (*Store) GitOperations

func (st *Store) GitOperations(projectID string, activeOnly bool) ([]GitOperation, error)

Latest history is bounded for clients; active-only recovery never applies a limit.

func (*Store) Handoff added in v0.1.54

func (st *Store) Handoff(chatID string) (HandoffReceipt, error)

func (*Store) HandoffTarget added in v0.1.54

func (st *Store) HandoffTarget(chatID string) (*Chat, *Agent, *Project, error)

func (*Store) Identity

func (st *Store) Identity() string

func (*Store) Import

func (st *Store) Import(batch Import) error

Import only inserts missing legacy records. Existing values and tombstones always win. Parent-before-child insertion and the revision commit happen in one transaction.

func (*Store) IntegrationEvents

func (st *Store) IntegrationEvents(connectionID string, pending bool) ([]json.RawMessage, error)

IntegrationEvents keeps completed delivery history off the dispatch path. These private records never enter workspace snapshots, exports, or project copies.

func (*Store) InteractionCWD

func (st *Store) InteractionCWD(chatID, agentType, cwd string) (string, error)

func (*Store) MergeSummaries

func (st *Store) MergeSummaries(summaries []session.ChatSummary) ([]session.ChatSummary, error)

MergeSummaries includes saved empty chats and removes tombstoned native listings.

func (*Store) NativeChatContext

func (st *Store) NativeChatContext(id string, native *session.Store) (*Chat, *Agent, *Project, error)

NativeChatContext also recovers references after a state-file repair/restore. The registry stores only this pointer; the harness still owns every message.

func (st *Store) NativeSessionLinks() ([]NativeSessionLink, error)

func (*Store) NotificationIdentity

func (st *Store) NotificationIdentity(chatID string) (notify.BotIdentity, error)

func (*Store) NotificationsMuted

func (st *Store) NotificationsMuted(chatID string) (bool, error)

NotificationsMuted follows the chat's identity: bot chats inherit only their bot's preference, while unassigned Developer chats retain their legacy engine preference. Unregistered native/legacy chats retain the default delivery behavior.

func (*Store) OpenNativeSession

func (st *Store) OpenNativeSession(in NativeInventory, native *session.Store) (string, error)

OpenNativeSession adopts only the selected native reference, without pruning other chats. Its folder, profile and chat link are committed together. Existing associations win, and no transcript or repository file is created or changed. As with SyncNativeSessions, callers hold the shared mutation gate.

func (*Store) OverlaySummary

func (st *Store) OverlaySummary(summary *session.ChatSummary) bool

OverlaySummary applies saved preferences and native metadata. true means the title is already resolved; the caller need not rescan its native transcript.

func (*Store) Project

func (st *Store) Project(id string) (*Project, error)

func (*Store) ProjectAtPath

func (st *Store) ProjectAtPath(path string) (*Project, error)

Desktop tools resolve the run's native working directory through the same project records used by the app. They never invent a second project registry.

func (*Store) ProjectLibrary

func (st *Store) ProjectLibrary() (ProjectLibrary, error)

ProjectLibrary reads only organization metadata, without enumerating projects or native conversations. It shares the registry's transaction boundary.

func (*Store) ProjectOperation

func (st *Store) ProjectOperation(id string) (ProjectOperation, error)

func (*Store) ProjectOperations

func (st *Store) ProjectOperations(activeOnly bool) ([]ProjectOperation, error)

func (*Store) PruneIntegrationEvents

func (st *Store) PruneIntegrationEvents() error

func (*Store) Put

func (st *Store) Put(kind, id string, data []byte, expected *int64) error

Put is create-only without expectedRevision, or a compare-and-swap update with it. A request retried after losing its acknowledgement is harmless when its value is unchanged.

func (*Store) RegisterApp

func (st *Store) RegisterApp(app AppShortcut) (AppShortcut, error)

func (*Store) ReleaseSync

func (st *Store) ReleaseSync(id string) error

func (*Store) RenameChat

func (st *Store) RenameChat(id, title string) error

func (*Store) ReserveGitOperation

func (st *Store) ReserveGitOperation(spec GitSpec) (GitOperation, bool, error)

func (*Store) ReserveProject

func (st *Store) ReserveProject(spec ProjectSpec) (ProjectOperation, bool, error)

ReserveProject atomically resolves idempotency and claims the destination. The claim and final record use the same database, including across two HTTP clients.

func (*Store) ReserveRemoval

func (st *Store) ReserveRemoval(id, projectID string, expected int64) (ProjectOperation, bool, error)

ReserveRemoval binds a destructive request to a specific registered project and revision. A replay is resolved before reading that record, including after deletion.

func (*Store) ReserveSync

func (st *Store) ReserveSync(id, path string) error

ReserveSync participates in the same persistent path reservations as Git, project removal and new turns. The caller holds the turn-admission mutex.

func (*Store) RestoreSessions

func (st *Store) RestoreSessions(chats []Chat, native *session.Store) error

RestoreSessions preserves migration hints without replacing newer native session mappings. HTTP and the embedded Go SDK use the same bridge between membership and native history.

func (*Store) RetainAppToken

func (st *Store) RetainAppToken(id, token string) error

func (*Store) RetryProject

func (st *Store) RetryProject(id string) (ProjectOperation, error)

func (*Store) RetryRemoval

func (st *Store) RetryRemoval(id string) (ProjectOperation, error)

func (*Store) RevokeAppToken

func (st *Store) RevokeAppToken(id string) error

func (*Store) SaveAppSchedule

func (st *Store) SaveAppSchedule(appID string, spec AppScheduleSpec) (AppSchedule, error)

func (*Store) SaveChatSchedule added in v0.1.55

func (st *Store) SaveChatSchedule(chatID string, spec ScheduleSpec) (Schedule, error)

func (*Store) SetBotEngines

func (st *Store) SetBotEngines(ids []string)

SetBotEngines binds the hosting runtime's capability matrix once it attaches the bot service. Metadata-only registry users can still read/import records without registering executable adapters.

func (*Store) Snapshot

func (st *Store) Snapshot(since *int64) (Snapshot, error)

func (*Store) SurfaceCount

func (st *Store) SurfaceCount(kind string) (int, error)

func (*Store) SurfaceDelete

func (st *Store) SurfaceDelete(kind, id string) error

func (*Store) SurfaceGet

func (st *Store) SurfaceGet(kind, id string, out any) error

Surface records share the workspace database and its lifetime. Secrets remain in the credential store; live control leases are deliberately never persisted.

func (*Store) SurfaceList

func (st *Store) SurfaceList(kind string) ([]json.RawMessage, error)

func (*Store) SurfacePruneBefore

func (st *Store) SurfacePruneBefore(kind string, before time.Time) error

Prune only transient control metadata. Chat image retention is independent.

func (*Store) SurfacePut

func (st *Store) SurfacePut(kind, id string, value any) error

func (*Store) SyncAgentInstallations

func (st *Store) SyncAgentInstallations(observations []AgentInstallation) error

SyncAgentInstallations projects real executable presence into the existing cache. One transaction creates missing profiles and updates observations. It never removes native data, renames a profile, remaps chat parents, or writes on no change.

func (*Store) SyncGet

func (st *Store) SyncGet(kind, id string, out any) error

func (*Store) SyncList

func (st *Store) SyncList(kind string) ([]json.RawMessage, error)

func (*Store) SyncNativeSessions

func (st *Store) SyncNativeSessions(in NativeInventory, native *session.Store, busy func(string) bool) error

SyncNativeSessions refreshes only links, titles and activity. The supplied inventory must be complete; a failed/partial native listing must never call this method. Transcripts remain in the harness and are read/resumed by ID. Callers hold their mutation gate so starting/deleting a chat cannot race this association commit. The slow native scan happens before acquiring that gate.

func (*Store) SyncPut

func (st *Store) SyncPut(kind, id string, value any) error

func (*Store) UpdateApp

func (st *Store) UpdateApp(id string, patch AppShortcutPatch) (AppShortcut, error)

func (*Store) UpdateBot

func (st *Store) UpdateBot(id string, patch BotPatch) (Bot, error)

func (*Store) ValidateRemoval

func (st *Store) ValidateRemoval(id string) error

Jump to

Keyboard shortcuts

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