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
- Variables
- func LocalAppURL(raw string) bool
- func MasterBotID(projectID string) string
- func ScheduleEventID(job AppSchedule) string
- func SyncKey(parts ...string) string
- type Agent
- type AgentDiscoveryIssue
- type AgentInstallation
- type AppSchedule
- type AppScheduleSpec
- type AppShortcut
- type AppShortcutPatch
- type Bot
- type BotKnowledge
- type BotPatch
- type Chat
- type Deletion
- type EnsureAgentRequest
- type EnsureAgentResult
- type GitIdentity
- type GitOperation
- type GitSpec
- type Import
- type NativeInventory
- type NativeSessionLink
- type Project
- type ProjectFolder
- type ProjectLibrary
- type ProjectLibraryEdit
- type ProjectOperation
- type ProjectPlacement
- type ProjectSpec
- type Record
- type SessionDiscoveryIssue
- type Snapshot
- type Store
- func (st *Store) AddAppToken(id, token string) error
- func (st *Store) AllAppSchedules() ([]AppSchedule, error)
- func (st *Store) App(id string) (AppShortcut, error)
- func (st *Store) AppDirectory(app AppShortcut) (string, error)
- func (st *Store) AppScheduleCommandDone(id, occurrence string) error
- func (st *Store) AppSchedules(appID string) ([]AppSchedule, error)
- func (st *Store) Apps() ([]AppShortcut, error)
- func (st *Store) Bot(id string) (Bot, error)
- func (st *Store) BotChats(botID string) ([]Chat, error)
- func (st *Store) Bots(projectID string, includeArchived bool) ([]Bot, error)
- func (st *Store) ChangeGitOperation(id string, change func(*GitOperation)) (GitOperation, error)
- func (st *Store) ChangeProjectOperation(id string, change func(*ProjectOperation) error) (ProjectOperation, error)
- func (st *Store) ChatContext(id string) (*Chat, *Agent, *Project, error)
- func (st *Store) CheckAppToken(id, token string) bool
- func (st *Store) CheckProjectPath(path string) error
- func (st *Store) CheckSyncPath(path string) error
- func (st *Store) CheckWorkPath(path string) error
- func (st *Store) ClaimAppNotification(appID, eventID string) (bool, error)
- func (st *Store) ClaimAppSchedule(id, occurrence string) (AppSchedule, error)
- func (st *Store) Close() error
- func (st *Store) CommitRemoval(id string) (ProjectOperation, error)
- func (st *Store) CompleteProject(id string) (ProjectOperation, error)
- func (st *Store) CompleteSync(batch Import, syncID, checkpoint, operationID string, ...) error
- func (st *Store) CreateBot(bot Bot) (Bot, error)
- func (st *Store) CreateBotChat(botID, chatID, title string, projectIDs ...string) (Chat, error)
- func (st *Store) Delete(kind, id string, expected *int64, force bool, native ...*session.Store) error
- func (st *Store) DeleteAppSchedule(appID, id string) error
- func (st *Store) Directory() string
- func (st *Store) DiscardAppToken(id, token string) error
- func (st *Store) EditProjectLibrary(edit ProjectLibraryEdit) error
- func (st *Store) EnsureAgent(input EnsureAgentRequest, catalogName string) (Agent, error)
- func (st *Store) EnsureMaster(agentID, projectID string) (Bot, error)
- func (st *Store) EnsureSyncIdentity(projectID string) error
- func (st *Store) FinishAppNotification(appID, eventID string, deliveryErr error) error
- func (st *Store) FinishAppSchedule(id, occurrence string, runErr error, recovering bool) error
- func (st *Store) FinishSyncOperation(id string, operation any) error
- func (st *Store) ForkChat(src, newID string, native *session.Store, options ...session.ForkOptions) (bool, error)
- func (st *Store) GitOperation(id string) (GitOperation, error)
- func (st *Store) GitOperations(projectID string, activeOnly bool) ([]GitOperation, error)
- func (st *Store) Identity() string
- func (st *Store) Import(batch Import) error
- func (st *Store) IntegrationEvents(connectionID string, pending bool) ([]json.RawMessage, error)
- func (st *Store) InteractionCWD(chatID, agentType, cwd string) (string, error)
- func (st *Store) MergeSummaries(summaries []session.ChatSummary) ([]session.ChatSummary, error)
- func (st *Store) NativeChatContext(id string, native *session.Store) (*Chat, *Agent, *Project, error)
- func (st *Store) NativeSessionLinks() ([]NativeSessionLink, error)
- func (st *Store) NotificationIdentity(chatID string) (notify.BotIdentity, error)
- func (st *Store) NotificationsMuted(chatID string) (bool, error)
- func (st *Store) OpenNativeSession(in NativeInventory, native *session.Store) (string, error)
- func (st *Store) OverlaySummary(summary *session.ChatSummary) bool
- func (st *Store) Project(id string) (*Project, error)
- func (st *Store) ProjectAtPath(path string) (*Project, error)
- func (st *Store) ProjectLibrary() (ProjectLibrary, error)
- func (st *Store) ProjectOperation(id string) (ProjectOperation, error)
- func (st *Store) ProjectOperations(activeOnly bool) ([]ProjectOperation, error)
- func (st *Store) PruneIntegrationEvents() error
- func (st *Store) Put(kind, id string, data []byte, expected *int64) error
- func (st *Store) RegisterApp(app AppShortcut) (AppShortcut, error)
- func (st *Store) ReleaseSync(id string) error
- func (st *Store) RenameChat(id, title string) error
- func (st *Store) ReserveGitOperation(spec GitSpec) (GitOperation, bool, error)
- func (st *Store) ReserveProject(spec ProjectSpec) (ProjectOperation, bool, error)
- func (st *Store) ReserveRemoval(id, projectID string, expected int64) (ProjectOperation, bool, error)
- func (st *Store) ReserveSync(id, path string) error
- func (st *Store) RestoreSessions(chats []Chat, native *session.Store) error
- func (st *Store) RetainAppToken(id, token string) error
- func (st *Store) RetryProject(id string) (ProjectOperation, error)
- func (st *Store) RetryRemoval(id string) (ProjectOperation, error)
- func (st *Store) RevokeAppToken(id string) error
- func (st *Store) SaveAppSchedule(appID string, spec AppScheduleSpec) (AppSchedule, error)
- func (st *Store) SetBotEngines(ids []string)
- func (st *Store) Snapshot(since *int64) (Snapshot, error)
- func (st *Store) SurfaceCount(kind string) (int, error)
- func (st *Store) SurfaceDelete(kind, id string) error
- func (st *Store) SurfaceGet(kind, id string, out any) error
- func (st *Store) SurfaceList(kind string) ([]json.RawMessage, error)
- func (st *Store) SurfacePruneBefore(kind string, before time.Time) error
- func (st *Store) SurfacePut(kind, id string, value any) error
- func (st *Store) SyncAgentInstallations(observations []AgentInstallation) error
- func (st *Store) SyncGet(kind, id string, out any) error
- func (st *Store) SyncList(kind string) ([]json.RawMessage, error)
- func (st *Store) SyncNativeSessions(in NativeInventory, native *session.Store, busy func(string) bool) error
- func (st *Store) SyncPut(kind, id string, value any) error
- func (st *Store) UpdateApp(id string, patch AppShortcutPatch) (AppShortcut, error)
- func (st *Store) UpdateBot(id string, patch BotPatch) (Bot, error)
- func (st *Store) ValidateRemoval(id string) error
Constants ¶
const AgentDiscoveryVersion = 1
const AppsVersion = 2
const BotsVersion = 8
const NotificationPreferencesVersion = 2
const ProjectLibraryVersion = 1
const ProjectOperationsVersion = 1
const Version = 1
Variables ¶
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") )
var ErrNotFound = errors.New("workspace record not found")
Functions ¶
func LocalAppURL ¶
func MasterBotID ¶
func ScheduleEventID ¶
func ScheduleEventID(job AppSchedule) string
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 AgentInstallation ¶
type AppSchedule ¶
type AppSchedule struct {
AppScheduleSpec
AppID string `json:"appId"`
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"`
}
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"`
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 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 {
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 EnsureAgentRequest ¶
type EnsureAgentResult ¶
type GitIdentity ¶
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 ¶
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 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 ¶
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 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 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 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 (*Store) AddAppToken ¶
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) AppDirectory ¶
func (st *Store) AppDirectory(app AppShortcut) (string, error)
func (*Store) AppScheduleCommandDone ¶
func (*Store) AppSchedules ¶
func (st *Store) AppSchedules(appID string) ([]AppSchedule, error)
func (*Store) Apps ¶
func (st *Store) Apps() ([]AppShortcut, 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 (*Store) CheckAppToken ¶
func (*Store) CheckProjectPath ¶
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 ¶
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 ¶
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 (*Store) ClaimAppSchedule ¶
func (st *Store) ClaimAppSchedule(id, occurrence string) (AppSchedule, 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) CreateBotChat ¶
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 (*Store) DiscardAppToken ¶
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 ¶
EnsureMaster creates a manager for the requested project. It is atomic and repeatable; other projects and already assigned chats are untouched.
func (*Store) EnsureSyncIdentity ¶
EnsureSyncIdentity changes only membership metadata, never the source files or transcripts. IDs survive renames and old-client writes.
func (*Store) FinishAppNotification ¶
func (*Store) FinishAppSchedule ¶
func (*Store) FinishSyncOperation ¶
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) Import ¶
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 ¶
IntegrationEvents keeps completed delivery history off the dispatch path. These private records never enter workspace snapshots, exports, or project copies.
func (*Store) InteractionCWD ¶
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 (*Store) NativeSessionLinks ¶
func (st *Store) NativeSessionLinks() ([]NativeSessionLink, error)
func (*Store) NotificationIdentity ¶
func (st *Store) NotificationIdentity(chatID string) (notify.BotIdentity, error)
func (*Store) NotificationsMuted ¶
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 ¶
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) ProjectAtPath ¶
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 (*Store) Put ¶
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 (*Store) RenameChat ¶
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 ¶
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 ¶
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 (*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 (*Store) SaveAppSchedule ¶
func (st *Store) SaveAppSchedule(appID string, spec AppScheduleSpec) (AppSchedule, error)
func (*Store) SetBotEngines ¶
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) SurfaceDelete ¶
func (*Store) SurfaceGet ¶
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 ¶
Prune only transient control metadata. Chat image retention is independent.
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) 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) UpdateApp ¶
func (st *Store) UpdateApp(id string, patch AppShortcutPatch) (AppShortcut, error)