Documentation
¶
Overview ¶
Package proto defines conch's client/server protocol: newline-delimited JSON messages over a stream (a unix socket locally, an SSH bridge remotely).
A message with Method is a request; with an ID it expects a response carrying the same ID and either Result or Error, without an ID it is a fire-and-forget notification. A message with Event is a server push.
Index ¶
- Constants
- Variables
- func BuildCapabilities() []string
- func CIFailurePrompt(log BranchCILog) string
- func FailurePrompt(what, command string, exit int, output string) string
- func FailureTail(lines []string) string
- func IsPaneID(ref string) bool
- func IsRelease() bool
- func IsReviewer(p PaneInfo) bool
- func IsTriager(p PaneInfo) bool
- func Marshal(v any) json.RawMessage
- func PRChecks(b BranchInfo) string
- func QuoteHunk(hunk string) string
- func ReviewAuthor(c ReviewComment) string
- func ReviewPrompt(branch string, comments []ReviewComment) string
- func ReviewWhere(c ReviewComment) string
- func ReviewerDone(p PaneInfo) bool
- type AccountAddParams
- type AccountFailoverParams
- type AccountInfo
- type AccountList
- type AccountPin
- type AccountPinParams
- type AccountRef
- type ActForParams
- type AgentAttachParams
- type AgentAttachResult
- type AgentAvailability
- type AgentBackgroundStopParams
- type AgentBroadcastParams
- type AgentBroadcastResult
- type AgentChat
- type AgentChatParams
- type AgentInstallParams
- type AgentInterruptParams
- type AgentInterruptResult
- type AgentLibraryParams
- type AgentLibraryResult
- type AgentLimitsResult
- type AgentPromptParams
- type AgentPromptResult
- type AgentReply
- type AgentReportParams
- type AgentSetup
- type AgentSetupParams
- type AgentSetupResult
- type AgentSkillParams
- type AgentSkillResult
- type AgentStatus
- type AgentStatusResult
- type AgentSyncParams
- type AgentSyncResult
- type AgentUsage
- type AutopilotActivity
- type AutopilotActivityParams
- type AutopilotBranch
- type AutopilotCheck
- type AutopilotNote
- type AutopilotPolicy
- type AutopilotState
- type BackgroundJob
- type BranchCILog
- type BranchCILogParams
- type BranchCIRerun
- type BranchCommitParams
- type BranchDeployDone
- type BranchDeployParams
- type BranchDiscardParams
- type BranchDiscardResult
- type BranchGitParams
- type BranchGitResult
- type BranchInfo
- type BranchMergeParams
- type BranchPRMergeParams
- type BranchPRMergeResult
- type BranchPRParams
- type BranchPRResult
- type BranchPreviews
- type BranchPruneParams
- type BranchPruneResult
- type BranchPushParams
- type BranchPushResult
- type BranchRebase
- type BranchRebaseUndoParams
- type BranchRebased
- type BranchRebasedParams
- type BranchRef
- type BranchResolvingParams
- type BranchReviewParams
- type BranchReviewResult
- type BranchStageParams
- type BranchStale
- type BranchStaleParams
- type BroadcastOutcome
- type CIDay
- type CIFlaky
- type CIJob
- type CIRerunParams
- type CIRerunResult
- type CIRun
- type CIStats
- type CIStatsParams
- type CallerInfo
- type Changes
- type ChangesParams
- type ChatTurn
- type CleanupFailure
- type CleanupWorktree
- type CloudAgentAnswer
- type CloudAgentAsk
- type CloudAgentRegisterParams
- type CloudAgentRegisterResult
- type CommitDetail
- type CommitInfo
- type CommitParams
- type CommitResult
- type Conn
- type DeployInfo
- type DeployRelease
- type DeploySource
- type DiffParams
- type DiffResult
- type Error
- type FSDownload
- type FSDownloadChunk
- type FSDownloadParams
- type FSDownloadReadParams
- type FSEntry
- type FSFindParams
- type FSFindResult
- type FSLinesParams
- type FSLinesResult
- type FSList
- type FSListParams
- type FSMkdirParams
- type FSPathParams
- type FSPathResult
- type FSPattern
- type FSReadParams
- type FSReadResult
- type FSReplaceFile
- type FSReplaceParams
- type FSReplaceResult
- type FSReplaced
- type FSSearchFile
- type FSSearchLine
- type FSSearchParams
- type FSSearchResult
- type FSSkipped
- type FSUploadParams
- type FSUploadResult
- type FSWriteParams
- type FSWriteRangeParams
- type FSWriteResult
- type FileChange
- type Frame
- type FrameCursor
- type GitStatus
- type GroupInfo
- type GroupList
- type GroupRef
- type GroupSaveParams
- type GroupTask
- type GroupTaskMerge
- type GroupTaskMergeParams
- type GroupTaskParams
- type GroupTaskRef
- type GroupTaskResult
- type HelloParams
- type HelloResult
- type IntegrationDetect
- type IntegrationDetectParams
- type IntegrationTeam
- type IntegrationTeamParams
- type IntegrationUse
- type IssueInfo
- type IssueList
- type IssuesParams
- type Library
- type LibraryApplyParams
- type LibraryCell
- type LibraryFetchParams
- type LibraryFetchResult
- type LibraryServer
- type LibrarySkill
- type LimitWindow
- type LocalFile
- type LogCommit
- type LogParams
- type LogResult
- type Message
- type ModelUsage
- type NamedWindow
- type NoteCI
- type Overlap
- type PRCheck
- type PRInfo
- type PaneCreateParams
- type PaneInfo
- type PaneList
- type PaneMonitor
- type PaneMonitorParams
- type PaneOutput
- type PaneRawStart
- type PaneReadResult
- type PaneRef
- type PaneRenameParams
- type PaneResizeParams
- type PaneScrollParams
- type PaneSearchParams
- type PaneSearchResult
- type PaneSendKeysParams
- type PaneSendMouseParams
- type PaneSendTextParams
- type PaneTeamParams
- type PermissionAnswer
- type PermissionAsk
- type PermissionRecord
- type PlanLimits
- type ProjectAddParams
- type ProjectBundle
- type ProjectCloneParams
- type ProjectCreateParams
- type ProjectFilesParams
- type ProjectInfo
- type ProjectList
- type ProjectPlace
- type ProjectRef
- type ProjectSetupParams
- type ProjectUnbundleParams
- type PruneBranch
- type RebasedCommit
- type RepoFormat
- type ResolveAsk
- type ReviewComment
- type ReviewLineNew
- type ReviewList
- type ReviewRef
- type ReviewReply
- type ReviewReplyParams
- type ReviewSendParams
- type ReviewSendResult
- type ScheduleList
- type ScheduledItem
- type ServerHeap
- type ServerReloadParams
- type ServerReloadResult
- type SessionExport
- type SessionInfo
- type SessionList
- type SessionListParams
- type SessionRef
- type SessionSearchParams
- type SessionShareParams
- type SessionShareResult
- type SessionStarParams
- type SetupGroup
- type SetupItem
- type ShellThemes
- type SkillChange
- type StaleBranch
- type StaleWorktree
- type Subagent
- type SyncChange
- type SystemCPU
- type SystemDisk
- type SystemHost
- type SystemMemory
- type SystemPoint
- type SystemProcess
- type SystemStats
- type SystemStatsParams
- type TaskCreateParams
- type TicketCheckParams
- type TicketCheckResult
- type TicketComment
- type TicketDoing
- type TicketGetParams
- type TicketInfo
- type TicketLink
- type TicketList
- type TicketOverview
- type TicketOverviewParams
- type TicketProject
- type TicketRow
- type TicketUpdateParams
- type TicketsParams
- type Tokens
- type TrackerArea
- type TrackerProjectState
- type TrackerState
- type UsageBucket
- type UsageHistory
- type UsageHistoryParams
- type UsagePeriod
- type UsageTokens
- type ViewShowParams
- type ViewShowResult
- type ViewState
- type ViewTab
- type WorktreeAddParams
- type WorktreeChanged
- type WorktreeCleanupParams
- type WorktreeCleanupResult
- type WorktreeFilesParams
- type WorktreeFilesResult
- type WorktreeHaveParams
- type WorktreeHaveResult
- type WorktreeInfo
- type WorktreeMoveInfo
- type WorktreePack
- type WorktreePackChunk
- type WorktreePackParams
- type WorktreePackReadParams
- type WorktreeRef
- type WorktreeRemoveParams
- type WorktreeResult
- type WorktreeStale
- type WorktreeUnpackParams
- type WorktreeUnpackResult
Constants ¶
const ( // MethodAccountList lists the accounts, the pins and the failover line. MethodAccountList = "account.list" // MethodAccountAdd makes an account and its folder. MethodAccountAdd = "account.add" // MethodAccountRemove forgets an account, leaving its folder. MethodAccountRemove = "account.remove" // MethodAccountPin pins a folder to an account, or unpins it. MethodAccountPin = "account.pin" // MethodAccountFailover sets the failover line. MethodAccountFailover = "account.failover" )
Account methods.
const ( ActivityCI = "ci" // a failed CI run sent to the agent, or not ActivityCheck = "check" // the project's own check ActivityShip = "ship" // pushed, a pull request opened or marked ready ActivityMerge = "merge" // merged, or held back from merging ActivityResolve = "resolve" // a conflict with the base rebased or sent to the agent ActivityIntake = "intake" // an issue taken as a task ActivityTriage = "triage" // an issue read and labelled )
What a note is about, for the activity feed to group and mark.
const ( TierSupported = "supported" TierRunsHere = "runs here" )
The tiers an agent can be in, as agent.list reports them. They are in the protocol because a client says them to a person: "runs here" is a promise conch is deliberately not making about sessions.
const ( MethodHello = "hello" MethodPing = "ping" MethodServerStop = "server.stop" MethodServerReload = "server.reload" MethodPaneList = "pane.list" MethodPaneCreate = "pane.create" MethodPaneClose = "pane.close" MethodPaneResize = "pane.resize" MethodPaneSendText = "pane.send_text" MethodPaneSendKeys = "pane.send_keys" // MethodPaneTeam puts a pane in a team by hand (CapPaneTeam). MethodPaneTeam = "pane.team" MethodPaneRead = "pane.read" MethodPaneSubscribe = "pane.subscribe" MethodPaneUnsubscribe = "pane.unsubscribe" MethodPaneMarkSeen = "pane.mark_seen" MethodPaneRename = "pane.rename" MethodPaneRedraw = "pane.redraw" MethodPaneSendMouse = "pane.send_mouse" MethodPaneScroll = "pane.scroll" MethodPaneSearch = "pane.search" MethodPaneMonitor = "pane.monitor" // MethodPaneRaw starts the pane's raw output to this connection // (pane.raw.v1): the result is the replay, then EventPaneOutput // follows until pane.unsubscribe. MethodPaneRaw = "pane.raw" // MethodUsageHistory answers a UsageHistory (usage.history.v1). MethodUsageHistory = "usage.history" MethodAgentReport = "agent.report" MethodAgentExplain = "agent.explain" MethodAgentStatus = "agent.status" MethodAgentInstall = "agent.install" // Project groups (CapProjectGroups): GroupList, GroupSaveParams → // GroupInfo, GroupRef. MethodGroupList = "group.list" MethodGroupSave = "group.save" MethodGroupRemove = "group.remove" // Tasks across a group's repos (CapGroupTask): GroupTaskParams → // GroupTaskResult; GroupTaskRef. MethodGroupTask = "group.task" MethodGroupTaskRemove = "group.task.remove" // MethodGroupTaskMerge arms (or with Stop, disarms) Merge All When // Green on a task (CapGroupTaskMerge): GroupTaskMergeParams → GroupTask. MethodGroupTaskMerge = "group.task.merge" // MethodCloudAgentRegister is conch cloud agent telling the server // where to ask for an agent's secrets (CapCloudAgent): // CloudAgentRegisterParams → CloudAgentRegisterResult. It lasts as long // as the connection that made it. MethodCloudAgentRegister = "cloud.agent.register" MethodProjectList = "project.list" MethodProjectAdd = "project.add" MethodProjectRemove = "project.remove" MethodProjectRefresh = "project.refresh" MethodProjectChanges = "project.changes" MethodProjectDiff = "project.diff" // MethodProjectLog is a project's history for a commit graph // (CapProjectLog). MethodProjectLog = "project.log" // MethodProjectCommit answers a CommitDetail (project.commit.v1). MethodProjectCommit = "project.commit" MethodWorktreeAdd = "worktree.add" MethodWorktreeRemove = "worktree.remove" MethodTaskCreate = "task.create" MethodProjectCreate = "project.create" MethodProjectResolve = "project.resolve" // MethodProjectGitInit makes a plain-folder project a git repository // (ProjectRef; answers its ProjectInfo; project.git_init.v1). MethodProjectGitInit = "project.git_init" MethodFSList = "fs.list" MethodFSMkdir = "fs.mkdir" MethodFSUpload = "fs.upload" MethodFSRead = "fs.read" MethodFSWrite = "fs.write" MethodFSFind = "fs.find" MethodFSSearch = "fs.search" MethodFSReplace = "fs.replace" MethodFSRename = "fs.rename" MethodFSCopy = "fs.copy" MethodFSDelete = "fs.delete" MethodFSLines = "fs.lines" MethodFSWriteRange = "fs.write_range" // Copying a file or folder off the machine (CapFSTransfer). MethodFSDownload = "fs.download" MethodFSDownloadRead = "fs.download_read" MethodShellThemes = "shell.themes" MethodAgentSetup = "agent.setup" MethodAgentSync = "agent.setup.sync" MethodAgentLibrary = "agent.library" MethodLibraryFetch = "agent.library.fetch" MethodLibraryApply = "agent.library.apply" MethodProjectFiles = "project.set_files" MethodProjectSetup = "project.set_setup" MethodWorktreeFiles = "worktree.copy_files" MethodSessionList = "session.list" MethodSessionResume = "session.resume" MethodSessionDismiss = "session.dismiss" MethodSessionSearch = "session.search" MethodSessionExport = "session.export" MethodSessionDelete = "session.delete" // MethodSessionStar keeps a session as one to come back to, or stops. MethodSessionStar = "session.star" MethodAgentLimits = "agent.limits" // MethodAgentBroadcast types one message into several agents. MethodAgentBroadcast = "agent.broadcast" // MethodAgentPrompt submits a message to one agent, unless it is // waiting on a question. MethodAgentPrompt = "agent.prompt" // MethodViewState is a TUI telling the server what it is showing, so // anything else can read it (view.get). A notification: nothing waits // on it, and a server that predates it ignores it. MethodViewState = "view.state" // MethodViewGet answers with the last view a TUI published. MethodViewGet = "view.get" // MethodViewShow asks the TUIs to show a set of panes together. It is // a request, not an order: a client that is not showing that machine, // or has no room, does what it can. MethodViewShow = "view.show" // MethodAgentReply is the last thing a pane's agent said, read from // its saved conversation (CapAgentReply). MethodAgentReply = "agent.reply" // MethodAgentChat is a pane's agent's conversation, tools and all, // read from its saved transcript (CapAgentChat). MethodAgentChat = "agent.chat" // MethodAgentBackgroundStop ends one of the jobs an agent left running // (AgentStatus.Jobs), and only one of those (agent.background.v1). MethodAgentBackgroundStop = "agent.background.stop" MethodAgentInterrupt = "agent.interrupt" MethodAgentAttach = "agent.attach" MethodProjectIssues = "project.issues" // MethodProjectTickets lists a project's open tickets in its tracker, // MethodTicketGet reads one, and MethodTicketUpdate comments on it, // moves it or links something to it (CapTickets). MethodProjectTickets = "project.tickets" MethodTicketGet = "ticket.get" MethodTicketUpdate = "ticket.update" // MethodTicketCheck says how each tracker stands (CapTicketCheck). MethodTicketCheck = "ticket.check" // MethodTicketOverview lists every project's tickets (CapTicketOverview). MethodTicketOverview = "ticket.overview" MethodAgentPermission = "agent.permission" MethodScheduleAdd = "schedule.add" MethodScheduleList = "schedule.list" MethodScheduleRemove = "schedule.remove" MethodReviewList = "review.list" MethodReviewSet = "review.set" MethodReviewSend = "review.send" // MethodReviewReply answers a note (review.thread.v1). MethodReviewReply = "review.reply" // MethodPaneCaller says which pane the connection comes from and // whether it is scoped; MethodActFor asks a connection from another // machine to be scoped as that caller. MethodPaneCaller = "pane.caller" MethodActFor = "scope.act_for" // MethodAgentSkill installs or removes conch's skill for agents. MethodAgentSkill = "agent.skill" // Finishing a branch's work: commit, push, open a pull request, merge // into the base, or throw the branch away. MethodBranchCommit = "branch.commit" // MethodBranchStage is git add, or taking changes back out of the // index (branch.stage.v1). MethodBranchStage = "branch.stage" MethodBranchPush = "branch.push" MethodBranchPR = "branch.pr" // MethodBranchReview submits a review of the branch's pull request // (pr.review.v1). MethodBranchReview = "branch.review" MethodBranchMerge = "branch.merge" // MethodBranchPRMerge merges a branch's pull request on GitHub // (CapPRMerge). MethodBranchPRMerge = "branch.pr_merge" MethodBranchDiscard = "branch.discard" // MethodAutopilotSet hands the server what to do on its own // (AutopilotPolicy); MethodAutopilotGet says what it is doing; and // MethodAutopilotCheck tells it how a project's own check on a branch // ended (CapAutopilot). MethodAutopilotSet = "autopilot.set" MethodAutopilotGet = "autopilot.get" MethodAutopilotCheck = "autopilot.check" // MethodBranchGit runs git commands in a branch's worktree // (CapBranchGit). MethodBranchGit = "branch.git" // MethodBranchCILog is the log of the failed steps of a branch's // newest failed GitHub Actions run (CapBranchCILog). MethodBranchCILog = "branch.ci_log" // MethodCIStats adds up a project's GitHub Actions runs (CapCIStats). // MethodAutopilotActivity lists what the autopilot did // (CapAutopilotActivity). MethodAutopilotActivity = "autopilot.activity" MethodCIStats = "ci.stats" // MethodCIRerun runs a failed run's failed jobs again (CapCIRerun). MethodCIRerun = "ci.rerun" // MethodBranchRebased reads back the agents' branches' newest // rebases, and MethodBranchRebaseUndo puts one back (CapBranchRebased). MethodBranchRebased = "branch.rebased" MethodBranchRebaseUndo = "branch.rebase_undo" // MethodBranchResolving says which agent was asked to resolve a // branch's conflict, or that nobody is any more (CapBranchResolving). MethodBranchResolving = "branch.resolving" // MethodBranchCIRerun re-runs what failed in a branch's newest failed // run (CapBranchCIRerun). MethodBranchCIRerun = "branch.ci_rerun" // MethodIntegrationDetect lists the services a project uses // (CapIntegrationDetect). MethodIntegrationDetect = "integration.detect" // MethodIntegrationTeam answers a repository's team file, or writes // or removes it (CapIntegrationTeam). MethodIntegrationTeam = "integration.team" // A branch's deploy previews, through the deploy integrations its // project uses (CapBranchPreviews): its deploys, what a failed build // printed, building one again, and releasing one to production — // which no agent may ask for. MethodBranchPreviews = "branch.previews" MethodBranchDeployLog = "branch.deploy_log" MethodBranchRedeploy = "branch.redeploy" MethodBranchPromote = "branch.promote" // Leftover worktrees: list what each would lose, and remove them. MethodWorktreeStale = "worktree.stale" MethodWorktreeCleanup = "worktree.cleanup" // Old branches: list the ones nobody has committed to for a while, and // delete them (CapBranchPrune). MethodBranchStale = "branch.stale" MethodBranchPrune = "branch.prune" // Moving a worktree to another machine (CapWorktreeMove). MethodWorktreeDescribe = "worktree.describe" MethodWorktreeHave = "worktree.have" MethodWorktreePack = "worktree.pack" MethodWorktreePackRead = "worktree.pack_read" MethodWorktreeUnpack = "worktree.unpack" MethodProjectClone = "project.clone" MethodProjectBundle = "project.bundle" MethodProjectUnbundle = "project.unbundle" )
Methods.
const ( EventPaneCreated = "pane.created" EventPaneExited = "pane.exited" EventPaneClosed = "pane.closed" EventPaneFrame = "pane.frame" // EventPaneOutput is a piece of a pane's raw output (PaneOutput), to a // connection that asked for it with pane.raw. EventPaneOutput = "pane.output" // EventPaneUpdated carries a PaneInfo whose agent status, title or // name changed. EventPaneUpdated = "pane.updated" // EventProjectUpdated carries a ProjectInfo (added or git state changed). EventProjectUpdated = "project.updated" EventProjectRemoved = "project.removed" // EventGroups carries the whole GroupList whenever a group changes, // or a project leaves one by being removed. EventGroups = "group.changed" // EventAgentLimits carries a PlanLimits that changed. EventAgentLimits = "agent.limits" // EventWorktreeChanged carries a WorktreeChanged: files in a worktree // were written, moved or removed. It says nothing about what git makes // of them — the reader re-reads what it is showing. EventWorktreeChanged = "worktree.changed" // EventScheduleChanged carries the whole ScheduleList whenever an item // is added, fired, moved or removed. EventScheduleChanged = "schedule.changed" // EventReviewChanged carries the ReviewList of the branch whose // comments were added, changed, sent or dropped. EventReviewChanged = "review.changed" // EventAutopilotNote carries an AutopilotNote: something the server // did, or would not do, on its own. EventAutopilotNote = "autopilot.note" // EventViewShow carries a view.show request to every client. EventViewShow = "view.show" )
Events.
const ( ErrBadRequest = "bad_request" // ErrPushRejected is a push the remote is ahead of: taking its commits // first (branch.push with Rebase) is what mends it. ErrPushRejected = "push_rejected" // ErrRebaseConflict is a rebase that stopped on conflicts and was // undone: the branch is as it was and nothing was pushed, so what is // left is to sort the conflict out in the worktree by hand. ErrRebaseConflict = "rebase_conflict" // ErrAgentBlocked is a message refused because the agent is waiting // on a question: typed in, its Enter could answer the question. ErrAgentBlocked = "agent_blocked" // ErrOutOfScope is a change an agent asked for, from inside its pane, // to a pane or project that isn't its own. ErrOutOfScope = "out_of_scope" // ErrCloudAgentHeld: cloud.agent.register while another connection // holds the registration. ErrCloudAgentHeld = "cloud_agent_held" // ErrFileChanged is fs.write refusing to write over a file that changed // on disk since it was read (fs.write.v1). ErrFileChanged = "file_changed" ErrNotFound = "not_found" ErrInternal = "internal" ErrUnknown = "unknown_method" )
Error codes.
const ( PaneRunning = "running" PaneExited = "exited" )
Pane states.
const ( AlertActivity = "activity" AlertSilence = "silence" )
Alerts a monitored pane raises.
const ( MousePress = "press" MouseRelease = "release" MouseMotion = "motion" MouseWheel = "wheel" )
Mouse actions.
const ( MergeWaiting = "waiting" // armed: not every pull request is green yet MergeMerging = "merging" // every one was green; merging in order MergeMerged = "merged" // all of them merged MergeStopped = "stopped" // one could not be merged, or it was stopped; Why says which )
The states of a task's Merge All When Green.
const ( FSFindDefault = 20 FSFindMax = 200 )
const ( FSSearchDefault = 500 FSSearchMax = 5000 // FSSearchFileMax is the biggest file a search of a whole checkout // reads; a bigger one is counted in Skipped and searched by its Path. FSSearchFileMax = 8 << 20 // FSSearchLineMax is how much of a matching line comes back: the part // around its first match. FSSearchLineMax = 400 )
const ( FSLinesDefault = 200 FSLinesMax = 5000 // FSLinesBytesMax bounds what one fs.lines returns, however long its // lines are. FSLinesBytesMax = 1 << 20 )
const ( LogLimit = 300 LogLimitMax = 2000 )
LogLimit and LogLimitMax bound project.log.
const ( ReviewEventApprove = "approve" ReviewEventRequestChanges = "request_changes" ReviewEventComment = "comment" )
ReviewEvent is what a review says about a pull request.
const ( TeamUse = "use" TeamIgnore = "ignore" TeamSave = "save" TeamRemove = "remove" )
The answers and acts of integration.team.
const ( PermissionAllow = "allow" PermissionDeny = "deny" )
Permission decisions.
const ( DoingWaiting = "waiting" // its agent waits on the person DoingWorking = "working" // its agent is at work DoingPR = "pr" // a pull request is open for it DoingQueued = "queued" // a task for it is on the schedule DoingIdle = "idle" // its agent has stopped, nothing open DoingMerged = "merged" // its pull request merged )
What conch is doing about a ticket, most pressing first.
const ( TrackerConnected = "connected" TrackerOff = "off" // not set up TrackerError = "error" // set up, and it did not answer as hoped )
Tracker states.
const ( AgentIdle = "idle" AgentWorking = "working" AgentBlocked = "blocked" AgentDone = "done" // idle, and nobody has looked since it finished )
Agent states.
const ( AttachMaxSize int64 = 20 << 20 AttachMaxFiles = 10 AttachKeep = 7 * 24 * time.Hour // AttachDir is where in a checkout attachments go, with slashes. AttachDir = ".conch/attachments" )
The limits on a message's attachments, and how long they are kept.
const ( FileMissing = "missing" FileDiffers = "differs" FileSame = "same" // FileNotIgnored is an untracked file git doesn't ignore: never copied, // so an agent can't commit it by accident. FileNotIgnored = "not_ignored" )
Local file states in a worktree compared to the main checkout.
const ( SyncCreate = "create" SyncUpdate = "update" SyncLink = "link" SyncRemove = "remove" SyncSame = "same" SyncSkip = "skip" )
What a sync change does: writing ones first.
const ( SyncInstructions = "instructions" SyncSkill = "skill" SyncMCP = "mcp server" )
Kinds of setup a sync carries.
const ( CloudAskEnv = "env" CloudAskGitCredential = "git-credential" )
What a CloudAgentAsk may ask.
const ( PressureNormal = "normal" PressureWarn = "warn" PressureCritical = "critical" )
Memory pressure, as SystemMemory.Pressure says it.
const CapAccountFailoverAgent = "account.failover.agent.v1"
CapAccountFailoverAgent is a failover line per agent: AccountFailoverParams with an Agent, and AccountList.FailoverFor. Without it a server keeps one line for every agent and would take an Agent's line as everyone's.
const CapAccounts = "agent.accounts.v1"
CapAccounts is account.*: an agent's accounts besides its own — a work and a personal subscription — each a configuration folder of the agent's, pinned to projects, worktrees and tasks, with new agents moved to the next account when one passes its plan limit. It also means pane.create, task.create and group.task take Account, and PaneInfo, PlanLimits and SessionInfo say which account they are. A server without it starts every agent on its own account.
const CapAgentAttach = "agent.attach.v1"
CapAgentAttach is agent.attach: a new folder for a message's attachments in the agent's checkout, .conch/attachments/ID, kept out of git through its info/exclude, with folders there older than AttachKeep removed. The files are then copied in with fs.upload (Dir), which carries them in chunks, so a file can be bigger than one message.
const CapAgentBackground = "agent.background.v1"
CapAgentBackground is AgentStatus.Background and Jobs: what an agent that is not working left running below it — a dev server, a watcher, a background shell — and agent.background.stop to end one of them.
const CapAgentChat = "agent.chat.v1"
CapAgentChat is agent.chat: a pane's agent's conversation with the tools it used, from its saved transcript, for a chat drawn beside its terminal.
const CapAgentInterrupt = "agent.interrupt.v1"
CapAgentInterrupt is agent.interrupt: what a chat's Stop sends — the agent's own interrupt key, each on its own so the agent cannot read it as the start of an escape sequence, or ctrl+c when Hard — after which the server looks at the agent at once and again every moment until it stops working, rather than at its next tick. An older server has only pane.send_keys, and a client falls back to that.
const CapAgentLibrary = "agent.library.v1"
CapAgentLibrary is agent.library and agent.library.apply: MCP servers and skills kept in conch and given to the agents chosen for each.
const CapAgentPrompt = "agent.prompt.v1"
CapAgentPrompt is agent.prompt: a message submitted to one agent, refused while it waits on a question, and the Turn of AgentStatus that says when the work it started has ended.
const CapAgentReply = "agent.reply.v1"
CapAgentReply is agent.reply: an agent's last answer, whole, from its saved conversation rather than off its screen.
const CapAgentSkill = "agent.skill.v1"
CapAgentSkill is agent.skill: conch's own skill installed where each agent reads the person's skills, or taken away again.
const CapAgentSkillPick = "agent.skill.pick.v1"
CapAgentSkillPick is agent.skill taking Skills: some of conch's skills rather than all of them. A server without it installs every one, so a client asks for one skill only of a server that says it can.
const CapAgentSync = "agent.setup.sync.v1"
CapAgentSync is agent.setup.sync: one agent's setup in a checkout given to the others — instructions, skills and MCP servers — planned, applied and undone.
const CapAgentSyncUser = "agent.setup.sync.user.v1"
CapAgentSyncUser is the same for the setup in your home, through the User field: a server without it would sync the checkout instead, so clients check before asking.
const CapAgentTiers = "agent.tiers.v1"
CapAgentTiers is agent.list saying each agent's tier, and the server offering agents described by a manifest as well as the five with adapters. A client without it sees the supported five and nothing it cannot explain; one with it can say which agents it only runs, and that their sessions are not read.
const CapAutopilot = "autopilot.v1"
CapAutopilot is autopilot.*: the server, not a TUI, sends a branch's failed CI and failed check back to its agent ([verify] auto_fix) and merges a pull request that turns green (auto_merge), so both carry on with no TUI open and through a reload. A TUI hands it the policy from its settings; against an older server the TUI does both itself, and only while it runs.
const CapAutopilotActivity = "autopilot.activity.v1"
CapAutopilotActivity is autopilot.activity: what the autopilot did, kept by the server across restarts, and each note's kind and time.
const CapAutopilotIntake = "autopilot.intake.v1"
CapAutopilotIntake is AutopilotPolicy.Intake: open GitHub issues with a project's label taken as queued tasks by the server, each once.
const CapAutopilotNoteCI = "autopilot.note.ci.v1"
CapAutopilotNoteCI is AutopilotNote.CI: a note about a failed run names its service, workflow and job, and what was read of it.
const CapAutopilotTriage = "autopilot.triage.v1"
CapAutopilotTriage is AutopilotPolicy.Triage: each issue with a project's triage label read by an agent and labelled ready, needs-info or too-big, with a comment saying why.
const CapBranchCILog = "branch.ci_log.v1"
CapBranchCILog is branch.ci_log: what a branch's failed CI run printed, read through gh on the machine the branch is on, for handing to its agent.
const CapBranchCIRerun = "branch.ci_rerun.v1"
CapBranchCIRerun is branch.ci_rerun: re-run what failed in a branch's CI, on GitHub Actions or through a CI integration.
const CapBranchGit = "branch.git.v1"
CapBranchGit is branch.git: git commands run in a branch's worktree for the TUI's git panel, and what they left unfinished.
const CapBranchPreviews = "branch.previews.v1"
CapBranchPreviews is a branch's deploy previews (Vercel, Netlify): branch.previews, branch.deploy_log, branch.redeploy and branch.promote, and branch.ci_log falling back to a failed build when no CI failed.
const CapBranchPrune = "branch.prune.v1"
CapBranchPrune is branch.stale and branch.prune: local branches nobody has committed to for a while, and deleting them.
const CapBranchPruneMerged = "branch.prune.merged.v1"
CapBranchPruneMerged is branch.stale's Merged: the branches the base already has, whatever their age. An older server ignores the field and answers with its old branches, which is not the same list.
const CapBranchRebase = "branch.push.rebase.v1"
CapBranchRebase is branch.push taking Rebase: a push the remote is ahead of comes back as push_rejected, and asking again with Rebase takes those commits, puts the branch's own on top and pushes.
const CapBranchRebased = "branch.rebased.v1"
CapBranchRebased is branch.rebased and branch.rebase_undo: a branch's newest rebase read back — each commit before and after, and what resolving its conflicts changed — then pushed over the old branch with a lease (BranchPushParams.Over) or undone.
const CapBranchResolving = "branch.resolving.v1"
CapBranchResolving is branch.resolving and WorktreeInfo.Resolve: which agent was asked to resolve a branch's conflict with the base — by the person or the autopilot — kept while the conflict is there, so a client can say the agent is at it rather than that the branch is stuck.
const CapBranchStage = "branch.stage.v1"
CapBranchStage is branch.stage — files or hunks put in the index (git add) or taken out — and branch.commit's Staged, committing what is in the index and nothing else.
const CapCIRerun = "ci.rerun.v1"
CapCIRerun is ci.rerun: a failed run's failed jobs run again, through gh on the machine the project is on.
const CapCISources = "ci.sources.v1"
CapCISources is branch.ci_log reading a failure from a CI integration (CircleCI, GitLab CI, …) when GitHub Actions has none, and saying in BranchCILog.Source whose it was.
const CapCIStats = "ci.stats.v1"
CapCIStats is ci.stats: a project's GitHub Actions history over a period of days, added up for the CI panel — pass rate, run and queue times, runs per day, each job's time, flaky jobs, failures to re-run.
const CapCloudAgent = "cloud.agent.v1"
CapCloudAgent says the server runs inside a Conch Cloud machine, with `conch cloud agent` beside it (cloud.agent.register): an agent it starts is given the account's env-mode secrets, which the cloud agent fetches for that start and nobody writes down. Only a server with a cloud agent registered announces it, so it is optional: every other server of this build leaves it out.
const CapCommitShow = "project.commit.v1"
CapCommitShow is project.commit: one commit whole (its message and the files it changed), what changed between two commits, or one file's diff in either — a commit graph's side panel.
const CapFSFiles = "fs.files.v1"
CapFSFiles is fs.list taking Root and Files: a checkout's files, confined to it, with git status. An older server answers with folders only.
const CapFSFind = "fs.find.v1"
CapFSFind is fs.find: the files of a checkout whose path matches a few letters, for a search box — git's list of them, so what it ignores stays out, as the files view leaves it out.
const CapFSLines = "fs.lines.v1"
CapFSLines is a big file read by its lines (fs.lines) and edited a range at a time (fs.write_range), and fs.read taking Whole: a file up to FSWriteMax read in one piece, so it can be edited and saved.
const CapFSOps = "fs.ops.v1"
CapFSOps is fs.rename, fs.copy and fs.delete in a checkout, and fs.mkdir taking Root. An older server takes fs.mkdir's Path from the home folder and ignores Root, so a client asks first.
const CapFSRead = "fs.read.v1"
CapFSRead is fs.read: the start of a file in a checkout, for a preview.
const CapFSReplace = "fs.replace.v1"
CapFSReplace is fs.replace: what fs.search found, replaced file by file, each checked against the content it was searched in.
const CapFSSSH = "fs.ssh.v1"
CapFSSSH is the files of a host a terminal is logged in to with ssh: PaneInfo.SSH names the host, and fs.list, fs.read, fs.mkdir, fs.upload and fs.download take SSH, the pane, to reach that host's files instead of this machine's — through sftp, so nothing of conch's is needed there.
const CapFSSearch = "fs.search.v1"
CapFSSearch is fs.search: a checkout searched for text in its files and for files by name, or one file searched from an offset, a piece at a time, which is how a file too big to open whole is searched.
const CapFSTransfer = "fs.transfer.v1"
CapFSTransfer is copying files and folders to and from the machine, and browsing all of it: fs.list with Files and fs.read without a Root reach anywhere, fs.upload takes Dir, Archive and Replace, and fs.download and fs.download_read bring a file or folder back. An older server ignores Dir and would put the file in its uploads folder instead, so a client asks first.
const CapFSWrite = "fs.write.v1"
CapFSWrite is fs.write: a file in a checkout saved from an editor, and FSReadResult.Hash, the content's fingerprint a save is checked against so it never writes over what changed on disk since it was read (an agent at work in the same files).
const CapFrameCursor = "pane.frame.cursor.v1"
CapFrameCursor is Frame.Cursor: where the cursor is, as well as drawn in, for a client that places something at it — an input method's candidates. A frame from an older server has none.
const CapGroupTask = "group.task.v1"
CapGroupTask is group.task and group.task.remove: one task across a group's repos — the same branch in a worktree of each, gathered in a task folder, with one agent given them all or an agent in each.
const CapGroupTaskMerge = "group.task.merge.v1"
CapGroupTaskMerge is group.task.merge: a task's pull requests merged once every one of them is green, one repo after another in the order given, by the server so it carries on with no client open. With it, a task's folder is also a root fs.read and fs.write take, for its CONCH-TASK.md.
const CapIntegrationDetect = "integration.detect.v1"
CapIntegrationDetect is integration.detect: which services a project uses — its code host, every CI — why conch thinks so, and whether something here reads each and has its key.
const CapIntegrationTeam = "integration.team.v1"
CapIntegrationTeam is integration.team, and integration.detect's Team: a repository's .conch/integrations.toml (names only), read once the person has said to use it, written when they tick "Save … for the team", and the Tickets and Sandboxes rows of a project's integrations.
const CapIssues = "project.issues.v1"
CapIssues is project.issues and task.create's Issue: work started from a GitHub issue, read through gh on the machine the project is on.
const CapLibraryFetch = "agent.library.fetch.v1"
CapLibraryFetch is agent.library.fetch: a skill downloaded from GitHub into the library, on the machine whose agents will read it.
const CapLibraryKeychain = "agent.library.keychain.v1"
CapLibraryKeychain says this server gives every pane it starts the tokens the library's servers refer to (${VAR}) from this Mac's Keychain (service conch-mcp, account the variable), so a client may keep a token there rather than ask the person to export it. Only a server that can reach a Keychain claims it.
const CapLibraryPlain = "agent.library.plain.v1"
CapLibraryPlain says agent.library takes a server marked plain: its environment and headers may hold a token as it is, written into each agent's file, for somebody who chose that over the Keychain. An older server refuses such a value, so a client offers it only here.
const CapPRCheckRerun = "pr.check.rerun.v1"
CapPRCheckRerun is PRCheck.Rerun: whether what conch reads that check with can run it again — GitHub Actions, or an integration whose file has [rerun]. A client offers Re-run only for a failing check that can.
const CapPRCheckSource = "pr.check.source.v1"
CapPRCheckSource is PRCheck.Source and Readable: which service a check came from, and whether conch can read its log.
const CapPRMerge = "branch.pr_merge.v1"
CapPRMerge is branch.pr_merge: merging a branch's pull request on GitHub, through gh. An older server only merges into a local checkout, which leaves the pull request open; auto_merge needs this one.
const CapPRReview = "pr.review.v1"
CapPRReview is branch.review: submitting a review of a branch's pull request — approve, request changes or comment, with comments on lines — through gh.
const CapPaneListening = "pane.listening.v1"
CapPaneListening is PaneInfo.Listening: the TCP ports the pane's programs listen on, looked for every few seconds.
const CapPaneMonitor = "pane.monitor.v1"
CapPaneMonitor is pane.monitor and the Monitor and Alert of PaneInfo.
const CapPaneRaw = "pane.raw.v1"
CapPaneRaw is pane.raw: a pane's output as the program wrote it, for a client with a terminal of its own to feed it to — the Mac app's Ghostty — rather than frames of the screen conch keeps. It starts with a replay that rebuilds the screen and history, then each piece of output as it arrives (EventPaneOutput), with the queries conch's emulator already answers taken out, so the program is not answered twice.
const CapPaneSSH = "pane.ssh.v1"
CapPaneSSH is pane.create taking SSH, a pane logged in to a host: the command then runs on that host, through ssh with the pane's options and a terminal — how the Files view of a terminal's ssh host edits a file.
const CapPaneScope = "pane.scope.v1"
CapPaneScope is PaneInfo.CreatedBy, and the server refusing an agent's changes to panes and projects that aren't its own with ErrOutOfScope.
const CapPaneSearch = "pane.search.v1"
CapPaneSearch is pane.search: finding text in a pane's history.
const CapPaneSizeLatest = "pane.size.latest.v1"
CapPaneSizeLatest is a pane shown by several clients taking the size of the one the person last typed into, not of whichever resized last. A resize from another client is kept and applied when it is typed into.
const CapPaneTeam = "pane.team.v1"
CapPaneTeam is pane.team and PaneInfo.Team: agents grouped by team.
const CapPermissionRules = "agent.permission.v1"
CapPermissionRules is agent.permission: the server answering an agent's permission request by the person's rules, before it is asked on screen.
const CapProjectBundle = "project.bundle.v1"
CapProjectBundle is project.bundle and project.unbundle: a project with no origin moved by carrying its repository — every branch and tag in a git bundle — rather than cloning it there.
const CapProjectGitInit = "project.git_init.v1"
CapProjectGitInit is project.git_init: a project that is a plain folder made a git repository — git init and an empty first commit — so a task or a branch can be made in it.
const CapProjectGroups = "project.groups.v1"
CapProjectGroups is group.list, group.save and group.remove: projects grouped by the person because they change together — an API, its web app, their specs — each still a project of its own.
const CapProjectLog = "project.log.v1"
CapProjectLog is project.log: a project's commits across its branches and tags, with parents and refs, for a commit graph.
const CapReviewComments = "review.comments.v1"
CapReviewComments is review.*: comments on a branch's diff kept by the server, so every client of it — another TUI, the command line, the phone — sees the same ones, and review.send hands them to the branch's agent. An older server has none; a client says so rather than keep comments of its own nobody else can see. The list also carries the unresolved comments on the branch's pull request, read through gh.
const CapReviewSendTo = "review.send.to.v1"
CapReviewSendTo is review.send's Pane and New: the notes handed to the agent picked, or to a new one, rather than whichever is first on the branch — a branch like the base can have a dozen.
const CapReviewThread = "review.thread.v1"
CapReviewThread is a note that stays after it is sent — marked with whom it went to (SentTo) — and review.reply: the agent answering it, or the person answering back. review.list leaves sent notes out unless asked (ReviewRef.Sent), so a client from before still lists only what waits to be sent.
const CapSchedule = "schedule.v1"
CapSchedule is schedule.add, schedule.list and schedule.remove: a message for a running agent, or a task, kept by the server for a time to come — after a plan limit resets, overnight, every morning — so it happens whether or not anything is connected then.
const CapScopeRemote = "scope.remote.v1"
CapScopeRemote is pane.caller and scope.act_for: a scoped agent's own server says who it is, and a connection to another machine asks to be held to what that agent started there.
const CapServerHeap = "server.heap.v1"
CapServerHeap is server.heap: the server writes its heap and its goroutines to files on its own machine and says how much memory it holds. It is how a server that keeps growing is looked into without stopping it — two snapshots an hour apart, compared with go tool pprof -base, name the code holding what was added.
const CapSessionHandoff = "session.handoff.v1"
CapSessionHandoff is session.export and session.share taking a Doc: a conversation handed to an agent on another machine.
const CapSessionStar = "session.star.v1"
CapSessionStar is session.star: a session kept as one to come back to, marked in the Sessions view and listed before the rest. The mark is conch's, kept beside the server's own state — an agent's saved conversations are the agent's files, and conch does not write in them.
const CapSystemStats = "system.stats.v1"
CapSystemStats is system.stats: the whole machine the server runs on — its CPU, each core, memory and where it goes, load, disk, and the heaviest processes, each one conch started named by its pane. The resource monitor shows what conch uses; this is for the window that shows everything else beside it, on any machine conch reaches.
const CapTaskAfter = "schedule.after.v1"
CapTaskAfter is ScheduledItem.After: a task held back until another — a branch, or a task still on the schedule — has finished, then started on top of that branch's commits. An older server would start it at once, so a client refuses -after without it.
const CapTaskName = "task.name.v1"
CapTaskName is task.create taking Name: the task's pane named as it starts. A server without it drops the field, so clients rename instead.
const CapTicketCheck = "ticket.check.v1"
CapTicketCheck is ticket.check: whether each tracker — GitHub through gh, Linear, Jira — can be reached with what this server has, whose the key is, what it can see and how many tickets are open, for Settings to say a key works before anything is asked of it.
const CapTicketOverview = "ticket.overview.v1"
CapTicketOverview is ticket.overview: every project's open tickets — GitHub issues and its Linear or Jira tickets — with what conch is doing about each, for the Tickets view.
const CapTickets = "tickets.v1"
CapTickets is project.tickets, ticket.get, ticket.update and task.create's Ticket: work started from a Linear or Jira ticket, and the ticket commented on, moved and linked to its branch or pull request — all through the tracker's API with the key on the machine the project is on ([trackers] in its config.toml).
const CapUsageAccounts = "usage.history.accounts.v1"
CapUsageAccounts is usage.history by account, with hours and days.
const CapUsageHistory = "usage.history.v1"
CapUsageHistory is usage.history: what each agent on the machine used over the last day, week and month, by model, read from the conversations it saved.
const CapView = "view.v1"
CapView is view.state, view.get and view.show: what a TUI is showing — its tabs, their splits and which pane has the keyboard — published by the TUI and read back by anything else, and a request to show a set of panes together. The server keeps no opinion of its own about layout; it carries the TUI's and passes requests back, because panes are the server's and the arrangement of them is the TUI's.
const CapWorktreeMove = "worktree.move.v1"
CapWorktreeMove is moving a worktree to another machine: worktree.have, worktree.describe, worktree.pack, worktree.pack_read, worktree.unpack and project.clone.
const CapWorktreeOperation = "worktree.operation.v1"
CapWorktreeOperation is WorktreeInfo.Operation, and a worktree mid-rebase carrying the branch being rebased as its Branch: git detaches HEAD until the rebase ends, and the agents in it showed under no branch.
const CapWorktreeSetup = "worktree.setup.v1"
CapWorktreeSetup is a project's setup command (project.set_setup), run in a terminal of its own in every new worktree, and the block of ports each worktree is given (CONCH_PORT, WorktreeInfo.Port). An older server runs no setup and gives no ports, so a client says so rather than wait for a terminal that will never start.
const CapWorktreeWatch = "worktree.watch.v1"
CapWorktreeWatch is announced only by a server that really got its file watches: without it clients poll instead.
const CheckPrefix = "check · "
CheckPrefix names the terminal a project's check runs in, whether the server or a TUI started it: a TUI knows the server's by the name.
const DefaultWIP = 3
DefaultWIP is how many agents a project runs before queued tasks wait: about as many as one person can review at once.
const FSReadMax = 256 << 10
FSReadMax is the most fs.read returns at once: enough for a preview.
const FSSearchBudget = time.Second
FSSearchBudget is how long a search of one Path goes on before it answers with what it has and where it got to.
const FSWriteMax = 4 << 20
FSWriteMax is the most an fs.write takes: a file worth editing in a window, not a dump.
const MethodServerHeap = "server.heap"
MethodServerHeap answers a ServerHeap (server.heap.v1).
const MethodSystemStats = "system.stats"
MethodSystemStats answers a SystemStats (system.stats.v1).
const PortBlock = 10
PortBlock is how many ports a worktree is given, from CONCH_PORT on: enough for a web server, an API and a database of its own.
const ProtocolVersion = 1
ProtocolVersion is bumped on incompatible wire changes. Additive changes are advertised through Capabilities instead.
const ReviewGitHub = "github"
ReviewGitHub is the Source of a pull request's comment.
const ReviewQuoteLines = 40
ReviewQuoteLines bounds how much of a hunk a review comment keeps: enough to say where, not a whole file rewritten.
const ReviewerPrefix = "review · "
ReviewerPrefix names a reviewer's pane — the agent [verify] reviewer starts on a finished branch to read its diff and report — which is how conch knows one again, after a restart too: it is not the branch's writer, and it is closed once its report has gone where it was for.
const TicketCountMax = 100
TicketCountMax is the most tickets a check counts.
const TriagePrefix = "triage · "
TriagePrefix starts the name of an agent the server started to triage an issue: it reads and reports, like a reviewer, so it is not counted as work under way.
const UploadChunkSize = 512 << 10
UploadChunkSize is how much of a file one fs.upload request carries. Small chunks keep pane output flowing over the same connection during an upload.
Variables ¶
var Capabilities = []string{}/* 118 elements not displayed */
Capabilities advertised by this build during the hello handshake. Add one whenever the server gains something clients rely on: clients use the list to detect a server started by an older build.
var CheckEnv = []string{"GIT_PAGER=cat", "PAGER=cat"}
CheckEnv is added to a check's environment. A check runs in a terminal nobody may be looking at, so a git command in it that pages — grep, diff, log — would sit in less until somebody pressed q.
var OptionalCapabilities = []string{CapWorktreeWatch, CapLibraryKeychain, CapCloudAgent}
OptionalCapabilities are those a server of this very build may still leave out, because the machine it runs on cannot give them (no file watches, say). Their absence says nothing about the build, so it must not make the server look old: that server was shown as needing a reload for ever, and reloading it changes nothing. A client that relies on one asks for it by name, as it would any other.
var Version = "0.2.1-dev"
Version is the conch release version, set at release time with -ldflags "-X github.com/Amitgb14/conch/internal/proto.Version=0.2.0".
Functions ¶
func BuildCapabilities ¶ added in v0.2.0
func BuildCapabilities() []string
BuildCapabilities is what every server of this build announces: Capabilities without the optional ones. A server lacking any of these is from an older build.
func CIFailurePrompt ¶ added in v0.1.9
func CIFailurePrompt(log BranchCILog) string
CIFailurePrompt is FailurePrompt for a failed CI run, with a link to it.
func FailurePrompt ¶ added in v0.1.9
FailurePrompt is what the agent is told: which command, how it ended, its output, and what is wanted — a fix proved by running it again.
func FailureTail ¶ added in v0.1.9
FailureTail is the end of a check's output: blank lines at the bottom dropped, escape codes stripped, at most failureTailLines lines and failureTailBytes bytes, cut at a line.
func IsPaneID ¶ added in v0.1.6
IsPaneID reports whether ref has the shape of a pane ID ("p" and a number). Commands take a pane's name in place of its ID, so a name of that shape is refused: it would stand for another pane.
func IsRelease ¶
func IsRelease() bool
IsRelease reports whether Version names a published release rather than a development build.
func IsReviewer ¶ added in v0.2.0
IsReviewer reports whether p is a reviewer's pane.
func Marshal ¶
func Marshal(v any) json.RawMessage
Marshal encodes v, panicking only on programmer error (unencodable types).
func PRChecks ¶ added in v0.1.9
func PRChecks(b BranchInfo) string
PRChecks is a branch's CI as conch compares it, the server and the TUI alike: the checks of an open pull request, and "" for a branch with none. A closed or merged pull request is not somebody's move any more, so its checks are not either.
func QuoteHunk ¶ added in v0.1.9
QuoteHunk is what a review comment keeps of a hunk: its header and first ReviewQuoteLines lines, and a line saying how many more there were. A client finds the comment on a hunk by quoting the hunk the same way.
A hunk quoted already is left as it is, so the server and a client agree whichever of them quoted it.
func ReviewAuthor ¶ added in v0.1.9
func ReviewAuthor(c ReviewComment) string
ReviewAuthor is who wrote a comment, for people: "" for the person at the keyboard, an agent's pane, or a reviewer on GitHub.
func ReviewPrompt ¶ added in v0.1.9
func ReviewPrompt(branch string, comments []ReviewComment) string
ReviewPrompt is the message a branch's agent gets for its comments: each numbered, with where it is, who said it and the hunk it is about, and a pull request's replies after it.
func ReviewWhere ¶ added in v0.1.9
func ReviewWhere(c ReviewComment) string
ReviewWhere is where a comment is, for people: the file and its line or hunk, or the pull request as a whole for a review's own words.
func ReviewerDone ¶ added in v0.2.0
ReviewerDone reports whether p is a reviewer that has finished its report: running, its agent idle or done, and not stopped by an error — one still reading, asking, or failed is left for somebody to look at.
Types ¶
type AccountAddParams ¶ added in v0.2.1
type AccountAddParams struct {
Agent string `json:"agent"`
Name string `json:"name"`
Dir string `json:"dir,omitempty"`
}
AccountAddParams makes Agent an account called Name, in Dir or a folder of conch's.
type AccountFailoverParams ¶ added in v0.2.1
type AccountFailoverParams struct {
At int `json:"at"`
// Agent sets that agent's own line rather than every agent's
// (CapAccountFailoverAgent); with Shared it takes the agent's own line
// away, so it follows every agent's again, and At is not read.
Agent string `json:"agent,omitempty"`
}
AccountFailoverParams sets the failover line, in percent; 0 is off.
type AccountInfo ¶ added in v0.2.1
type AccountInfo struct {
Agent string `json:"agent"`
Name string `json:"name"`
Dir string `json:"dir,omitempty"`
Default bool `json:"default,omitempty"`
// Limits is what the account's agents last reported of its plan.
Limits *PlanLimits `json:"limits,omitempty"`
// Agents is how many agents run on it now.
Agents int `json:"agents,omitempty"`
// SignedIn says whether the account has been signed in to, from the
// record the agent writes when it is (never its token); absent when
// the server cannot tell, or is older.
SignedIn *bool `json:"signed_in,omitempty"`
}
AccountInfo is one account. The agent's own is listed too, with Name "" and Default set, so its limits sit beside the others'.
type AccountList ¶ added in v0.2.1
type AccountList struct {
Accounts []AccountInfo `json:"accounts"`
Pins []AccountPin `json:"pins,omitempty"`
FailoverAt int `json:"failover_at,omitempty"`
Agents []string `json:"agents,omitempty"`
// FailoverFor is each agent's own line, where one has one
// (CapAccountFailoverAgent); the rest follow FailoverAt.
FailoverFor map[string]int `json:"failover_for,omitempty"`
}
AccountList is the result of account.list. Agents names the agents that can have accounts; the others keep their own.
type AccountPin ¶ added in v0.2.1
AccountPin is a folder whose agents start on an account by that name.
type AccountPinParams ¶ added in v0.2.1
type AccountPinParams struct {
Path string `json:"path"`
Account string `json:"account,omitempty"`
}
AccountPinParams pins Path to Account; "" unpins it.
type AccountRef ¶ added in v0.2.1
AccountRef names an account.
type ActForParams ¶ added in v0.1.6
type ActForParams struct {
ID string `json:"id"`
Label string `json:"label,omitempty"`
Agent string `json:"agent,omitempty"`
}
ActForParams holds a connection to what the agent CallerInfo names started on this machine. It can only narrow what the connection may do, so the server takes it at its word; it can't be changed once given.
type AgentAttachParams ¶ added in v0.2.1
type AgentAttachParams struct {
ID string `json:"id"`
}
AgentAttachParams asks for a folder for one message's attachments in the checkout of the agent in pane ID.
type AgentAttachResult ¶ added in v0.2.1
type AgentAttachResult struct {
Dir string `json:"dir"`
Root string `json:"root"`
Cwd string `json:"cwd"`
MaxSize int64 `json:"max_size"`
MaxFiles int `json:"max_files"`
}
AgentAttachResult is that folder (Dir, absolute), the checkout it is in (Root) and the agent's own folder (Cwd), against which a path in the message is given. MaxSize and MaxFiles are the limits a client keeps to.
type AgentAvailability ¶
type AgentAvailability struct {
Name string `json:"name"`
Label string `json:"label,omitempty"` // e.g. "Claude Code"
Installed bool `json:"installed"`
Path string `json:"path,omitempty"`
Version string `json:"version,omitempty"`
// Tier is how far conch's support goes: "supported" for an agent with
// an adapter, detection taken from the real thing and sessions that
// list and resume, or "runs here" for one described by a manifest,
// which conch starts and detects and no more. Empty from a server too
// old to have tiers, where every agent it offers is supported.
Tier string `json:"tier,omitempty"`
// NoInstaller says conch cannot install this one: a manifest that
// named no install script. Written the negative way round so that a
// server too old to say it reads as "conch can install it", which is
// what every agent such a server offers.
NoInstaller bool `json:"no_installer,omitempty"`
}
AgentAvailability is whether an agent conch can launch is installed on the server's machine.
type AgentBackgroundStopParams ¶ added in v0.2.1
AgentBackgroundStopParams names a job to end: a pane and one of the pids in its agent's Jobs.
type AgentBroadcastParams ¶
type AgentBroadcastParams struct {
IDs []string `json:"ids"`
Text string `json:"text"`
Shells bool `json:"shells,omitempty"`
}
AgentBroadcastParams sends Text to the running panes IDs and submits it: an agent gets it as its next message. A pane that isn't running an agent would run Text as a command, so it is skipped unless Shells is set.
type AgentBroadcastResult ¶
type AgentBroadcastResult struct {
Results []BroadcastOutcome `json:"results"`
}
AgentBroadcastResult reports, per pane, whether the message was sent.
type AgentChat ¶ added in v0.2.0
type AgentChat struct {
Agent string `json:"agent"`
Session string `json:"session,omitempty"`
Turns []ChatTurn `json:"turns"`
Note string `json:"note,omitempty"`
// Epoch and Ver name what the chat now has, to send next time; Reset
// says Turns are the whole of it rather than what changed.
Epoch string `json:"epoch,omitempty"`
Ver int64 `json:"ver,omitempty"`
Reset bool `json:"reset,omitempty"`
}
AgentChat is a pane's agent's conversation, newest last. Session is empty, and Turns with it, until the agent says which conversation it is in; Note says why a chat has nothing in it when it is not merely new.
type AgentChatParams ¶ added in v0.2.0
type AgentInstallParams ¶
type AgentInstallParams struct {
Agent string `json:"agent"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
}
AgentInstallParams installs an agent for the server's user. The installer runs in a new pane (returned) so its progress and errors are visible.
type AgentInterruptParams ¶ added in v0.2.1
AgentChatParams asks for a pane's chat. A chat that has some sends the log's Epoch and Ver it has, and is sent only what is new or changed since; without them (or from another log) it is sent the newest turns with Reset. AgentInterruptParams stops what the agent in pane ID is doing: its own interrupt key (escape, or escape twice for an agent that asks for it), or with Hard ctrl+c.
type AgentInterruptResult ¶ added in v0.2.1
type AgentInterruptResult struct {
ID string `json:"id"`
Keys []string `json:"keys"`
State string `json:"state,omitempty"`
}
AgentInterruptResult says which keys were sent and the agent's state just after: often still working, since an agent takes a moment to stop; pane.updated says when it has.
type AgentLibraryParams ¶ added in v0.1.6
type AgentLibraryParams struct {
Set *Library `json:"set,omitempty"`
Import string `json:"import,omitempty"`
}
AgentLibraryParams asks for the library and where it stands. Set saves a new library first, and Import takes an agent's servers and skills into it first; neither writes to any agent.
type AgentLibraryResult ¶ added in v0.1.6
type AgentLibraryResult struct {
Library Library `json:"library"`
Cells []LibraryCell `json:"cells,omitempty"`
Agents []string `json:"agents"`
Undos []string `json:"undos,omitempty"`
Imported []string `json:"imported,omitempty"`
Skipped []string `json:"skipped,omitempty"`
}
AgentLibraryResult is the library, where each item stands with each agent, and what an import took and left out.
type AgentLimitsResult ¶
type AgentLimitsResult struct {
Limits []PlanLimits `json:"limits"`
}
AgentLimitsResult is the result of agent.limits.
type AgentPromptParams ¶ added in v0.1.6
AgentPromptParams submits Text to the agent in pane ID as its next message.
type AgentPromptResult ¶ added in v0.1.6
type AgentPromptResult struct {
ID string `json:"id"`
Agent string `json:"agent"`
Turn int `json:"turn"`
}
AgentPromptResult says which work answers the message: the agent's Turn reaching Turn. An agent already working when it was sent is given the message when that work ends, so its current Turn counts.
type AgentReply ¶ added in v0.1.9
type AgentReply struct {
Agent string `json:"agent"`
Text string `json:"text"`
Time time.Time `json:"time,omitempty"`
}
AgentReply is the last answer of a pane's agent and when it was given.
type AgentReportParams ¶
type AgentReportParams struct {
ID string `json:"id"`
Agent string `json:"agent"`
Event string `json:"event"`
NotificationType string `json:"notification_type,omitempty"`
Message string `json:"message,omitempty"`
SessionID string `json:"session_id,omitempty"`
TranscriptPath string `json:"transcript_path,omitempty"`
// SubagentStart and SubagentStop name the subagent they are about.
AgentID string `json:"agent_id,omitempty"`
AgentType string `json:"agent_type,omitempty"`
// TaskDescription is what a SubagentStart's subagent was asked to do,
// from Claude builds that say.
TaskDescription string `json:"task_description,omitempty"`
// From Claude's status line input: plan limits and the context window.
Limits *PlanLimits `json:"limits,omitempty"`
ContextUsed int `json:"context_used,omitempty"`
ContextSize int `json:"context_size,omitempty"`
}
AgentReportParams is a lifecycle event from an agent integration (hook).
type AgentSetup ¶
type AgentSetup struct {
Agent string `json:"agent"`
Label string `json:"label"`
Groups []SetupGroup `json:"groups"`
Notes []string `json:"notes,omitempty"`
}
AgentSetup is what one agent loads.
type AgentSetupParams ¶
AgentSetupParams asks what agents load when started in Dir. Agent limits the answer to one agent; "" means every agent conch knows.
type AgentSetupResult ¶
type AgentSetupResult struct {
Dir string `json:"dir"`
ProjectID string `json:"project_id,omitempty"`
Main string `json:"main,omitempty"` // main checkout, when Dir is in a linked worktree
Worktree string `json:"worktree,omitempty"` // that linked worktree's root
LocalFiles []LocalFile `json:"local_files,omitempty"`
Agents []AgentSetup `json:"agents"`
}
AgentSetupResult describes the instructions, skills and tools agents pick up in a directory. For a linked worktree, items the main checkout has but the worktree lacks are included with Missing set.
type AgentSkillParams ¶ added in v0.1.6
type AgentSkillParams struct {
Agents []string `json:"agents,omitempty"`
// Skills names which of conch's skills (conch, conch-review, …); all
// of them when empty (agent.skill.pick.v1).
Skills []string `json:"skills,omitempty"`
Remove bool `json:"remove,omitempty"`
Apply bool `json:"apply,omitempty"`
}
AgentSkillParams installs conch's skill for Agents (all it knows, when empty), or with Remove takes conch's copy away. Without Apply nothing is written: the result says what would be.
type AgentSkillResult ¶ added in v0.1.6
type AgentSkillResult struct {
Changes []SkillChange `json:"changes"`
Applied bool `json:"applied,omitempty"`
}
AgentSkillResult is what happens to each SKILL.md.
type AgentStatus ¶
type AgentStatus struct {
Name string `json:"name"`
State string `json:"state"`
Source string `json:"source,omitempty"` // hook or screen
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
SessionID string `json:"session_id,omitempty"`
Since time.Time `json:"since"`
Tokens *Tokens `json:"tokens,omitempty"`
// Failed means the last request ended with an error, not an answer.
Failed bool `json:"failed,omitempty"`
// Turn counts the times the agent started working in this pane, so a
// client that prompted it can tell the end of that work from a state
// left over from before. It starts again from zero when the server
// reloads, and servers without agent.prompt.v1 leave it zero.
Turn int `json:"turn,omitempty"`
// Subagents are the agents this one has running inside its own
// process — Claude Code's Agent tool — which have no pane of their
// own. Servers from before them send none.
Subagents []Subagent `json:"subagents,omitempty"`
// Background counts what the agent left running below it while it is
// not working — a dev server, a test watcher, a background shell — and
// Jobs says what each is (agent.background.v1). Both are empty while it
// works, since then its children are the work, and from older servers.
Background int `json:"background,omitempty"`
Jobs []BackgroundJob `json:"jobs,omitempty"`
}
AgentStatus is what the server believes an agent is doing.
func (*AgentStatus) NeedsAttention ¶
func (a *AgentStatus) NeedsAttention() bool
NeedsAttention reports whether the agent is waiting on the user.
type AgentStatusResult ¶
type AgentStatusResult struct {
Agents []AgentAvailability `json:"agents"`
}
AgentStatusResult is the result of agent.status.
type AgentSyncParams ¶ added in v0.1.5
type AgentSyncParams struct {
Dir string `json:"dir"`
// User syncs the setup in your home rather than a checkout's: the
// instructions, skills and servers that follow you from project to
// project. Dir is then only what a message calls the place.
User bool `json:"user,omitempty"`
From string `json:"from,omitempty"`
To []string `json:"to,omitempty"`
Apply bool `json:"apply,omitempty"`
Undo bool `json:"undo,omitempty"`
Stamp string `json:"stamp,omitempty"`
}
AgentSyncParams gives the agents in To the setup From has in the checkout at Dir. With Apply false nothing is written: the changes are what it would do. Undo puts a sync back instead — Stamp names which, and "" is the last one.
type AgentSyncResult ¶ added in v0.1.5
type AgentSyncResult struct {
Dir string `json:"dir"`
From string `json:"from,omitempty"`
To []string `json:"to,omitempty"`
Applied bool `json:"applied,omitempty"`
Undone bool `json:"undone,omitempty"`
Changes []SyncChange `json:"changes,omitempty"`
Notes []string `json:"notes,omitempty"`
// Undo is the record this apply left behind, to put it back with.
Undo string `json:"undo,omitempty"`
// Undos are the syncs of this checkout that can still be undone,
// newest first.
Undos []string `json:"undos,omitempty"`
}
AgentSyncResult is what a sync would do, did, or put back.
type AgentUsage ¶ added in v0.1.9
type AgentUsage struct {
Agent string `json:"agent"`
Periods []UsagePeriod `json:"periods"`
// Account is which of the agent's accounts, when asked for by account
// (CapUsageAccounts): "" for the agent's own.
Account string `json:"account,omitempty"`
// Hours is the last 24 hours an hour at a time and Days the last 30
// days a day at a time, oldest first, each with what each model used:
// for charting, when asked for by account.
Hours []UsageBucket `json:"hours,omitempty"`
Days []UsageBucket `json:"days,omitempty"`
}
AgentUsage is one agent's periods, shortest first.
type AutopilotActivity ¶ added in v0.2.1
type AutopilotActivity struct {
Notes []AutopilotNote `json:"notes"`
}
AutopilotActivity is the autopilot's notes, newest first.
type AutopilotActivityParams ¶ added in v0.2.1
type AutopilotActivityParams struct {
ProjectID string `json:"project_id,omitempty"`
Limit int `json:"limit,omitempty"`
}
AutopilotActivityParams asks for what the autopilot did, newest first: in one project, or everywhere when ProjectID is empty; Limit at most (100 when 0).
type AutopilotBranch ¶ added in v0.1.9
type AutopilotBranch struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
// Fixes is how many failures went back to its agent since it last
// passed.
Fixes int `json:"fixes,omitempty"`
// Waiting is a green pull request waiting to merge, and Held what
// last kept it back.
Waiting bool `json:"waiting,omitempty"`
Held string `json:"held,omitempty"`
// CheckFailed is the project's own check failing at the branch's
// current commit.
CheckFailed bool `json:"check_failed,omitempty"`
// Checking is the terminal the server is running the check in.
Checking string `json:"checking,omitempty"`
// Unshipped is what keeps a finished branch from being pushed or
// given a pull request (auto_pr).
Unshipped string `json:"unshipped,omitempty"`
// Conflicting is a pull request that conflicts with its base, and
// Resolves how many times its agent has been asked to resolve it.
Conflicting bool `json:"conflicting,omitempty"`
Resolves int `json:"resolves,omitempty"`
}
AutopilotBranch is one branch the server is minding.
type AutopilotCheck ¶ added in v0.1.9
type AutopilotCheck struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Pane string `json:"pane,omitempty"`
Command string `json:"command,omitempty"`
Exit int `json:"exit"`
}
AutopilotCheck is how a project's own check on a branch ended: Exit from the terminal it ran in, Pane, whose output the server reads to hand a failure to the agent, and Command, to name it there.
type AutopilotNote ¶ added in v0.1.9
type AutopilotNote struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Text string `json:"text"`
Error bool `json:"error,omitempty"`
Merged bool `json:"merged,omitempty"`
// Kind is what the autopilot was doing (an Activity… word) and At
// when; both absent from an older server.
Kind string `json:"kind,omitempty"`
At time.Time `json:"at,omitempty"`
// CI is the failed run a note is about, when it is about one: whose
// it was and what failed in it (CapAutopilotNoteCI).
CI *NoteCI `json:"ci,omitempty"`
}
AutopilotNote is something the server did on its own, or held back from, said once. Merged marks a pull request it merged, so a client re-reads what it shows of that branch.
type AutopilotPolicy ¶ added in v0.1.9
type AutopilotPolicy struct {
// AutoFix is how many failures in a row — CI or the project's own
// check — go back to a branch's agent by themselves. 0 sends none.
AutoFix int `json:"auto_fix,omitempty"`
// AutoMerge merges a pull request on GitHub when its checks turn
// green and nothing holds it back.
AutoMerge bool `json:"auto_merge,omitempty"`
// AutoPR pushes a branch whose agent has finished — once its check
// passes, where the project has one — and opens a pull request for
// it, or pushes the new commits to the one already open.
AutoPR bool `json:"auto_pr,omitempty"`
// AutoResolve is how many times in a row a pull request that
// conflicts with its base goes back to the branch's agent to resolve,
// once the server's own rebase onto the base has stopped on the
// conflict. 0 leaves conflicts alone.
AutoResolve int `json:"auto_resolve,omitempty"`
// RequireTests opens a pull request whose branch changes code and no
// test as a draft — which auto_merge does not merge — and asks the
// agent to add one; MaxDiff does the same for one that changes more
// lines than it says (0 is no limit). Once they are met, a later push
// marks it ready.
RequireTests bool `json:"require_tests,omitempty"`
MaxDiff int `json:"max_diff,omitempty"`
// Checks is each project's own check, by project ID: what the server
// runs in a branch's worktree when its agent finishes.
Checks map[string]string `json:"checks,omitempty"`
// Intake is each project's label, by project ID: an open GitHub issue
// with it is taken as a queued task by itself (CapAutopilotIntake) —
// conch task -queue -issue N, with nobody handing it in — and
// IntakeWIP is how many agents may be busy in the project before the
// next waits (0: DefaultWIP). An older server ignores both.
Intake map[string]string `json:"intake,omitempty"`
IntakeWIP int `json:"intake_wip,omitempty"`
// Triage is each project's label asking for triage, by project ID
// (CapAutopilotTriage): an agent reads each open issue with it, without
// changing anything, comments what done means, its size and the files
// it touches, and labels it ready (Intake's label), needs-info or
// too-big. TriageAgent reads (claude when empty); TriageCommentOnly
// comments and leaves the labels alone.
Triage map[string]string `json:"triage,omitempty"`
TriageAgent string `json:"triage_agent,omitempty"`
TriageCommentOnly bool `json:"triage_comment_only,omitempty"`
}
AutopilotPolicy is what a server does on its own (CapAutopilot): the [verify] settings of whoever's TUI last handed them over, kept by the server so they outlive that TUI.
type AutopilotState ¶ added in v0.1.9
type AutopilotState struct {
Policy AutopilotPolicy `json:"policy"`
Branches []AutopilotBranch `json:"branches,omitempty"`
}
AutopilotState answers autopilot.get and autopilot.set.
type BackgroundJob ¶ added in v0.2.1
type BackgroundJob struct {
PID int `json:"pid"`
Command string `json:"command"`
Since time.Time `json:"since"`
Ports []int `json:"ports,omitempty"`
}
BackgroundJob is one program an agent left running: the process below the agent that started it, with the ports it and its children listen on.
type BranchCILog ¶ added in v0.1.9
type BranchCILog struct {
Workflow string `json:"workflow,omitempty"`
URL string `json:"url,omitempty"`
Log string `json:"log"`
// Source is whose run it was — "github-actions", or a CI integration's
// name — and Service how people write it; Job what failed in it, where
// the service says. Absent from servers before CapCISources.
Source string `json:"source,omitempty"`
Service string `json:"service,omitempty"`
Job string `json:"job,omitempty"`
}
BranchCILog is a branch's newest failed Actions run — at its pull request's head commit, when it has one — and the end of what its failed steps printed.
type BranchCILogParams ¶ added in v0.1.9
type BranchCILogParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
}
BranchCILogParams names the branch whose failed CI run to read.
type BranchCIRerun ¶ added in v0.2.1
type BranchCIRerun struct {
Source string `json:"source"`
Service string `json:"service,omitempty"`
Run string `json:"run"`
URL string `json:"url,omitempty"`
// Runs is every run re-run when there was more than one (several
// workflows failed at the head), Run first among them; an older
// server re-ran only Run.
Runs []string `json:"runs,omitempty"`
// Note says what could not be re-run, when some of the runs were.
Note string `json:"note,omitempty"`
}
BranchCIRerun says what was re-run.
type BranchCommitParams ¶ added in v0.1.1
type BranchCommitParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Message string `json:"message"`
Files []string `json:"files,omitempty"`
Patch string `json:"patch,omitempty"`
// Staged commits what is in the index and nothing else, as git commit
// does; Files and Patch are left out (branch.stage.v1).
Staged bool `json:"staged,omitempty"`
}
BranchCommitParams commits the uncommitted changes where Branch is checked out: every change, or only Files (paths as in Changes; a rename needs both its paths).
With Patch — a unified diff, as project.diff returns, cut down to the chosen hunks — those hunks are staged and what is staged is committed, Files included. A Patch that no longer applies commits nothing. It needs capability branch.hunks.v1; an older server would ignore it and commit everything.
type BranchDeployDone ¶ added in v0.2.1
type BranchDeployDone struct {
Source string `json:"source"`
Service string `json:"service"`
Deploy string `json:"deploy"`
}
BranchDeployDone says what was asked of a deploy integration.
type BranchDeployParams ¶ added in v0.2.1
type BranchDeployParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Source string `json:"source,omitempty"`
Deploy string `json:"deploy,omitempty"`
}
BranchDeployParams names a branch and, for one deploy, the deploy integration (Source, its file's name) and the deploy's id. For branch.deploy_log with no Deploy, the newest failed build at the pull request's head is read.
type BranchDiscardParams ¶ added in v0.1.1
type BranchDiscardParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
DryRun bool `json:"dry_run,omitempty"`
Force bool `json:"force,omitempty"`
}
BranchDiscardParams removes Branch's linked worktree and deletes the branch. Without Force it refuses when that loses work; DryRun only reports what would be lost.
type BranchDiscardResult ¶ added in v0.1.1
type BranchDiscardResult struct {
Worktree string `json:"worktree,omitempty"`
Uncommitted []string `json:"uncommitted,omitempty"`
// Unmerged counts commits in neither the base nor the branch's upstream.
Unmerged int `json:"unmerged,omitempty"`
Done bool `json:"done,omitempty"`
}
BranchDiscardResult says what discarding a branch removes or would lose.
type BranchGitParams ¶ added in v0.1.6
type BranchGitParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Commands [][]string `json:"commands,omitempty"`
}
BranchGitParams runs Commands, one after another, in the worktree where Branch is checked out, stopping at the first that fails. Each is git's arguments without "git", starting with the subcommand. With none it only reports the worktree's state.
type BranchGitResult ¶ added in v0.1.6
type BranchGitResult struct {
Worktree string `json:"worktree"`
Output string `json:"output,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
Truncated bool `json:"truncated,omitempty"`
InProgress string `json:"in_progress,omitempty"`
}
BranchGitResult is what the commands printed, each under a "$ git …" line, and how the last one run ended. InProgress names an operation left unfinished in the worktree ("rebase", "merge", "cherry-pick", "revert", "am") so the panel can offer to continue or abort it.
type BranchInfo ¶
type BranchInfo struct {
Name string `json:"name"`
Upstream string `json:"upstream,omitempty"`
Gone bool `json:"gone,omitempty"`
Ahead int `json:"ahead,omitempty"` // vs upstream
Behind int `json:"behind,omitempty"`
BaseAhead int `json:"base_ahead,omitempty"` // vs the project's base branch
BaseBehind int `json:"base_behind,omitempty"`
Committed time.Time `json:"committed"`
Subject string `json:"subject,omitempty"`
Worktree string `json:"worktree,omitempty"` // path, when checked out
PR *PRInfo `json:"pr,omitempty"`
}
BranchInfo is a local branch.
type BranchMergeParams ¶ added in v0.1.1
type BranchMergeParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Squash bool `json:"squash,omitempty"`
Message string `json:"message,omitempty"`
}
BranchMergeParams merges Branch's commits into the project's base where the base is checked out. A merge that conflicts is undone and refused.
type BranchPRMergeParams ¶ added in v0.1.9
type BranchPRMergeParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Number int `json:"number"`
Head string `json:"head,omitempty"`
}
BranchPRMergeParams merges Branch's pull request Number on GitHub, the way the repository allows. A non-empty Head is the commit it must still be at, so a push after its checks passed is not merged unchecked.
type BranchPRMergeResult ¶ added in v0.1.9
type BranchPRMergeResult struct {
Method string `json:"method"`
}
BranchPRMergeResult says how the pull request was merged: merge, squash or rebase.
type BranchPRParams ¶ added in v0.1.1
type BranchPRParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
Draft bool `json:"draft,omitempty"`
}
BranchPRParams pushes Branch and opens a pull request into the project's base. An empty Title fills title and body from the commits.
type BranchPRResult ¶ added in v0.1.1
type BranchPRResult struct {
URL string `json:"url"`
}
BranchPRResult is the opened pull request.
type BranchPreviews ¶ added in v0.2.1
type BranchPreviews struct {
Integrations []DeploySource `json:"integrations"`
}
BranchPreviews is a branch's deploys, by the deploy integration that knows them: every one its project uses, or whose check its pull request has.
type BranchPruneParams ¶ added in v0.2.1
type BranchPruneParams struct {
ProjectID string `json:"project_id"`
Branches []PruneBranch `json:"branches"`
}
BranchPruneParams deletes local branches, each checked again first.
type BranchPruneResult ¶ added in v0.2.1
type BranchPruneResult struct {
Deleted []string `json:"deleted,omitempty"`
Failed []CleanupFailure `json:"failed,omitempty"`
}
BranchPruneResult says what was deleted, and what wasn't and why (the failure's Path is the branch's name).
type BranchPushParams ¶ added in v0.1.5
type BranchPushParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Rebase bool `json:"rebase,omitempty"`
Over string `json:"over,omitempty"`
}
BranchPushParams pushes a branch. With Rebase, a push the remote is ahead of takes the remote's commits first and puts the branch's own on top; without it such a push comes back as ErrPushRejected. It is a BranchRef with a field added, so an older server reads it as one.
Over is the commit the remote is expected to have for the branch: the push replaces it, and only it (--force-with-lease), which is how a rebased branch goes up over the one it rewrote (CapBranchRebased). An older server ignores it, and a plain push of a rewrite is rejected.
type BranchPushResult ¶ added in v0.1.5
type BranchPushResult struct {
Took int `json:"took,omitempty"`
}
BranchPushResult says what a push did: Took counts the commits a rebase brought in from the remote, 0 when nothing was taken.
type BranchRebase ¶ added in v0.2.1
type BranchRebase struct {
Branch string `json:"branch"`
Before string `json:"before"`
After string `json:"after"`
Onto string `json:"onto"`
At time.Time `json:"at,omitempty"`
Commits []RebasedCommit `json:"commits,omitempty"`
Remote string `json:"remote,omitempty"`
Diff string `json:"diff,omitempty"`
}
BranchRebase is a branch's newest rebase: its tip before and after, the commit it went onto, when, and each commit's fate. Remote is the commit the remote has for the branch as the checkout last saw it, "" when it was never pushed: Before means the push replaces the old branch, anything else that somebody pushed since.
type BranchRebaseUndoParams ¶ added in v0.2.1
type BranchRebaseUndoParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Before string `json:"before"`
After string `json:"after"`
}
BranchRebaseUndoParams puts Branch back at Before, if it is still at After.
type BranchRebased ¶ added in v0.2.1
type BranchRebased struct {
Rebases []BranchRebase `json:"rebases"`
}
BranchRebased lists the branches rebased and not pushed since.
type BranchRebasedParams ¶ added in v0.2.1
type BranchRebasedParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch,omitempty"`
Diff bool `json:"diff,omitempty"`
}
BranchRebasedParams asks for the newest rebase of each branch checked out in the project — or of Branch alone — that has not been pushed yet. Diff adds git range-diff's account of what changed.
type BranchResolvingParams ¶ added in v0.2.1
type BranchResolvingParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
PaneID string `json:"pane_id,omitempty"`
}
BranchResolvingParams names the agent (its pane) asked to resolve Branch's conflict; an empty PaneID says nobody is any more.
type BranchReviewParams ¶ added in v0.1.9
type BranchReviewParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Event string `json:"event"`
Body string `json:"body,omitempty"`
Comments []ReviewLineNew `json:"comments,omitempty"`
}
BranchReviewParams submits a review of the branch's pull request: Event (ReviewEventApprove, ReviewEventRequestChanges or ReviewEventComment), Body, and comments on lines of the pull request's diff, each on the new side.
type BranchReviewResult ¶ added in v0.1.9
BranchReviewResult says where the review went.
type BranchStageParams ¶ added in v0.1.9
type BranchStageParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Files []string `json:"files,omitempty"`
Patch string `json:"patch,omitempty"`
Unstage bool `json:"unstage,omitempty"`
}
BranchStageParams puts Files and the hunks in Patch (cut from project.diff, as BranchCommitParams' is) in the index where Branch is checked out — or, with Unstage, takes them back out, Patch then being as staged: a diff of the index. The files on disk are left as they are. A Patch that no longer applies changes nothing.
type BranchStale ¶ added in v0.2.1
type BranchStale struct {
Days int `json:"days"`
Branches []StaleBranch `json:"branches"`
// Merged says these are the merged branches, as asked; a server that
// does not know the question leaves it out.
Merged bool `json:"merged,omitempty"`
}
BranchStale is those branches, oldest first.
type BranchStaleParams ¶ added in v0.2.1
type BranchStaleParams struct {
ProjectID string `json:"project_id"`
Days int `json:"days,omitempty"`
// Merged asks instead for the branches the base already has — merged,
// squashed in, or merged on GitHub with the branch's commit — however
// recent (CapBranchPruneMerged). The base itself is never among them.
Merged bool `json:"merged,omitempty"`
}
BranchStaleParams asks for a project's local branches whose last commit is more than Days days old; 0 is 30.
type BroadcastOutcome ¶
type BroadcastOutcome struct {
ID string `json:"id"`
Sent bool `json:"sent"`
Error string `json:"error,omitempty"`
}
BroadcastOutcome is one pane's part of a broadcast.
type CIDay ¶ added in v0.2.1
type CIDay struct {
Date string `json:"date"`
Passed int `json:"passed"`
Failed int `json:"failed"`
}
CIDay is a day's finished runs; Date is YYYY-MM-DD where the server is.
type CIFlaky ¶ added in v0.2.1
type CIFlaky struct {
Name string `json:"name"`
Times int `json:"times"`
How string `json:"how"`
Last time.Time `json:"last"`
}
CIFlaky is a job, or a whole run, that failed and passed without a change.
type CIJob ¶ added in v0.2.1
type CIJob struct {
Name string `json:"name"`
Runs int `json:"runs"`
Failed int `json:"failed"`
MedianSeconds int `json:"median_seconds"`
P90Seconds int `json:"p90_seconds"`
}
CIJob is one job over the period.
type CIRerunParams ¶ added in v0.2.1
type CIRerunParams struct {
ProjectID string `json:"project_id"`
RunID int64 `json:"run_id,omitempty"`
Branch string `json:"branch,omitempty"`
}
CIRerunParams names the run whose failed jobs to run again, or a branch whose newest failed run (at its pull request's head) it is.
type CIRerunResult ¶ added in v0.2.1
type CIRerunResult struct {
RunID int64 `json:"run_id"`
}
CIRerunResult is the run started again.
type CIRun ¶ added in v0.2.1
type CIRun struct {
ID int64 `json:"id"`
Workflow string `json:"workflow"`
Branch string `json:"branch,omitempty"`
Sha string `json:"sha,omitempty"`
Conclusion string `json:"conclusion,omitempty"`
Attempt int `json:"attempt,omitempty"`
URL string `json:"url,omitempty"`
At time.Time `json:"at"`
}
CIRun is one workflow run.
type CIStats ¶ added in v0.2.1
type CIStats struct {
Days int `json:"days"`
// Finished runs that passed or failed (a cancelled one is neither).
Runs int `json:"runs"`
Passed int `json:"passed"`
Failed int `json:"failed"`
PrevRuns int `json:"prev_runs"`
PrevPassed int `json:"prev_passed"`
// A run's time from start to finish, and its wait in the queue.
MedianSeconds int `json:"median_seconds"`
PrevMedianSeconds int `json:"prev_median_seconds"`
QueueSeconds int `json:"queue_seconds"`
// From a failed run to the next passing run of the same workflow on
// the same branch, and how many times a branch went from red to green.
RedToGreenSeconds int `json:"red_to_green_seconds"`
RedToGreenCount int `json:"red_to_green_count"`
// One a day, oldest first, today last.
Daily []CIDay `json:"daily"`
// Each job, the slowest first.
Jobs []CIJob `json:"jobs,omitempty"`
// Jobs that failed and passed with nothing changed, and runs that
// passed only on a later attempt.
Flaky []CIFlaky `json:"flaky,omitempty"`
// Each workflow's newest run on each branch, where it failed.
Failing []CIRun `json:"failing,omitempty"`
// JobsPending is how many of the period's runs have not had their jobs
// read yet: a few dozen are read per call, so asking again fills in
// the job times.
JobsPending int `json:"jobs_pending,omitempty"`
}
CIStats is a project's GitHub Actions over a period of whole days, and the same number of days before it for comparison. Seconds are medians.
type CIStatsParams ¶ added in v0.2.1
CIStatsParams asks for a project's CI over the last Days days, today included (14 when 0, 90 at most).
type CallerInfo ¶ added in v0.1.6
type CallerInfo struct {
Pane string `json:"pane,omitempty"`
Agent string `json:"agent,omitempty"`
Scoped bool `json:"scoped,omitempty"`
ID string `json:"id,omitempty"`
Label string `json:"label,omitempty"`
}
CallerInfo is who a connection comes from, as its server sees it: the pane, and whether an agent runs there, so the server scopes it. ID names that agent's pane to other machines — the host, the pane and when it started, so a pane ID used again later is someone else — and Label says it to people.
type Changes ¶
type Changes struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Base string `json:"base"`
Worktree string `json:"worktree,omitempty"` // set when the files are uncommitted work
// Watched says the server announces this worktree's edits as they
// happen. Without it a reader has to keep polling: a worktree can be
// too big for the server's watch budget even when the server watches
// others, so this is per worktree rather than a capability.
Watched bool `json:"watched,omitempty"`
Files []FileChange `json:"files"`
Commits []CommitInfo `json:"commits"`
// CommittedFiles is what the branch's commits change against the
// base, when Committed asked for it and Files are uncommitted work.
CommittedFiles []FileChange `json:"committed_files,omitempty"`
}
Changes is the result of project.changes.
type ChangesParams ¶
type ChangesParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
// Committed asks, for a branch with a worktree, for what its commits
// change against the base as well (Changes.CommittedFiles): the files
// are otherwise that worktree's uncommitted work, which is nothing
// once an agent has committed. An older server ignores it.
Committed bool `json:"committed,omitempty"`
}
ChangesParams asks for the changes on a branch: uncommitted work when it is checked out, plus commits (and for other branches, files) since the base.
type ChatTurn ¶ added in v0.2.0
type ChatTurn struct {
// Seq is its place in the whole conversation: stable as turns are
// added, so an update replaces the turn it names.
Seq int `json:"seq"`
Role string `json:"role"`
Text string `json:"text,omitempty"`
Detail string `json:"detail,omitempty"`
Time time.Time `json:"time,omitempty"`
// For a tool: what it was given (an edit as - and + lines, InputKind
// "diff"; a command or a file as "code"), what came back, whether it
// failed, and whether its result has come yet.
Input string `json:"input,omitempty"`
InputKind string `json:"input_kind,omitempty"`
Output string `json:"output,omitempty"`
Error bool `json:"error,omitempty"`
Done bool `json:"done,omitempty"`
}
ChatTurn is one entry of an agent's conversation: what the person typed (user), what the agent said (assistant), or a tool it used (tool, Text its name and Detail what it was used on).
type CleanupFailure ¶ added in v0.1.1
CleanupFailure is a worktree cleanup left, and why.
type CleanupWorktree ¶ added in v0.1.1
CleanupWorktree is one worktree to remove.
type CloudAgentAnswer ¶ added in v0.2.0
type CloudAgentAnswer struct {
Env map[string]string `json:"env,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Error string `json:"error,omitempty"`
}
CloudAgentAnswer is the cloud agent's answer: Env for env, Username and Password for git-credential, Error when it has none to give.
type CloudAgentAsk ¶ added in v0.2.0
type CloudAgentAsk struct {
// Op is "env" (the env-mode secrets, for an agent being started) or
// "git-credential" (the machine token, for git's credential helper).
Op string `json:"op"`
// Key is the registration's (CloudAgentRegisterParams.Key), which env
// needs.
Key string `json:"key,omitempty"`
}
CloudAgentAsk is one line asked of the cloud agent's socket, answered by one CloudAgentAnswer line.
type CloudAgentRegisterParams ¶ added in v0.2.0
type CloudAgentRegisterParams struct {
Socket string `json:"socket"`
// Key is what the server sends back with each CloudAgentAsk for env,
// so the agent's socket gives secrets to this server alone.
Key string `json:"key,omitempty"`
}
CloudAgentRegisterParams names the cloud agent's own socket, where the server asks for secrets with a CloudAgentAsk.
type CloudAgentRegisterResult ¶ added in v0.2.0
type CloudAgentRegisterResult struct {
Capabilities []string `json:"capabilities"`
}
CloudAgentRegisterResult is the server's capabilities once the cloud agent is registered, which the agent reports to the control plane.
type CommitDetail ¶ added in v0.1.9
type CommitDetail struct {
Hash string `json:"hash"`
Parents []string `json:"parents,omitempty"`
Author string `json:"author,omitempty"`
Email string `json:"email,omitempty"`
Time time.Time `json:"time,omitempty"`
Subject string `json:"subject,omitempty"`
Body string `json:"body,omitempty"`
Files []FileChange `json:"files,omitempty"`
Commits int `json:"commits,omitempty"`
Diff string `json:"diff,omitempty"`
}
CommitDetail is project.commit's answer. For a commit: who, when, its message whole and the files it changed against its first parent. For a range (From): the files changed and how many commits that took. With File: Diff alone.
type CommitInfo ¶
type CommitInfo struct {
Hash string `json:"hash"`
Subject string `json:"subject"`
Author string `json:"author"`
Time time.Time `json:"time"`
}
CommitInfo is one commit.
type CommitParams ¶ added in v0.1.9
type CommitParams struct {
ProjectID string `json:"project_id"`
Hash string `json:"hash"`
From string `json:"from,omitempty"`
File string `json:"file,omitempty"`
}
CommitParams asks project.commit about Hash: the commit itself; with From, what changed from From to Hash; with File, only that file's diff (in the commit, or from From).
type CommitResult ¶ added in v0.1.1
type CommitResult struct {
Hash string `json:"hash"`
Into string `json:"into,omitempty"` // the branch merged into
}
CommitResult is a commit a branch method made.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a message stream. Writes are safe for concurrent use; reads must come from a single goroutine.
type DeployInfo ¶ added in v0.2.1
type DeployInfo struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
State string `json:"state"`
URL string `json:"url,omitempty"`
Environment string `json:"environment,omitempty"`
Commit string `json:"commit,omitempty"`
Subject string `json:"subject,omitempty"`
Error string `json:"error,omitempty"`
Inspect string `json:"inspect,omitempty"`
Started *time.Time `json:"started,omitempty"`
Finished *time.Time `json:"finished,omitempty"`
AtHead bool `json:"at_head,omitempty"`
Promotable bool `json:"promotable,omitempty"`
NotPromotable string `json:"not_promotable,omitempty"`
}
DeployInfo is one deploy, newest first in its list. State is ready, building, failed or canceled; Subject is the commit's subject, read from the checkout; AtHead, that it built the pull request's head. Promotable: it may be released to production now; NotPromotable, why a ready one may not (Netlify's deploy previews).
type DeployRelease ¶ added in v0.2.1
type DeployRelease struct {
Verb string `json:"verb"`
What string `json:"what"`
Note string `json:"note,omitempty"`
// Rebuilds: releasing starts a new production build (Vercel), which
// is building until ready; else the release is immediate (Netlify).
Rebuilds bool `json:"rebuilds,omitempty"`
}
DeployRelease is how releasing to production is said for a service: the verb on its button, what happens, and a line under it.
type DeploySource ¶ added in v0.2.1
type DeploySource struct {
Source string `json:"source"`
Service string `json:"service"`
Why string `json:"why,omitempty"`
Missing string `json:"missing,omitempty"`
Head string `json:"head,omitempty"`
BuildLog bool `json:"build_log,omitempty"`
Deploys []DeployInfo `json:"deploys,omitempty"`
Redeploy bool `json:"redeploy,omitempty"`
Promote bool `json:"promote,omitempty"`
Release *DeployRelease `json:"release,omitempty"`
}
DeploySource is one deploy integration's word on a branch. Why says what is wrong when it could not be asked (no key, no remote, the service failed); Missing, that the service has nothing that builds from this repository, in its own terms. Head is the pull request's head the deploys were read at — only that commit's are listed — and empty for a branch with no pull request, whose deploys are its history. BuildLog: its failed_log reads a build's output (Netlify's API has none, and a failed deploy's log is its error message). Redeploy and Promote say whether its file can.
type DiffParams ¶
type DiffParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
File string `json:"file"`
}
DiffParams asks for the diff of one file within project.changes' scope.
type DiffResult ¶
type DiffResult struct {
Diff string `json:"diff"`
}
DiffResult is a unified diff.
type FSDownload ¶ added in v0.1.9
type FSDownload struct {
ID string `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
Dir bool `json:"dir,omitempty"`
}
FSDownload is a download ready to read. A folder comes packed by internal/transfer, and Size is the pack's.
type FSDownloadChunk ¶ added in v0.1.9
FSDownloadChunk is one piece of a download; EOF marks the last.
type FSDownloadParams ¶ added in v0.1.9
type FSDownloadParams struct {
Path string `json:"path"`
SSH string `json:"ssh,omitempty"` // as in FSListParams
}
FSDownloadParams asks for a file or folder (absolute, or from ~) to be read back with fs.download_read.
type FSDownloadReadParams ¶ added in v0.1.9
FSDownloadReadParams reads the chunk at Offset (at most UploadChunkSize).
type FSEntry ¶
type FSEntry struct {
Name string `json:"name"`
Git bool `json:"git,omitempty"` // a git repository (has .git)
Project bool `json:"project,omitempty"` // already a project
// The rest are only filled in a checkout listing (fs.files.v1).
Dir bool `json:"dir,omitempty"`
Size int64 `json:"size,omitempty"`
ModTime time.Time `json:"mod_time,omitzero"`
Symlink bool `json:"symlink,omitempty"`
Broken bool `json:"broken,omitempty"` // a symlink to nothing
Ignored bool `json:"ignored,omitempty"`
// Status is the file's git status in the changes view's alphabet (M, A,
// D, R, U, ?); a folder carries the most telling one of what is in it.
Status string `json:"status,omitempty"`
}
FSEntry is a folder inside a listed folder, or with Files a file.
type FSFindParams ¶ added in v0.1.9
type FSFindParams struct {
Root string `json:"root"`
Query string `json:"query"`
Limit int `json:"limit,omitempty"`
}
FSFindParams asks for the files of a checkout (a project or one of its worktrees, as fs.list's Root) whose path holds Query's letters in order, best first: the name containing it, then the path, then the letters scattered. Limit is at most FSFindMax; 0 means FSFindDefault.
type FSFindResult ¶ added in v0.1.9
type FSFindResult struct {
Root string `json:"root"`
Paths []string `json:"paths"`
Truncated bool `json:"truncated,omitempty"`
}
FSFindResult is what fs.find found: paths relative to Root, with slashes. Truncated says more matched than were returned.
type FSLinesParams ¶ added in v0.2.0
type FSLinesParams struct {
Root string `json:"root"`
Path string `json:"path"`
Line int `json:"line,omitempty"`
Count int `json:"count,omitempty"`
Tail bool `json:"tail,omitempty"`
}
FSLinesParams reads lines of a file in the checkout Root: Count of them (at most FSLinesMax; 0 means FSLinesDefault) from line Line (from 1), or with Tail the last Count. Lines are found through an index of the file kept by the server, so line ten million is no slower than line ten.
type FSLinesResult ¶ added in v0.2.0
type FSLinesResult struct {
Path string `json:"path"` // absolute
Size int64 `json:"size"`
ModTime time.Time `json:"mod_time,omitzero"`
Line int `json:"line"`
Lines int `json:"lines"`
Offset int64 `json:"offset"`
Length int64 `json:"length"`
Data string `json:"data,omitempty"`
Hash string `json:"hash,omitempty"`
Lossy bool `json:"lossy,omitempty"`
Binary bool `json:"binary,omitempty"`
}
FSLinesResult is the lines read: Data from byte Offset, Length bytes, starting at line Line; Lines is how many the file has. Hash is the fingerprint of those bytes, what an fs.write_range of them is checked against; it is left out when they are not UTF-8 (Lossy: shown with replacement characters, so they cannot be saved back) or Binary.
type FSList ¶
type FSList struct {
Path string `json:"path"` // absolute, cleaned
Parent string `json:"parent,omitempty"`
Home string `json:"home"`
Entries []FSEntry `json:"entries"`
// Truncated is set when the folder had more entries than were returned.
Truncated bool `json:"truncated,omitempty"`
}
FSList is the result of fs.list.
type FSListParams ¶
type FSListParams struct {
Path string `json:"path"`
Hidden bool `json:"hidden,omitempty"`
Root string `json:"root,omitempty"`
Files bool `json:"files,omitempty"`
// Ignored keeps what git ignores in a checkout listing; it is left out
// otherwise, which is what keeps node_modules out of the way.
Ignored bool `json:"ignored,omitempty"`
// SSH is a pane logged in to a host with ssh: Path is then on that
// host (fs.ssh.v1), and Root is not taken.
SSH string `json:"ssh,omitempty"`
}
FSListParams lists the folders in Path on the server's machine. "" and "~" mean the home directory.
With Root set the listing is of a checkout instead: Root must be a project's folder or one of its worktrees, Path is relative to it ("" for Root itself), and nothing outside Root is listed. Files adds the files beside the folders, with their size, time and git status (fs.files.v1).
type FSMkdirParams ¶
type FSMkdirParams struct {
Path string `json:"path"`
SSH string `json:"ssh,omitempty"` // as in FSListParams
Root string `json:"root,omitempty"`
}
FSMkdirParams creates one folder. With Root (fs.ops.v1) Path is inside that checkout, as in FSListParams, and the folders on the way are made.
type FSPathParams ¶ added in v0.2.0
type FSPathParams struct {
Root string `json:"root"`
Path string `json:"path"`
To string `json:"to,omitempty"`
}
FSPathParams names a file or folder in the checkout Root, and for fs.rename and fs.copy where it goes (To, also inside Root). Neither writes over something already there. fs.delete takes a folder whole.
type FSPathResult ¶ added in v0.2.0
type FSPathResult struct {
Path string `json:"path"`
}
FSPathResult is the path the file or folder now has, absolute.
type FSPattern ¶ added in v0.2.0
type FSPattern struct {
Query string `json:"query"`
Regex bool `json:"regex,omitempty"`
Case bool `json:"case,omitempty"`
Word bool `json:"word,omitempty"`
}
FSPattern is what fs.search looks for and fs.replace replaces: Query as written, or a regular expression (Go's syntax) with Regex; letter case ignored unless Case; with Word, only where it is a whole word. A pattern matches within a line, never across one.
type FSReadParams ¶ added in v0.1.4
type FSReadParams struct {
Root string `json:"root"`
Path string `json:"path"`
Offset int64 `json:"offset,omitempty"`
Max int `json:"max,omitempty"`
SSH string `json:"ssh,omitempty"` // as in FSListParams
// Whole raises Max's cap to FSWriteMax, so a file that can be saved
// can be read in one piece (fs.lines.v1).
Whole bool `json:"whole,omitempty"`
}
FSReadParams reads the start of a file in a checkout. Root and Path are as in FSListParams; Max is capped at FSReadMax, and 0 means FSReadMax.
type FSReadResult ¶ added in v0.1.4
type FSReadResult struct {
Path string `json:"path"` // absolute
Size int64 `json:"size"`
ModTime time.Time `json:"mod_time,omitzero"`
Data string `json:"data,omitempty"`
Truncated bool `json:"truncated,omitempty"` // the file goes on past Data
Binary bool `json:"binary,omitempty"`
MIME string `json:"mime,omitempty"`
// Hash is the SHA-256 of the whole file, hex, when Data is all of it:
// what an fs.write of an edit is checked against (fs.write.v1).
Hash string `json:"hash,omitempty"`
}
FSReadResult is the result of fs.read. A binary file has no Data: it is described rather than shown.
type FSReplaceFile ¶ added in v0.2.0
type FSReplaceParams ¶ added in v0.2.0
type FSReplaceParams struct {
Root string `json:"root"`
FSPattern
Replace string `json:"replace"`
Files []FSReplaceFile `json:"files"`
}
FSReplaceParams replaces the pattern with Replace in each of Files of the checkout Root — on the Lines listed, or every line when none are — where the file is still the Hash it was searched as. With Regex, $1 and ${name} in Replace are the groups matched.
type FSReplaceResult ¶ added in v0.2.0
type FSReplaceResult struct {
Files []FSReplaced `json:"files,omitempty"`
Skipped []FSSkipped `json:"skipped,omitempty"`
}
FSReplaceResult says what was replaced, and what was left and why: a file changed since the search is skipped, never written over.
type FSReplaced ¶ added in v0.2.0
type FSSearchFile ¶ added in v0.2.0
type FSSearchFile struct {
Path string `json:"path"`
Hash string `json:"hash,omitempty"`
Lines []FSSearchLine `json:"lines"`
}
FSSearchFile is one file's matching lines, and its content's Hash (as fs.read's) that an fs.replace of them is checked against.
type FSSearchLine ¶ added in v0.2.0
type FSSearchLine struct {
Line int `json:"line"`
Offset int64 `json:"offset"`
Col int `json:"col,omitempty"`
Text string `json:"text"`
Ranges [][2]int `json:"ranges"`
}
FSSearchLine is a matching line: its number (from 1), where it starts in the file, Text — the line, or FSSearchLineMax of it from byte Col — and the matches in Text as byte ranges [start, end).
type FSSearchParams ¶ added in v0.2.0
type FSSearchParams struct {
Root string `json:"root"`
FSPattern
Names bool `json:"names,omitempty"`
Text bool `json:"text,omitempty"`
Include []string `json:"include,omitempty"`
Exclude []string `json:"exclude,omitempty"`
Ignored bool `json:"ignored,omitempty"`
Limit int `json:"limit,omitempty"`
Path string `json:"path,omitempty"`
Offset int64 `json:"offset,omitempty"`
Line int `json:"line,omitempty"`
}
FSSearchParams searches the checkout Root (as fs.list's): with Text, the lines of its files that match; with Names, the files whose path holds Query's letters, as fs.find finds them. Include and Exclude are globs (`*.go`, `internal/`, `cmd/**/main.go`), a path taken when it matches any Include (or there are none) and no Exclude. What git ignores is left out unless Ignored. Limit counts lines, at most FSSearchMax.
With Path, that one file alone is searched, from byte Offset — the start of line Line — for FSSearchBudget at most, and the result says where to go on from: a big file searched a piece at a time.
type FSSearchResult ¶ added in v0.2.0
type FSSearchResult struct {
Root string `json:"root"`
Names []string `json:"names,omitempty"`
Files []FSSearchFile `json:"files,omitempty"`
Searched int `json:"searched,omitempty"`
Skipped int `json:"skipped,omitempty"`
Truncated bool `json:"truncated,omitempty"`
// For a search of one Path: the file's size, where to go on from
// (Next, the start of line NextLine), and Done once it reached the end.
Size int64 `json:"size,omitempty"`
Next int64 `json:"next,omitempty"`
NextLine int `json:"next_line,omitempty"`
Done bool `json:"done,omitempty"`
}
FSSearchResult is what fs.search found. Names are paths relative to Root; Files hold the matching lines, in path order. Searched counts the files read, Skipped those left out as binary or too big.
type FSUploadParams ¶ added in v0.1.1
type FSUploadParams struct {
Upload string `json:"upload,omitempty"`
Name string `json:"name,omitempty"` // base name, first chunk only
Size int64 `json:"size,omitempty"` // the whole file's size, first chunk only
Data []byte `json:"data,omitempty"` // base64 in JSON
Final bool `json:"final,omitempty"`
// The rest are CapFSTransfer, first chunk only. Dir is the folder to
// put it in (absolute, or from ~) instead of the uploads folder.
// Archive says the data is a folder packed by internal/transfer, to be
// unpacked as Name. Without Replace a name already taken is not
// written over: the copy is numbered ("ca 2.pem") and Path says so.
Dir string `json:"dir,omitempty"`
Archive bool `json:"archive,omitempty"`
Replace bool `json:"replace,omitempty"`
// Mode is a file's permission bits, so a script stays runnable; 0
// means 0644. A packed folder carries its own.
Mode uint32 `json:"mode,omitempty"`
// Parallel (first chunk, CapFSTransfer) says the client keeps several
// chunks in flight, so they may arrive in any order and each says
// where it goes: Offset, a multiple of UploadChunkSize, with a whole
// chunk at each but the last. The Final chunk is sent alone once
// every other one has been answered.
Parallel bool `json:"parallel,omitempty"`
Offset int64 `json:"offset,omitempty"`
// SSH (first chunk) puts it on the host a pane is logged in to, as in
// FSListParams; Dir is then a folder there.
SSH string `json:"ssh,omitempty"`
}
FSUploadParams sends one chunk of a file for the server to store under its uploads folder. The first chunk has no Upload ID and names the file and its size; the server returns an ID for the chunks after it.
type FSUploadResult ¶ added in v0.1.1
type FSUploadResult struct {
Upload string `json:"upload"`
Path string `json:"path,omitempty"` // the stored file's absolute path, once Final
}
FSUploadResult answers each chunk.
type FSWriteParams ¶ added in v0.1.9
type FSWriteParams struct {
Root string `json:"root"`
Path string `json:"path"`
Data string `json:"data"`
Base string `json:"base,omitempty"`
Create bool `json:"create,omitempty"`
Force bool `json:"force,omitempty"`
}
FSWriteParams saves Data as the file at Path inside the checkout Root (a project or one of its worktrees). Base is the Hash it was read as: the save is refused with ErrFileChanged when the file is not that any more, unless Force. Create makes a file that is not there; without it a file gone since it was read is a change too.
type FSWriteRangeParams ¶ added in v0.2.0
type FSWriteRangeParams struct {
Root string `json:"root"`
Path string `json:"path"`
Offset int64 `json:"offset"`
Length int64 `json:"length"`
Base string `json:"base"`
Data string `json:"data"`
}
FSWriteRangeParams replaces Length bytes from Offset of a file in the checkout Root with Data, if those bytes still have the fingerprint Base (FSLinesResult.Hash): a big file edited a few lines at a time. The rest of the file is kept as it is, the new file put in place in one step.
type FSWriteResult ¶ added in v0.1.9
type FSWriteResult struct {
Path string `json:"path"` // absolute
Size int64 `json:"size"`
ModTime time.Time `json:"mod_time,omitzero"`
Hash string `json:"hash"`
}
FSWriteResult is the file as saved.
type FileChange ¶
type FileChange struct {
Path string `json:"path"`
OrigPath string `json:"orig_path,omitempty"`
Code string `json:"code"` // M A D R C T U(conflict) ?(untracked)
Staged bool `json:"staged,omitempty"`
Unstaged bool `json:"unstaged,omitempty"`
Added int `json:"added"`
Deleted int `json:"deleted"`
Binary bool `json:"binary,omitempty"`
}
FileChange is one changed file.
type Frame ¶
type Frame struct {
ID string `json:"id"`
Cols int `json:"cols"`
Rows int `json:"rows"`
Lines []string `json:"lines"`
Title string `json:"title,omitempty"`
// Offset is how many lines back into history the view is scrolled;
// History is how many lines of history exist (0 on the alternate screen).
Offset int `json:"offset,omitempty"`
History int `json:"history,omitempty"`
// Mouse reports that the program asked for mouse events; AltScreen that
// it is a full-screen program.
Mouse bool `json:"mouse,omitempty"`
AltScreen bool `json:"alt_screen,omitempty"`
// Cursor is where the cursor is drawn, when it is: the program is
// running, has not hidden it, and the view is not scrolled back.
Cursor *FrameCursor `json:"cursor,omitempty"`
}
Frame is a rendered snapshot of a pane's screen, one ANSI-styled string per row, with the cursor already drawn in.
type FrameCursor ¶ added in v0.1.9
FrameCursor is a cell of a frame, counted from 0 at the top left.
type GitStatus ¶
type GitStatus struct {
Staged int `json:"staged"`
Unstaged int `json:"unstaged"`
Untracked int `json:"untracked"`
Conflicts int `json:"conflicts"`
Files int `json:"files"`
Added int `json:"added"`
Deleted int `json:"deleted"`
}
GitStatus summarises uncommitted changes in a worktree.
type GroupInfo ¶ added in v0.2.0
type GroupInfo struct {
Name string `json:"name"`
Projects []string `json:"projects"`
Notes string `json:"notes,omitempty"`
// Tasks across its repos (CapGroupTask), the newest last.
Tasks []GroupTask `json:"tasks,omitempty"`
}
GroupInfo is a project group: its name, its projects in the person's order (the order a task across them merges in), and notes for the agents working across them.
type GroupSaveParams ¶ added in v0.2.0
type GroupSaveParams struct {
Name string `json:"name"`
Old string `json:"old,omitempty"`
Projects []string `json:"projects"`
Notes string `json:"notes,omitempty"`
}
GroupSaveParams makes a group, or replaces the one called Old (or Name) — a rename when Old differs.
type GroupTask ¶ added in v0.2.0
type GroupTask struct {
Branch string `json:"branch"`
Folder string `json:"folder"`
Projects []string `json:"projects"`
Panes []string `json:"panes,omitempty"`
Each bool `json:"each,omitempty"`
Created time.Time `json:"created"`
// Merge is Merge All When Green on this task, once armed
// (CapGroupTaskMerge); nil when it never was.
Merge *GroupTaskMerge `json:"merge,omitempty"`
}
GroupTask is one task across a group's repos: the branch made in each of its projects, the folder holding a link to each worktree (where its agent works), and the panes it started — one agent, or one per repo.
type GroupTaskMerge ¶ added in v0.2.0
type GroupTaskMerge struct {
Order []string `json:"order"`
Merged []string `json:"merged,omitempty"`
State string `json:"state"`
Why string `json:"why,omitempty"`
RemoveTask bool `json:"remove_task,omitempty"`
Armed time.Time `json:"armed"`
}
GroupTaskMerge is where a task's Merge All When Green stands: the projects in the order they merge, those merged so far, and — while it waits or once it stopped — why, in a sentence.
type GroupTaskMergeParams ¶ added in v0.2.0
type GroupTaskMergeParams struct {
Group string `json:"group"`
Branch string `json:"branch"`
Order []string `json:"order,omitempty"`
RemoveTask bool `json:"remove_task,omitempty"`
Stop bool `json:"stop,omitempty"`
}
GroupTaskMergeParams arms Merge All When Green on Group's task on Branch: Order is every one of the task's projects (default the task's own order), RemoveTask takes the task, its worktrees and its folder away once all are merged. Stop disarms it instead.
type GroupTaskParams ¶ added in v0.2.0
type GroupTaskParams struct {
Group string `json:"group"`
Prompt string `json:"prompt"`
Branch string `json:"branch,omitempty"`
Agent string `json:"agent,omitempty"`
Account string `json:"account,omitempty"` // as PaneCreateParams has it
Projects []string `json:"projects,omitempty"`
Each bool `json:"each,omitempty"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
}
GroupTaskParams starts a task across Group's repos: Projects (default all of them, in the group's order), each on Branch (default named from the prompt). One agent at the task folder with every worktree, or with Each an agent in each worktree.
type GroupTaskRef ¶ added in v0.2.0
GroupTaskRef names a task by its group and branch.
type GroupTaskResult ¶ added in v0.2.0
type HelloParams ¶
type HelloParams struct {
Client string `json:"client"`
Version string `json:"version"`
Protocol int `json:"protocol"`
Capabilities []string `json:"capabilities"`
}
HelloParams opens a session.
type HelloResult ¶
type HelloResult struct {
Version string `json:"version"`
Protocol int `json:"protocol"`
Capabilities []string `json:"capabilities"`
PID int `json:"pid"`
Started time.Time `json:"started"` // the first server of a chain of reloads
// LoadedAt is when the running program started: a reload changes it but
// not Started. Zero from servers that predate it.
LoadedAt time.Time `json:"loaded_at,omitempty"`
Build string `json:"build,omitempty"` // hash of the server binary
BuildID string `json:"build_id,omitempty"` // the same across platforms (see buildinfo.ID)
Platform string `json:"platform,omitempty"` // e.g. linux/amd64
Hostname string `json:"hostname,omitempty"`
Home string `json:"home,omitempty"`
}
HelloResult describes the server.
type IntegrationDetect ¶ added in v0.2.1
type IntegrationDetect struct {
Integrations []IntegrationUse `json:"integrations"`
// Team is the repository's .conch/integrations.toml, when it has one
// (CapIntegrationTeam).
Team *IntegrationTeam `json:"team,omitempty"`
}
IntegrationDetect is what integration.detect answers.
type IntegrationDetectParams ¶ added in v0.2.1
type IntegrationDetectParams struct {
ProjectID string `json:"project_id"`
}
IntegrationDetectParams names the project.
type IntegrationTeam ¶ added in v0.2.1
type IntegrationTeam struct {
Path string `json:"path"`
Names []string `json:"names,omitempty"`
State string `json:"state"`
Problem string `json:"problem,omitempty"`
}
IntegrationTeam is a repository's .conch/integrations.toml. State is "ask" until the person has answered whether to use what it names — asked once per repository, and again only when it names something new — then "used" or "ignored"; only a used file's names are in Integrations.
type IntegrationTeamParams ¶ added in v0.2.1
type IntegrationTeamParams struct {
ProjectID string `json:"project_id"`
Action string `json:"action"`
Names []string `json:"names,omitempty"`
}
IntegrationTeamParams: Action is TeamUse or TeamIgnore (the answer to the file's question), TeamSave (write Names as the file) or TeamRemove (delete it). It answers with the project's integrations afresh.
type IntegrationUse ¶ added in v0.2.1
type IntegrationUse struct {
Name string `json:"name"`
Label string `json:"label"`
Kind string `json:"kind"`
Why string `json:"why"`
Installed bool `json:"installed,omitempty"`
Connected bool `json:"connected,omitempty"`
// KeyEnv is the variable its key is read from, for saying what to set.
KeyEnv string `json:"key_env,omitempty"`
// Team: the repository's .conch/integrations.toml names it
// (CapIntegrationTeam).
Team bool `json:"team,omitempty"`
}
IntegrationUse is one service a project uses. Installed: something here reads it (a file, or conch's own GitHub support); Connected: its key is set on the server's machine.
type IssueInfo ¶ added in v0.1.9
type IssueInfo struct {
Number int `json:"number"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
Labels []string `json:"labels,omitempty"`
}
IssueInfo is one open issue.
type IssueList ¶ added in v0.1.9
type IssueList struct {
Issues []IssueInfo `json:"issues"`
}
IssueList is a project's open issues, newest first.
type IssuesParams ¶ added in v0.1.9
type IssuesParams struct {
ProjectID string `json:"project_id"`
Limit int `json:"limit,omitempty"`
}
IssuesParams lists a project's open GitHub issues (CapIssues).
type Library ¶ added in v0.1.6
type Library struct {
Servers []LibraryServer `json:"servers"`
Skills []LibrarySkill `json:"skills"`
}
Library is the MCP servers and skills conch keeps for the agents.
type LibraryApplyParams ¶ added in v0.1.6
type LibraryApplyParams struct {
Apply bool `json:"apply,omitempty"`
Undo bool `json:"undo,omitempty"`
Stamp string `json:"stamp,omitempty"`
}
LibraryApplyParams gives each agent what the library says. With Apply false nothing is written; Undo puts an apply back (Stamp, "" the last).
type LibraryCell ¶ added in v0.1.6
type LibraryCell struct {
Kind string `json:"kind"` // "mcp server" or "skill"
Name string `json:"name"`
Agent string `json:"agent"`
State string `json:"state"`
Detail string `json:"detail,omitempty"`
}
LibraryCell is where one server or skill stands with one agent: on, pending, remove, off, theirs, differs or cannot.
type LibraryFetchParams ¶ added in v0.2.0
type LibraryFetchParams struct {
Source string `json:"source"`
Name string `json:"name,omitempty"`
}
LibraryFetchParams asks for a skill on GitHub — owner/repo, owner/repo/path/to/skill, @ref at the end, or a github.com link — to be downloaded into the library under Name (its folder's name when empty).
type LibraryFetchResult ¶ added in v0.2.0
type LibraryFetchResult struct {
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Source string `json:"source,omitempty"`
Found []string `json:"found,omitempty"`
}
LibraryFetchResult is the skill fetched, ready to be given to agents as a library skill at Path. Found lists the skills a repository holds when Source named none of several; the person picks one.
type LibraryServer ¶ added in v0.1.6
type LibraryServer struct {
Name string `json:"name"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
URL string `json:"url,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Transport string `json:"transport,omitempty"` // "sse", or "" for streamable HTTP
Agents []string `json:"agents"`
// Plain: the person chose to keep its token in plain text, so Env and
// Headers may hold values as they are rather than only ${VAR}
// (CapLibraryPlain). They are written into each agent's file as given.
Plain bool `json:"plain,omitempty"`
}
LibraryServer is an MCP server in conch's library. References to variables are written ${VAR}; conch writes each agent's own form.
type LibrarySkill ¶ added in v0.1.6
type LibrarySkill struct {
Name string `json:"name"`
Path string `json:"path"` // ~ is the home directory there
Agents []string `json:"agents"`
// Source is where on GitHub a fetched skill came from, to fetch it
// again; empty for a folder of the person's own.
Source string `json:"source,omitempty"`
}
LibrarySkill is a skill in the library: a folder holding a SKILL.md, linked into each agent's folder.
type LimitWindow ¶
type LimitWindow struct {
UsedPct float64 `json:"used_pct"` // 0-100 (above 100 once exceeded)
ResetsAt time.Time `json:"resets_at,omitempty"`
}
LimitWindow is one usage limit window of an agent's plan.
type LocalFile ¶
LocalFile is an untracked file of the main checkout matched by the project's local file patterns, and its state in the worktree.
type LogCommit ¶ added in v0.1.9
type LogCommit struct {
Hash string `json:"hash"`
Parents []string `json:"parents,omitempty"`
Subject string `json:"subject"`
Author string `json:"author"`
Time time.Time `json:"time"`
Refs []string `json:"refs,omitempty"`
}
LogCommit is one commit for a graph: children always come before their parents in a LogResult, and Refs are as git decorates them ("HEAD -> main", "origin/main", "tag: v1").
type LogParams ¶ added in v0.1.9
LogParams asks for a project's history: every commit reachable from its branches, tags and HEAD, newest first. Limit is how many (LogLimit when 0, at most LogLimitMax).
type LogResult ¶ added in v0.1.9
type LogResult struct {
Commits []LogCommit `json:"commits"`
More bool `json:"more,omitempty"`
// Remotes are the repository's remotes, by which a client tells a
// remote's branch (fork/main) from a local one with a slash. Absent
// from an older server: clients then take origin and upstream.
Remotes []string `json:"remotes,omitempty"`
// Format is how the repository stores itself — sha1 or sha256
// objects, files or reftable refs — absent from an older server.
Format *RepoFormat `json:"format,omitempty"`
}
LogResult is a project's history. More says older commits were left out.
type Message ¶
type Message struct {
ID string `json:"id,omitempty"`
Method string `json:"method,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
Event string `json:"event,omitempty"`
Data json.RawMessage `json:"data,omitempty"`
}
Message is the single envelope for requests, responses and events.
type ModelUsage ¶ added in v0.1.9
type ModelUsage struct {
Model string `json:"model"`
UsageTokens
}
ModelUsage is what one model used in a period.
type NamedWindow ¶ added in v0.1.6
type NamedWindow struct {
Key string `json:"key"`
UsedPct float64 `json:"used_pct"`
ResetsAt time.Time `json:"resets_at,omitempty"`
}
NamedWindow is one plan window under the name its agent gave it (five_hour, seven_day, seven_day_fable, spend_limit…).
type NoteCI ¶ added in v0.2.1
type NoteCI struct {
Source string `json:"source,omitempty"`
Service string `json:"service,omitempty"`
Workflow string `json:"workflow,omitempty"`
Job string `json:"job,omitempty"`
URL string `json:"url,omitempty"`
// Lines of its failed log were read from Host.
Lines int `json:"lines,omitempty"`
Host string `json:"host,omitempty"`
}
NoteCI is a failed CI run as a note names it. Before its log is read only the service is known, from the pull request's failing checks.
func NoteFromLog ¶ added in v0.2.1
func NoteFromLog(lg BranchCILog) *NoteCI
NoteFromLog is what a note says of a failed run whose log was read.
type Overlap ¶ added in v0.1.9
type Overlap struct {
Branch string `json:"branch"`
Files []string `json:"files"` // the first few
}
Overlap is another branch's checkout touching the same files.
type PRCheck ¶ added in v0.1.9
type PRCheck struct {
Name string `json:"name"`
State string `json:"state"`
URL string `json:"url,omitempty"`
// Source is the service it came from ("github-actions", "circleci",
// …; "" for one conch does not know) and Readable whether conch can
// read its log (CapPRCheckSource).
Source string `json:"source,omitempty"`
Readable bool `json:"readable,omitempty"`
// Rerun is whether conch can run it again (CapPRCheckRerun).
Rerun bool `json:"rerun,omitempty"`
}
PRCheck is one check of a pull request: State is pass, fail or pending.
type PRInfo ¶
type PRInfo struct {
Number int `json:"number"`
Title string `json:"title"`
State string `json:"state"` // OPEN, MERGED, CLOSED
Draft bool `json:"draft,omitempty"`
URL string `json:"url"`
Review string `json:"review,omitempty"` // APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED
Checks string `json:"checks,omitempty"` // pass, fail, pending
Passed int `json:"passed,omitempty"`
Total int `json:"total,omitempty"`
Head string `json:"head,omitempty"` // head commit
// Conflicting: GitHub says it cannot merge into its base as it stands.
Conflicting bool `json:"conflicting,omitempty"`
// Runs are its checks one by one — name, state, link — the first few
// dozen; absent from older servers, which say only the counts.
Runs []PRCheck `json:"runs,omitempty"`
}
PRInfo is the pull request for a branch.
type PaneCreateParams ¶
type PaneCreateParams struct {
Name string `json:"name,omitempty"`
Agent string `json:"agent,omitempty"`
AgentArgs string `json:"agent_args,omitempty"` // shell words, e.g. "--model opus"
// Account is which of the agent's accounts it starts on (CapAccounts):
// "" is the folder's pin, else the agent's own; "default" is its own.
Account string `json:"account,omitempty"`
// Prompt is a first message for the agent, passed the way it expects.
Prompt string `json:"prompt,omitempty"`
Command []string `json:"command,omitempty"`
Cwd string `json:"cwd,omitempty"`
Env []string `json:"env,omitempty"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
// ShellTheme is an Oh My Zsh theme for a default-shell pane when that
// shell is zsh; the user's dotfiles still load first.
ShellTheme string `json:"shell_theme,omitempty"`
// NoProject starts a machine-level pane: it belongs to no project even
// when Cwd lies in one.
NoProject bool `json:"no_project,omitempty"`
// SSH runs Command on the host the pane SSH is logged in to, through
// ssh with that pane's options and a terminal (pane.ssh.v1). Cwd is
// where ssh runs here; "" is that pane's folder.
SSH string `json:"ssh,omitempty"`
}
PaneCreateParams creates a pane running Command in Cwd. When Agent names a known agent and Command is empty, the server builds the launch command itself (adding its integration, e.g. hooks) with AgentArgs appended.
type PaneInfo ¶
type PaneInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Command []string `json:"command"`
Cwd string `json:"cwd"`
Cols int `json:"cols"`
Rows int `json:"rows"`
PID int `json:"pid"`
State string `json:"state"`
ExitCode int `json:"exit_code"`
Created time.Time `json:"created"`
// Agent is set while an agent is detected in the pane.
Agent *AgentStatus `json:"agent,omitempty"`
// Account is the account its agent was started on, "" for the agent's
// own (CapAccounts).
Account string `json:"account,omitempty"`
// Team is the team the pane was put in by hand (CapPaneTeam), "-" for
// kept out of every team; "" leaves it to config.toml's [[teams]]
// rules (config.TeamFor), which clients apply.
Team string `json:"team,omitempty"`
// Title is the terminal title with decoration (spinners, the agent's
// default title) stripped; agents set it to a summary of their task.
Title string `json:"title,omitempty"`
// CustomName is true when the user renamed the pane.
CustomName bool `json:"custom_name,omitempty"`
// ProjectID and Branch place the pane in the sidebar tree. Branch is
// the branch checked out in the pane's directory, if any.
ProjectID string `json:"project_id,omitempty"`
Branch string `json:"branch,omitempty"`
// Monitor is what the user asked to be told about this pane, and Alert
// what has happened since someone last looked at it (AlertActivity or
// AlertSilence).
Monitor *PaneMonitor `json:"monitor,omitempty"`
Alert string `json:"alert,omitempty"`
// LastActive is when the pane last printed, or when it started if it
// never has. It says whether anything is happening in a machine at
// all, which is how conch decides a sandbox is idle. Zero from
// servers that predate it.
LastActive time.Time `json:"last_active,omitempty"`
// CreatedBy is the pane this one was started from, if any: an agent
// there may change it, and what it starts in turn (see pane.scope.v1).
CreatedBy string `json:"created_by,omitempty"`
// SSH is the host the program in front is logged in to when it is ssh
// — `ssh me@box` typed at the shell — as it was typed (fs.ssh.v1).
SSH string `json:"ssh,omitempty"`
// Listening is the TCP ports the pane's program and its children
// listen on, lowest first (pane.listening.v1): a dev server's address.
// An agent's own ports are left out (Claude Code keeps one for
// itself), though not those of what it starts.
Listening []int `json:"listening,omitempty"`
}
PaneInfo is the metadata for one pane.
func (PaneInfo) DisplayName ¶
DisplayName is how a pane is labelled: the user's name, else an agent's task title, else the command name.
type PaneList ¶
type PaneList struct {
Panes []PaneInfo `json:"panes"`
}
PaneList is the result of pane.list.
type PaneMonitor ¶ added in v0.1.4
type PaneMonitor struct {
Activity bool `json:"activity,omitempty"`
Silence int `json:"silence,omitempty"`
}
PaneMonitor asks to be told about a pane's output, as tmux's monitor-activity and monitor-silence do: Activity for any output while nobody is looking at it, Silence for that many seconds without output after some. A zero PaneMonitor stops monitoring.
type PaneMonitorParams ¶ added in v0.1.4
type PaneMonitorParams struct {
ID string `json:"id"`
PaneMonitor
}
PaneMonitorParams sets a pane's monitoring.
type PaneOutput ¶ added in v0.1.9
type PaneOutput struct {
ID string `json:"id"`
Data []byte `json:"data"`
Reset bool `json:"reset,omitempty"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
}
PaneOutput is a piece of raw output. Reset says the connection fell behind and pieces were lost: Data is then a fresh replay (as PaneRawStart's) for a terminal cleared first, at Cols×Rows.
type PaneRawStart ¶ added in v0.1.9
type PaneRawStart struct {
ID string `json:"id"`
Cols int `json:"cols"`
Rows int `json:"rows"`
Replay []byte `json:"replay"`
}
PaneRawStart is what pane.raw answers: output that rebuilds the pane's history and screen in a fresh terminal of Cols×Rows, after which every EventPaneOutput carries what the program wrote next.
type PaneReadResult ¶
type PaneReadResult struct {
Lines []string `json:"lines"`
}
PaneReadResult is the plain-text visible screen of a pane.
type PaneRenameParams ¶
PaneRenameParams renames a pane; an empty name restores the default.
type PaneResizeParams ¶
type PaneResizeParams struct {
ID string `json:"id"`
Cols int `json:"cols"`
Rows int `json:"rows"`
}
PaneResizeParams resizes a pane.
type PaneScrollParams ¶
PaneScrollParams scrolls the requesting client's view of a pane Offset lines back into history (0 = live). The view stays anchored to the same text while new output arrives.
type PaneSearchParams ¶ added in v0.1.4
type PaneSearchParams struct {
ID string `json:"id"`
Query string `json:"query"`
Line int `json:"line"`
Col int `json:"col"`
Backward bool `json:"backward,omitempty"`
}
PaneSearchParams looks for Query in a pane's history and screen, from just after Line and Col (just before them, Backward). Line counts from the oldest line of history; the screen starts at the result's History.
type PaneSearchResult ¶ added in v0.1.4
type PaneSearchResult struct {
Found bool `json:"found,omitempty"`
Line int `json:"line,omitempty"`
Col int `json:"col,omitempty"`
Width int `json:"width,omitempty"`
History int `json:"history,omitempty"`
Wrapped bool `json:"wrapped,omitempty"`
}
PaneSearchResult is the next match, in the same lines as the params, and Width cells wide. Wrapped says the search went round an end to find it.
type PaneSendKeysParams ¶
PaneSendKeysParams sends named keys ("enter", "ctrl+c", "alt+up") to a pane; the server encodes them for the pane's current terminal modes.
type PaneSendMouseParams ¶
type PaneSendMouseParams struct {
ID string `json:"id"`
X int `json:"x"`
Y int `json:"y"`
Button string `json:"button"`
Action string `json:"action"`
Shift bool `json:"shift,omitempty"`
Alt bool `json:"alt,omitempty"`
Ctrl bool `json:"ctrl,omitempty"`
}
PaneSendMouseParams forwards a mouse event to a pane at cell X, Y (0-based, relative to the pane). Button is left, middle, right, wheel_up or wheel_down. The server drops it unless the program enabled mouse reporting.
type PaneSendTextParams ¶
type PaneSendTextParams struct {
ID string `json:"id"`
Text string `json:"text"`
Paste bool `json:"paste,omitempty"`
// Reply says the text is not the person typing: a terminal answering
// the program (pane.raw's client), or the pointer moving over it. It
// reaches the program the same, but takes the pane's size for nobody
// and is not input that tells an agent's state (pane.raw.v1; an
// older server takes it as typed).
Reply bool `json:"reply,omitempty"`
}
PaneSendTextParams types text into a pane. Paste wraps it in bracketed paste sequences when the program asked for them.
type PaneTeamParams ¶ added in v0.2.1
PaneTeamParams puts a pane in a team: a name, "-" for no team whatever the rules say, or "" to leave it to the rules again.
type PermissionAnswer ¶ added in v0.1.9
type PermissionAnswer struct {
Decision string `json:"decision,omitempty"`
Rule string `json:"rule,omitempty"` // the rule that decided, in words
DryRun bool `json:"dry_run,omitempty"`
}
PermissionAnswer is what the rules say: allow, deny, or "" to ask the person as usual. DryRun says what a rule would have answered while [agents] permission_mode is dry-run, when nothing is answered.
type PermissionAsk ¶ added in v0.1.9
type PermissionAsk struct {
ID string `json:"id"` // the pane
Agent string `json:"agent"`
Tool string `json:"tool"`
Subject string `json:"subject,omitempty"`
}
PermissionAsk is an agent asking to use a tool, as its hook saw it: Subject is what the tool acts on — a command, a file, a URL.
type PermissionRecord ¶ added in v0.1.9
type PermissionRecord struct {
At time.Time `json:"at"`
Tool string `json:"tool"`
Subject string `json:"subject,omitempty"`
Decision string `json:"decision"`
Rule string `json:"rule"`
DryRun bool `json:"dry_run,omitempty"`
}
PermissionRecord is one answer the rules gave, kept on the pane and shown by agent.explain.
type PlanLimits ¶
type PlanLimits struct {
Agent string `json:"agent"`
// Account is which of the agent's accounts, "" for its own
// (CapAccounts): each has a plan of its own.
Account string `json:"account,omitempty"`
FiveHour *LimitWindow `json:"five_hour,omitempty"`
Week *LimitWindow `json:"week,omitempty"`
Spend *LimitWindow `json:"spend,omitempty"`
// Windows is every window the agent named, in the agent's own words.
// An account with a per-model allowance reports more than the three
// above — a weekly window for one model beside the weekly window for
// all of them — and a new one appears whenever the plans change, so
// what is passed on is the list rather than the three conch happens to
// know. The three stay for servers and clients of older builds.
Windows []NamedWindow `json:"windows,omitempty"`
At time.Time `json:"at"` // when it was reported
}
PlanLimits is how much of an agent account's plan limits is used, as the agent last reported it: Claude's 5-hour and weekly windows, Codex's primary and secondary windows, or a gateway spend limit.
type ProjectAddParams ¶
type ProjectAddParams struct {
Path string `json:"path"`
}
ProjectAddParams adds the project containing Path.
type ProjectBundle ¶ added in v0.2.0
type ProjectBundle struct {
ID string `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
Branch string `json:"branch,omitempty"`
}
ProjectBundle is a project's repository bundled for another machine: read it back with worktree.pack_read. Branch is the one its main checkout is on, for the other machine to check out.
type ProjectCloneParams ¶ added in v0.1.4
ProjectCloneParams clones URL into Path and adds it as a project.
type ProjectCreateParams ¶
ProjectCreateParams makes a new folder at Path (which must not exist yet), optionally a git repository, and adds it as a project.
type ProjectFilesParams ¶
type ProjectFilesParams struct {
ProjectID string `json:"project_id"`
Patterns []string `json:"patterns,omitempty"`
Reset bool `json:"reset,omitempty"`
}
ProjectFilesParams sets a project's local file patterns; Reset restores the built-in list.
type ProjectInfo ¶
type ProjectInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Git bool `json:"git"`
Base string `json:"base,omitempty"` // branch others are compared to
Worktrees []WorktreeInfo `json:"worktrees,omitempty"`
Branches []BranchInfo `json:"branches,omitempty"` // newest commit first
Error string `json:"error,omitempty"`
Refreshed time.Time `json:"refreshed"`
// PRStatus explains missing pull request data ("" when it loaded, or
// e.g. "no GitHub remote").
PRStatus string `json:"pr_status,omitempty"`
// LocalFiles are git glob patterns of ignored files (.env, local agent
// settings) copied from the main checkout into new worktrees.
LocalFiles []string `json:"local_files,omitempty"`
// LocalFilesDefault is set while LocalFiles is the built-in list.
LocalFilesDefault bool `json:"local_files_default,omitempty"`
// Remote is the URL of the repository's origin, so the same project can
// be recognised on another machine. Absent from older servers.
Remote string `json:"remote,omitempty"`
// Setup is the command run in every new worktree of the project, in a
// terminal of its own: installing dependencies, copying a database,
// whatever makes a fresh checkout runnable. "" runs nothing.
Setup string `json:"setup,omitempty"`
}
ProjectInfo is a project (a git repository or plain folder) and its git state.
type ProjectList ¶
type ProjectList struct {
Projects []ProjectInfo `json:"projects"`
}
ProjectList is the result of project.list.
type ProjectPlace ¶ added in v0.1.1
type ProjectPlace struct {
ProjectID string `json:"project_id"`
Root string `json:"root"` // the project's main checkout
Git bool `json:"git,omitempty"`
Base string `json:"base,omitempty"`
Worktree string `json:"worktree,omitempty"` // the checkout holding the directory
Branch string `json:"branch,omitempty"` // its branch, "" when detached
}
ProjectPlace says which project and checkout a directory is in, read from git rather than the last refresh.
type ProjectSetupParams ¶ added in v0.1.9
type ProjectSetupParams struct {
ProjectID string `json:"project_id"`
Command string `json:"command,omitempty"`
}
ProjectSetupParams sets the command run in a project's new worktrees; an empty Command runs nothing.
type ProjectUnbundleParams ¶ added in v0.2.0
type ProjectUnbundleParams struct {
Pack string `json:"pack"`
Path string `json:"path"`
Branch string `json:"branch,omitempty"`
}
ProjectUnbundleParams makes a project at Path from a bundle uploaded here (Pack, an fs.upload's path), with Branch checked out.
type PruneBranch ¶ added in v0.2.1
PruneBranch is one branch to delete; Force deletes it even when that loses commits.
type RebasedCommit ¶ added in v0.2.1
type RebasedCommit struct {
Old string `json:"old,omitempty"`
New string `json:"new,omitempty"`
Subject string `json:"subject"`
Change string `json:"change"`
}
RebasedCommit is one commit before (Old) and after (New), short hashes; Change is "same", "changed" (a conflict was resolved in it), "dropped" or "added".
type RepoFormat ¶ added in v0.2.1
type RepoFormat struct {
Objects string `json:"objects,omitempty"`
Refs string `json:"refs,omitempty"`
}
RepoFormat is a repository's object hash and refs backend: git 3 makes new repositories sha256 and reftable, and conch meets both kinds.
type ResolveAsk ¶ added in v0.2.1
type ResolveAsk struct {
Pane string `json:"pane"`
By string `json:"by,omitempty"`
At time.Time `json:"at"`
Files []string `json:"files,omitempty"`
}
ResolveAsk is an agent asked to resolve a branch's conflict: its pane, who asked ("autopilot", or empty for the person), when, and the files that conflicted then.
type ReviewComment ¶ added in v0.1.9
type ReviewComment struct {
ID string `json:"id,omitempty"`
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
File string `json:"file"`
Hunk string `json:"hunk,omitempty"`
Line int `json:"line,omitempty"`
Note string `json:"note"`
By string `json:"by,omitempty"` // an agent's pane that wrote it; "" for a person
At time.Time `json:"at,omitempty"`
// SentTo is the agent a conch note was handed to (its pane's name),
// SentPane that pane and SentAt when; SentAt is nil while it waits to
// be sent, so a waiting note carries no date (review.thread.v1).
// Replies then hold the answers.
SentTo string `json:"sent_to,omitempty"`
SentPane string `json:"sent_pane,omitempty"`
SentAt *time.Time `json:"sent_at,omitempty"`
// A comment from the branch's pull request (Source ReviewGitHub) is
// read from GitHub and can't be changed here: By is the reviewer's
// login, URL the comment, Outdated says the lines have changed since
// it was written, and Replies are the rest of its thread. One with no
// File is a review's own words about the pull request as a whole.
Source string `json:"source,omitempty"`
URL string `json:"url,omitempty"`
Outdated bool `json:"outdated,omitempty"`
Replies []ReviewReply `json:"replies,omitempty"`
}
ReviewComment is one comment on a branch's diff, for its agent. Hunk is the hunk's text as it was when the comment was written, so the comment still says what it was about once the agent has rewritten those lines; without one, Line (1-based, in the new file) says where, and without either it is about the whole file.
review.set takes one: with an ID it changes that comment, without one it changes the comment already on the same place or adds it, and an empty note removes it.
type ReviewLineNew ¶ added in v0.1.9
type ReviewLineNew struct {
File string `json:"file"`
Line int `json:"line"`
Note string `json:"note"`
}
ReviewLineNew is a comment on one line of a pull request's diff.
type ReviewList ¶ added in v0.1.9
type ReviewList struct {
ProjectID string `json:"project_id,omitempty"`
Branch string `json:"branch,omitempty"`
Comments []ReviewComment `json:"comments"`
}
ReviewList is a branch's comments in the order they were written, or with no branch named every branch's.
type ReviewRef ¶ added in v0.1.9
type ReviewRef struct {
ProjectID string `json:"project_id,omitempty"` // "" lists every project's
Branch string `json:"branch,omitempty"`
// Sent lists the notes already sent as well, with their replies
// (review.thread.v1); without it only those waiting to be sent.
Sent bool `json:"sent,omitempty"`
}
ReviewRef names a branch whose comments to list.
type ReviewReply ¶ added in v0.1.9
type ReviewReply struct {
By string `json:"by,omitempty"`
Note string `json:"note"`
At time.Time `json:"at,omitempty"`
}
ReviewReply is a later comment in a pull request's thread.
type ReviewReplyParams ¶ added in v0.1.9
type ReviewReplyParams struct {
ProjectID string `json:"project_id"`
ID string `json:"id"`
Note string `json:"note"`
}
ReviewReplyParams answers note ID on a branch of ProjectID: an agent saying what it did about it, or the person answering back, which puts the note back among those waiting to be sent with its thread.
type ReviewSendParams ¶ added in v0.1.9
type ReviewSendParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Agent string `json:"agent,omitempty"`
Pane string `json:"pane,omitempty"`
New bool `json:"new,omitempty"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
}
ReviewSendParams hands a branch's comments to the agent working on it. With none there, Agent names one to start in its worktree; without it the send is refused. Pane names the agent to give them to instead of choosing one; New starts Agent even beside the agents already there.
type ReviewSendResult ¶ added in v0.1.9
type ReviewSendResult struct {
Pane PaneInfo `json:"pane"`
Started bool `json:"started,omitempty"`
Sent int `json:"sent"`
Turn int `json:"turn,omitempty"`
}
ReviewSendResult says where the comments went: an agent that was there, or one started with them (Started).
type ScheduleList ¶ added in v0.1.9
type ScheduleList struct {
Items []ScheduledItem `json:"items"`
}
ScheduleList is every item the server is keeping, soonest first.
type ScheduledItem ¶ added in v0.1.9
type ScheduledItem struct {
ID string `json:"id"`
At time.Time `json:"at"`
// EveryMinutes repeats the item that often, from At on.
EveryMinutes int `json:"every_minutes,omitempty"`
// A message: Pane and the Agent expected there, so a pane that has
// since run something else is not typed into.
Pane string `json:"pane,omitempty"`
Agent string `json:"agent,omitempty"`
Text string `json:"text,omitempty"`
// PaneCreated is when that pane started, set by the server: a server
// started afresh numbers its panes from p1 again, and a message must
// not reach a stranger that happens to share the ID.
PaneCreated time.Time `json:"pane_created,omitempty"`
// Or a task, as task.create takes it. A repeating one gets a branch of
// its own each time.
Task *TaskCreateParams `json:"task,omitempty"`
// Queue holds a task back, past At, until fewer than WIP agents are
// running in its project: a backlog that starts work as the person
// finishes looking at the last. WIP 0 means DefaultWIP.
Queue bool `json:"queue,omitempty"`
WIP int `json:"wip,omitempty"`
// After holds a task back until other work has finished (CapTaskAfter):
// a branch of the project, or the ID of a task still on the schedule.
// The task then starts from that branch, stacked on it, unless it
// names a Base of its own — or from the project's base, when the branch
// has been merged and deleted meanwhile.
After string `json:"after,omitempty"`
// AfterBranch is the branch waited for, set by the server: After itself,
// or the branch the task it names started on. AfterHead is that
// branch's last commit seen, which tells a merged branch from a
// discarded one once it is gone, and AfterSeen that its agent has been
// seen at work — so an agent idle because it has not begun is not
// taken for one that has finished.
AfterBranch string `json:"after_branch,omitempty"`
AfterHead string `json:"after_head,omitempty"`
AfterSeen bool `json:"after_seen,omitempty"`
// Note says why, for lists: "after the 5-hour limit resets".
Note string `json:"note,omitempty"`
Created time.Time `json:"created"`
// LastRun and LastError are how its last run went.
LastRun time.Time `json:"last_run,omitempty"`
LastError string `json:"last_error,omitempty"`
// Waiting says why a due message has not gone yet: the agent is
// working, or waiting on a question of its own.
Waiting string `json:"waiting,omitempty"`
}
ScheduledItem is something the server does at a time to come: a message to the agent running in Pane (Text), or a task to start (Task). EveryMinutes repeats it; 0 runs it once.
type ServerHeap ¶ added in v0.2.1
type ServerHeap struct {
At time.Time `json:"at"`
Heap string `json:"heap"`
Goroutines string `json:"goroutines"`
HeapInuse uint64 `json:"heap_inuse"` // bytes in use by live objects' spans
HeapAlloc uint64 `json:"heap_alloc"` // bytes of live objects
HeapObjects uint64 `json:"heap_objects"` // live objects
Sys uint64 `json:"sys"` // bytes taken from the system, all told
Goroutine int `json:"goroutine"` // goroutines running
Panes int `json:"panes"`
}
ServerHeap is the server's memory at one moment, read after a garbage collection so it counts what is still held rather than what is waiting to be freed. Heap and Goroutines are the files written, on the server's machine: a heap profile (pprof, gzipped) and the goroutines with their stacks (text). They hold names of the server's functions and sizes, never what a pane shows.
type ServerReloadParams ¶
type ServerReloadParams struct {
Binary string `json:"binary,omitempty"`
}
ServerReloadParams replaces the server's program without stopping its panes. Binary defaults to the server's own executable path (where a new build was installed).
type ServerReloadResult ¶
type ServerReloadResult struct {
Binary string `json:"binary"`
}
ServerReloadResult names the program the server is reloading into. The connection drops as it does; clients reconnect.
type SessionExport ¶ added in v0.1.3
type SessionExport struct {
Name string `json:"name"` // file name, e.g. claude-c1.md
Doc string `json:"doc"`
}
SessionExport is a saved conversation rendered as a handoff document, the answer to session.export (whose params are a SessionRef).
type SessionInfo ¶
type SessionInfo struct {
Agent string `json:"agent"`
// Account is the account whose folder holds the conversation, "" for
// the agent's own (CapAccounts); resuming it starts on that account.
Account string `json:"account,omitempty"`
ID string `json:"id,omitempty"` // "" for an interrupted run whose conversation wasn't found
Dir string `json:"dir"`
Branch string `json:"branch,omitempty"`
Title string `json:"title"`
Started time.Time `json:"started,omitempty"`
Updated time.Time `json:"updated"`
// PaneID is set while the session is open in a pane.
PaneID string `json:"pane_id,omitempty"`
// Interrupted means the agent was running in conch when its server
// stopped (a restart or reboot) and hasn't been resumed.
Interrupted bool `json:"interrupted,omitempty"`
// Snippet is the text around a match inside the conversation, in
// session.search results; empty when the title or other details matched.
Snippet string `json:"snippet,omitempty"`
// CostUSD is what the agent said the conversation cost and Output the
// tokens it generated, when its store records them (Claude Code and
// OpenCode report a cost, Codex tokens only).
CostUSD float64 `json:"cost_usd,omitempty"`
Output int `json:"output,omitempty"`
// Starred is a session somebody kept, to find again among the
// hundreds a project collects. conch's own mark, not the agent's:
// their files are theirs (session.star.v1).
Starred bool `json:"starred,omitempty"`
}
SessionInfo is a saved agent conversation.
type SessionList ¶
type SessionList struct {
Sessions []SessionInfo `json:"sessions"`
// Partial says an agent whose sessions come from another program had
// not answered yet, so the list is missing that agent's: ask again in
// a moment. Absent from older servers, which always waited.
Partial bool `json:"partial,omitempty"`
}
SessionList is the result of session.list, newest first.
type SessionListParams ¶
type SessionListParams struct {
ProjectID string `json:"project_id,omitempty"`
Dir string `json:"dir,omitempty"`
Limit int `json:"limit,omitempty"` // default 100
}
SessionListParams asks for the agent sessions saved for a project (its checkout and worktrees) or a directory.
type SessionRef ¶
type SessionRef struct {
Agent string `json:"agent"`
// Account is the session's own (SessionInfo.Account). The server finds
// it when it is not given, so an older client resumes on the right one.
Account string `json:"account,omitempty"`
ID string `json:"id,omitempty"`
Dir string `json:"dir"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
}
SessionRef names a session to resume or dismiss.
type SessionSearchParams ¶
type SessionSearchParams struct {
ProjectID string `json:"project_id,omitempty"`
Dir string `json:"dir,omitempty"`
Query string `json:"query"`
Limit int `json:"limit,omitempty"`
}
SessionSearchParams asks for the sessions of a project (or directory) whose title, branch, agent, ID or conversation contains every word of Query. The result is a SessionList.
type SessionShareParams ¶
type SessionShareParams struct {
// Doc is a conversation exported (session.export) on another machine:
// it is written to Name in Dir instead of reading the session here.
// From is that machine's name, for the agent's prompt.
// session it continues, so the tree shows the same work rather than a
// bare agent name. Empty leaves conch's default (the agent's name),
// and a server that predates this ignores it.
PaneName string `json:"pane_name,omitempty"`
}
SessionShareParams hands a saved conversation to another agent: conch writes it to a Markdown file in the session's directory, then starts To there with a prompt to read it, or (with PaneID) types that prompt into a running agent.
type SessionShareResult ¶
type SessionShareResult struct {
}
SessionShareResult is the pane that received the conversation and the file it was written to.
type SessionStarParams ¶ added in v0.1.9
type SessionStarParams struct {
Agent string `json:"agent"`
ID string `json:"id"`
On bool `json:"on"`
}
SessionStarParams marks a session as one to come back to, or stops. Agent and ID name it, as every session reference does.
type SetupGroup ¶
SetupGroup is a kind of setup: instructions, skills, MCP servers…
type SetupItem ¶
type SetupItem struct {
Name string `json:"name"`
Scope string `json:"scope"`
Path string `json:"path,omitempty"`
Detail string `json:"detail,omitempty"`
Missing bool `json:"missing,omitempty"`
}
SetupItem is one instruction file, skill, command, server or plugin. Scope is where it comes from: user, project, local, plugin, extension, system or conch.
type ShellThemes ¶
type ShellThemes struct {
Shell string `json:"shell"` // login shell, e.g. zsh
OMZ bool `json:"omz"` // Oh My Zsh is installed
Current string `json:"current,omitempty"` // ZSH_THEME set in .zshrc
Themes []string `json:"themes,omitempty"` // sorted
// Samples is each theme's prompt as zsh expands it, so a person can
// see what they are choosing. A server that cannot run zsh, or one
// from an older build, sends none and the names stand alone.
Samples map[string]string `json:"samples,omitempty"`
}
ShellThemes describes the prompt themes available on a machine.
type SkillChange ¶ added in v0.1.6
type SkillChange struct {
Skill string `json:"skill,omitempty"`
Path string `json:"path"`
Agents []string `json:"agents"`
Action string `json:"action"`
Detail string `json:"detail,omitempty"`
Error string `json:"error,omitempty"`
}
SkillChange is one SKILL.md and the agents that read it. Action is create, update, same, remove or skip (a skill of that name conch didn't write, left alone). Skill names which of conch's skills it is; a server from before conch had more than one leaves it out and means "conch".
type StaleBranch ¶ added in v0.2.1
type StaleBranch struct {
Name string `json:"name"`
Committed time.Time `json:"committed"`
Subject string `json:"subject,omitempty"`
Upstream string `json:"upstream,omitempty"`
Base bool `json:"base,omitempty"` // the base branch, never deleted
// Worktree is where the branch is checked out: it goes with that
// worktree (worktree.cleanup), not on its own.
Worktree string `json:"worktree,omitempty"`
Merged bool `json:"merged,omitempty"` // the base has all of it, or its pull request merged with its commit
Gone bool `json:"gone,omitempty"` // its upstream was deleted
// Unmerged counts its commits that neither the base nor its upstream
// has: what deleting it loses. A pushed branch loses nothing.
Unmerged int `json:"unmerged,omitempty"`
// Unknown says why Unmerged could not be counted (git failed, the
// listing ran out of time): such a branch is never suggested, and
// branch.prune refuses it, forced or not.
Unknown string `json:"unknown,omitempty"`
// Suggested means it can go without losing anything.
Suggested bool `json:"suggested,omitempty"`
}
StaleBranch is an old local branch and what deleting it would lose.
type StaleWorktree ¶ added in v0.1.1
type StaleWorktree struct {
Path string `json:"path"`
Branch string `json:"branch,omitempty"` // "" when detached
Base bool `json:"base,omitempty"` // the base branch, which cleanup keeps
Missing bool `json:"missing,omitempty"` // its folder is gone
Locked bool `json:"locked,omitempty"`
Panes bool `json:"panes,omitempty"` // panes run in it
// Uncommitted and Unmerged are what removing it loses (see
// BranchDiscardResult); a detached worktree's commits are not counted.
Uncommitted int `json:"uncommitted,omitempty"`
Unmerged int `json:"unmerged,omitempty"`
Merged bool `json:"merged,omitempty"` // the base has all of the branch
Gone bool `json:"gone,omitempty"` // its upstream was deleted
PR *PRInfo `json:"pr,omitempty"`
Committed time.Time `json:"committed,omitempty"` // the branch's last commit
// Reasons say why it looks finished ("merged", "folder gone");
// Suggested means it can go without losing anything.
Reasons []string `json:"reasons,omitempty"`
Suggested bool `json:"suggested,omitempty"`
// Operation is what git left unfinished in it ("rebase", "merge"…), as
// in WorktreeInfo: such a worktree is never suggested, and mid-rebase
// Branch is the branch being rebased (CapWorktreeOperation).
Operation string `json:"operation,omitempty"`
}
StaleWorktree is a linked worktree and what removing it would lose.
type Subagent ¶ added in v0.1.7
type Subagent struct {
ID string `json:"id"`
Type string `json:"type,omitempty"` // e.g. general-purpose, Explore
Description string `json:"description,omitempty"` // the task it was given, when known
Since time.Time `json:"since"`
}
Subagent is an agent running inside another agent's process, known from the hooks that say it started and stopped.
type SyncChange ¶ added in v0.1.5
type SyncChange struct {
Agent string `json:"agent,omitempty"`
Kind string `json:"kind"`
Name string `json:"name"`
Path string `json:"path,omitempty"`
Action string `json:"action"`
Detail string `json:"detail,omitempty"`
Done bool `json:"done,omitempty"`
Error string `json:"error,omitempty"`
}
SyncChange is one thing a sync would do, or did: Action is create, update, link, same, skip or remove, and Path is inside the checkout.
type SystemCPU ¶ added in v0.2.1
type SystemCPU struct {
Total float64 `json:"total"`
User float64 `json:"user,omitempty"`
System float64 `json:"system,omitempty"`
Split bool `json:"split,omitempty"`
Cores []float64 `json:"cores,omitempty"`
}
SystemCPU is the share of the whole machine in use since the last sample, 0–100. User and System are set only where the machine says how it splits (Split); Cores only where it says per core.
type SystemDisk ¶ added in v0.2.1
type SystemDisk struct {
Path string `json:"path"`
Total uint64 `json:"total"`
Free uint64 `json:"free"`
}
SystemDisk is the filesystem the home directory is on.
type SystemHost ¶ added in v0.2.1
type SystemHost struct {
Name string `json:"name,omitempty"`
OS string `json:"os,omitempty"` // "macOS 26.1", "Linux 6.8.0"
Arch string `json:"arch,omitempty"`
Model string `json:"model,omitempty"` // the processor, as the machine names it
Cores int `json:"cores"`
PCores int `json:"p_cores,omitempty"` // Apple silicon's performance cores…
ECores int `json:"e_cores,omitempty"` // …and efficiency cores
// Uptime is how long since the machine started, in seconds.
Uptime int64 `json:"uptime,omitempty"`
}
SystemHost is what the machine is.
type SystemMemory ¶ added in v0.2.1
type SystemMemory struct {
Total uint64 `json:"total"`
Used uint64 `json:"used"`
Apps uint64 `json:"apps,omitempty"`
Wired uint64 `json:"wired,omitempty"`
Compressed uint64 `json:"compressed,omitempty"`
Cached uint64 `json:"cached,omitempty"`
Free uint64 `json:"free"`
SwapTotal uint64 `json:"swap_total,omitempty"`
SwapUsed uint64 `json:"swap_used,omitempty"`
Pressure string `json:"pressure,omitempty"`
}
SystemMemory is in bytes. Used is what programs hold (Apps, Wired and Compressed where the machine tells them apart); Cached is file data the system can let go of; Pressure is "normal", "warn" or "critical" when the machine says.
type SystemPoint ¶ added in v0.2.1
type SystemPoint struct {
At time.Time `json:"at"`
CPU float64 `json:"cpu"`
User float64 `json:"user,omitempty"`
System float64 `json:"system,omitempty"`
MemUsed uint64 `json:"mem_used"`
Compressed uint64 `json:"compressed,omitempty"`
}
SystemPoint is one moment of the history: the machine's CPU (0–100) and memory in use, in bytes. The server keeps an hour of them while anybody is asking, and a little longer.
type SystemProcess ¶ added in v0.2.1
type SystemProcess struct {
PID int `json:"pid"`
PPID int `json:"ppid"`
Name string `json:"name"`
Command string `json:"command,omitempty"`
User string `json:"user,omitempty"`
CPU *float64 `json:"cpu,omitempty"`
RSS uint64 `json:"rss"`
Threads int `json:"threads,omitempty"`
Started time.Time `json:"started,omitzero"`
Pane string `json:"pane,omitempty"`
PaneName string `json:"pane_name,omitempty"`
Project string `json:"project,omitempty"`
Branch string `json:"branch,omitempty"`
Agent string `json:"agent,omitempty"`
Conch string `json:"conch,omitempty"`
}
SystemProcess is one process. CPU is the share of one core since the last sample (200 is two cores), absent on the first. Pane and the fields after it are set for a process conch started — its pane's id and name, the pane's project and branch, the agent in it — and Conch is "server" for the server itself and what it runs outside any pane.
type SystemStats ¶ added in v0.2.1
type SystemStats struct {
At time.Time `json:"at"`
Host SystemHost `json:"host"`
CPU *SystemCPU `json:"cpu,omitempty"`
Memory *SystemMemory `json:"memory,omitempty"`
Load []float64 `json:"load,omitempty"` // 1, 5 and 15 minutes
Disk *SystemDisk `json:"disk,omitempty"`
Procs int `json:"procs,omitempty"` // every process, not only those listed
Processes []SystemProcess `json:"processes,omitempty"`
History []SystemPoint `json:"history,omitempty"`
}
SystemStats is the machine at one moment. CPU is nil until there is a second sample to measure it by; anything the machine would not say is left out rather than given as zero.
type SystemStatsParams ¶ added in v0.2.1
type SystemStatsParams struct {
Since time.Time `json:"since,omitzero"`
Summary bool `json:"summary,omitempty"`
}
SystemStatsParams asks for the machine. Since is the newest history point the client already holds: only newer ones come back, so a window asking every two seconds is not sent the last hour each time. Summary leaves out the processes and the history — a machine's line in a list.
type TaskCreateParams ¶
type TaskCreateParams struct {
ProjectID string `json:"project_id"`
Prompt string `json:"prompt"`
Branch string `json:"branch,omitempty"`
Base string `json:"base,omitempty"`
Agent string `json:"agent,omitempty"` // default: the server's first agent (claude)
// Account is the agent's account, as PaneCreateParams has it.
Account string `json:"account,omitempty"`
// Name names the pane, as pane.rename does, so it can be addressed
// by it; see IsPaneID.
Name string `json:"name,omitempty"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
// Issue is a GitHub issue of the project to work on (CapIssues): the
// server reads it through gh, and its title and body become the
// prompt — Prompt, when given too, is added as further instructions —
// and its number starts the branch's name.
Issue int `json:"issue,omitempty"`
// Ticket is a Linear or Jira ticket to work on (CapTickets): ENG-123,
// linear:ENG-123 or its address. The server reads it, its title, body
// and comments become the prompt as an issue's do, and its key starts
// the branch's name.
Ticket string `json:"ticket,omitempty"`
}
TaskCreateParams starts an agent on a new branch in its own worktree. Branch defaults to one derived from the prompt, Base to the project's.
type TicketCheckParams ¶ added in v0.2.1
type TicketCheckParams struct {
ProjectID string `json:"project_id,omitempty"`
}
TicketCheckParams asks how the trackers stand (CapTicketCheck). With a project, GitHub's counts are that project's issues.
type TicketCheckResult ¶ added in v0.2.1
type TicketCheckResult struct {
Trackers []TrackerState `json:"trackers"`
Projects []TrackerProjectState `json:"projects,omitempty"`
}
TicketCheckResult is ticket.check's answer: GitHub, Linear and Jira in that order, then each project's entry.
type TicketComment ¶ added in v0.2.1
TicketComment is one comment on a ticket.
type TicketDoing ¶ added in v0.2.1
type TicketDoing struct {
State string `json:"state,omitempty"`
Pane string `json:"pane,omitempty"`
Branch string `json:"branch,omitempty"`
Schedule string `json:"schedule,omitempty"`
Note string `json:"note,omitempty"`
PR *PRInfo `json:"pr,omitempty"`
}
TicketDoing is what conch is doing about a ticket; empty State is nothing. Pane is its agent, Branch the branch named for it, Schedule the queued item, and PR the branch's pull request.
type TicketGetParams ¶ added in v0.2.1
type TicketGetParams struct {
ProjectID string `json:"project_id"`
// Ticket is its key, linear:KEY or its address.
Ticket string `json:"ticket"`
}
TicketGetParams reads one ticket (CapTickets).
type TicketInfo ¶ added in v0.2.1
type TicketInfo struct {
Tracker string `json:"tracker"`
Key string `json:"key"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
Status string `json:"status,omitempty"`
Body string `json:"body,omitempty"`
Comments []TicketComment `json:"comments,omitempty"`
Links []TicketLink `json:"links,omitempty"`
}
TicketInfo is one ticket. A list leaves out the body, comments and links.
type TicketLink ¶ added in v0.2.1
TicketLink is a link attached to a ticket.
type TicketList ¶ added in v0.2.1
type TicketList struct {
Tracker string `json:"tracker"`
Tickets []TicketInfo `json:"tickets"`
}
TicketList is a project's open tickets, most recently changed first.
type TicketOverview ¶ added in v0.2.1
type TicketOverview struct {
Projects []TicketProject `json:"projects"`
}
type TicketOverviewParams ¶ added in v0.2.1
type TicketOverviewParams struct {
ProjectIDs []string `json:"project_ids,omitempty"`
Limit int `json:"limit,omitempty"`
}
TicketOverviewParams asks for the Tickets view (CapTicketOverview): every git project's, or those named; Limit tickets a source (0: 50).
type TicketProject ¶ added in v0.2.1
type TicketProject struct {
ProjectID string `json:"project_id,omitempty"`
Name string `json:"name"`
Sources []string `json:"sources,omitempty"` // "github", "linear · ENG"
Tickets []TicketRow `json:"tickets"`
Errors []string `json:"errors,omitempty"`
}
TicketProject is one project's tickets, or why some could not be read. A tracker's tickets set up with no project are a group with no ID.
type TicketRow ¶ added in v0.2.1
type TicketRow struct {
Source string `json:"source"`
Key string `json:"key"`
Number int `json:"number,omitempty"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
Status string `json:"status,omitempty"`
Labels []string `json:"labels,omitempty"`
Mine bool `json:"mine,omitempty"`
Doing TicketDoing `json:"doing"`
}
TicketRow is one ticket in the overview. Source is github, linear or jira; Key is the issue number for GitHub (Number too) and the tracker's key otherwise.
type TicketUpdateParams ¶ added in v0.2.1
type TicketUpdateParams struct {
ProjectID string `json:"project_id"`
Ticket string `json:"ticket"`
Comment string `json:"comment,omitempty"`
// Status is the status to move it to (In Review, Done), as the
// tracker names it.
Status string `json:"status,omitempty"`
LinkURL string `json:"link_url,omitempty"`
LinkTitle string `json:"link_title,omitempty"`
}
TicketUpdateParams changes a ticket (CapTickets): each of a comment, a status and a link that is given, in that order. The reply is the ticket as it is after.
type TicketsParams ¶ added in v0.2.1
type TicketsParams struct {
ProjectID string `json:"project_id"`
// Tracker is linear or jira, when both are set up; "" chooses as a
// ticket's key would.
Tracker string `json:"tracker,omitempty"`
// Assigned keeps the tickets assigned to the key's own person.
Assigned bool `json:"assigned,omitempty"`
Limit int `json:"limit,omitempty"`
}
TicketsParams lists a project's open tickets (CapTickets), from the tracker its [[trackers.projects]] entry names, or the one set up.
type Tokens ¶
type Tokens struct {
Input int `json:"input"`
CacheWrite int `json:"cache_write"`
CacheRead int `json:"cache_read"`
Output int `json:"output"`
Context int `json:"context"` // size of the latest request's context
Model string `json:"model,omitempty"`
// CostUSD is set when the agent reports what the session cost.
CostUSD float64 `json:"cost_usd,omitempty"`
// ContextSize is the model's context window, when the agent reports it.
ContextSize int `json:"context_size,omitempty"`
}
Tokens is an agent session's token usage, from its transcript.
type TrackerArea ¶ added in v0.2.1
TrackerArea is a Linear team or a Jira project the key can see.
type TrackerProjectState ¶ added in v0.2.1
type TrackerProjectState struct {
Project string `json:"project"`
Tracker string `json:"tracker"`
Area string `json:"area,omitempty"`
Open int `json:"open,omitempty"`
More bool `json:"more,omitempty"`
Error string `json:"error,omitempty"`
}
TrackerProjectState is one [[trackers.projects]] entry: a project, its tracker and team or project, and how many tickets are open there.
type TrackerState ¶ added in v0.2.1
type TrackerState struct {
Tracker string `json:"tracker"`
State string `json:"state"`
Who string `json:"who,omitempty"`
Email string `json:"email,omitempty"`
Workspace string `json:"workspace,omitempty"`
Areas []TrackerArea `json:"areas,omitempty"`
Area string `json:"area,omitempty"`
Open int `json:"open,omitempty"`
Mine int `json:"mine,omitempty"`
More bool `json:"more,omitempty"`
KeyFrom string `json:"key_from,omitempty"`
Error string `json:"error,omitempty"`
}
TrackerState is how one tracker stands. KeyFrom says where its key is read from (config.toml, $VARIABLE, the Keychain, gh's own login) — never the key. Open and Mine count the open tickets in Area (the team or project tickets are listed from, "" for all), up to TicketCountMax; More says there were that many or more.
type UsageBucket ¶ added in v0.2.2
type UsageBucket struct {
Start time.Time `json:"start"`
UsageTokens
Models []ModelUsage `json:"models,omitempty"`
}
UsageBucket is what was used from Start for an hour or a day.
type UsageHistory ¶ added in v0.1.9
type UsageHistory struct {
At time.Time `json:"at"`
Agents []AgentUsage `json:"agents,omitempty"`
}
UsageHistory is what agents on a machine used, as of At: each agent's periods (the last 24 hours, 7 days and 30 days), with what each model used within them. An agent with nothing saved in the last 30 days is left out.
type UsageHistoryParams ¶ added in v0.2.2
type UsageHistoryParams struct {
ByAccount bool `json:"by_account,omitempty"`
}
UsageHistoryParams asks for usage.history by account, with Hours and Days (CapUsageAccounts); without it, one entry per agent as before.
type UsagePeriod ¶ added in v0.1.9
type UsagePeriod struct {
Hours int `json:"hours"`
UsageTokens
Models []ModelUsage `json:"models,omitempty"`
}
UsagePeriod is what was used in the last Hours hours, in all and by model, the model that used most first.
type UsageTokens ¶ added in v0.1.9
type UsageTokens struct {
Input int `json:"input"`
CacheWrite int `json:"cache_write,omitempty"`
CacheRead int `json:"cache_read,omitempty"`
Output int `json:"output"`
Messages int `json:"messages,omitempty"`
}
UsageTokens counts tokens: input not read from the cache, input written to it and read from it, output, and how many responses they came from.
func (*UsageTokens) Add ¶ added in v0.1.9
func (u *UsageTokens) Add(o UsageTokens)
Add adds another's counts to these.
func (UsageTokens) Total ¶ added in v0.1.9
func (u UsageTokens) Total() int
Total is every token counted.
type ViewShowParams ¶ added in v0.1.9
type ViewShowParams struct {
Panes []string `json:"panes"`
// Name is what to call the tab, when one is opened.
Name string `json:"name,omitempty"`
// Why names the agent asking, for the line conch shows the person:
// a screen that rearranges itself has to say who asked.
Why string `json:"why,omitempty"`
}
ViewShowParams asks the TUIs to show these panes together. One pane is a request to reveal it; several are a request to put them side by side.
type ViewShowResult ¶ added in v0.1.9
type ViewShowResult struct {
Panes []string `json:"panes,omitempty"`
}
ViewShowResult is the panes the request was passed on for, in order and without the ones named twice.
type ViewState ¶ added in v0.1.9
type ViewState struct {
// Client names the TUI, for telling two apart when somebody is
// looking at the same machine from a phone and a terminal.
Client string `json:"client,omitempty"`
// Focus is the pane with the keyboard, "" when the tree has it.
Focus string `json:"focus,omitempty"`
Tabs []ViewTab `json:"tabs,omitempty"`
// At is when the TUI published it.
At time.Time `json:"at,omitempty"`
}
ViewState is what a TUI is showing: its tabs in the order the bar lists them, and the pane the keyboard is on. A client publishes it when it changes; the server keeps the last one and answers view.get with it. Nothing of the layout is the server's own — it is carrying a TUI's answer to anything that asks.
type ViewTab ¶ added in v0.1.9
type ViewTab struct {
Name string `json:"name,omitempty"`
Panes []string `json:"panes,omitempty"`
Active bool `json:"active,omitempty"`
}
ViewTab is one tab: what it is called and the panes it shows, left to right then top to bottom. A split showing a diff or a page rather than a pane contributes no id, since there is nothing an agent could address.
type WorktreeAddParams ¶
type WorktreeAddParams struct {
ProjectID string `json:"project_id"`
Branch string `json:"branch"`
Base string `json:"base,omitempty"`
}
WorktreeAddParams checks Branch out into a new worktree, creating the branch from Base when it doesn't exist.
type WorktreeChanged ¶ added in v0.1.3
type WorktreeChanged struct {
ProjectID string `json:"project_id"`
Worktree string `json:"worktree"`
Paths []string `json:"paths,omitempty"`
More bool `json:"more,omitempty"`
}
WorktreeChanged says a worktree's files changed on disk. Paths are relative to Worktree, slash-separated, and capped: More says some were left out, and a reader that cares about a particular file re-reads it anyway rather than trusting the list to be complete.
type WorktreeCleanupParams ¶ added in v0.1.1
type WorktreeCleanupParams struct {
ProjectID string `json:"project_id"`
Remove []CleanupWorktree `json:"remove"`
}
WorktreeCleanupParams removes linked worktrees, deleting their branches (except the base) and pruning those whose folder is gone. Each is checked again first: without Force, one that would lose work is skipped.
type WorktreeCleanupResult ¶ added in v0.1.1
type WorktreeCleanupResult struct {
Removed []string `json:"removed,omitempty"`
Failed []CleanupFailure `json:"failed,omitempty"`
}
WorktreeCleanupResult says what cleanup removed and what it didn't.
type WorktreeFilesParams ¶
type WorktreeFilesParams struct {
ProjectID string `json:"project_id"`
Path string `json:"path"`
Overwrite bool `json:"overwrite,omitempty"`
}
WorktreeFilesParams copies the project's local files from the main checkout into a linked worktree. Existing files are kept unless Overwrite.
type WorktreeFilesResult ¶
type WorktreeFilesResult struct {
Copied []string `json:"copied,omitempty"`
Skipped []string `json:"skipped,omitempty"` // with a reason, e.g. ".env (exists)"
}
WorktreeFilesResult lists what worktree.copy_files did.
type WorktreeHaveParams ¶ added in v0.1.4
type WorktreeHaveParams struct {
ProjectID string `json:"project_id"`
Commits []string `json:"commits"`
}
WorktreeHaveParams asks which Commits a project's repository has.
type WorktreeHaveResult ¶ added in v0.1.4
type WorktreeHaveResult struct {
Have []string `json:"have"`
}
WorktreeHaveResult lists the commits found, in the order asked.
type WorktreeInfo ¶
type WorktreeInfo struct {
Path string `json:"path"`
Branch string `json:"branch,omitempty"`
Head string `json:"head,omitempty"`
Detached bool `json:"detached,omitempty"`
Main bool `json:"main,omitempty"`
Status *GitStatus `json:"status,omitempty"`
// Port is the first of the PortBlock ports given to this checkout, as
// CONCH_PORT in every pane started in it; 0 until one has been.
Port int `json:"port,omitempty"`
// Overlaps are the other checkouts of the project that have touched
// files this one has too: two agents heading for the same merge
// conflict. Conflicts are the files merging this branch into the base
// would conflict in, tried without merging — or, in a checkout stopped
// mid-rebase or merge, the files it stopped on. Both are absent from older
// servers, and Conflicts where git is older than 2.38.
Overlaps []Overlap `json:"overlaps,omitempty"`
Conflicts []string `json:"conflicts,omitempty"`
// Operation is what git left unfinished here: "rebase", "merge",
// "cherry-pick", "revert" or "am". Mid-rebase, Branch is the branch
// being rebased while Detached stays true, since HEAD is: a client
// shows the checkout under that branch. Absent from older servers
// (CapWorktreeOperation).
Operation string `json:"operation,omitempty"`
// Rebasing is the branch a rebase left unfinished in this checkout is
// rewriting, which Branch also names (CapWorktreeOperation): git
// detaches HEAD while it works. Absent from older servers.
Rebasing string `json:"rebasing,omitempty"`
// Resolve is the agent asked to resolve the branch's conflict with
// the base, while that conflict is there (CapBranchResolving).
Resolve *ResolveAsk `json:"resolve,omitempty"`
}
WorktreeInfo is a checkout of the project.
type WorktreeMoveInfo ¶ added in v0.1.4
type WorktreeMoveInfo struct {
Branch string `json:"branch"`
Head string `json:"head"`
Base string `json:"base,omitempty"`
Remote string `json:"remote,omitempty"`
History []string `json:"history,omitempty"`
// Staged and Unstaged count changed files; Other the untracked files
// that move along, Local the project's local files (.env and such).
Staged int `json:"staged,omitempty"`
Unstaged int `json:"unstaged,omitempty"`
Other int `json:"other,omitempty"`
Local []string `json:"local,omitempty"`
}
WorktreeMoveInfo is what moving a worktree would take, from worktree.describe: its branch and commits, the candidates another machine may already have (History, newest first) and its uncommitted work.
type WorktreePack ¶ added in v0.1.4
type WorktreePack struct {
ID string `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
}
WorktreePack is a packed worktree waiting to be read.
type WorktreePackChunk ¶ added in v0.1.4
type WorktreePackChunk struct {
Data []byte `json:"data,omitempty"`
EOF bool `json:"eof,omitempty"`
}
WorktreePackChunk is one piece of a pack (at most UploadChunkSize).
type WorktreePackParams ¶ added in v0.1.4
type WorktreePackParams struct {
ProjectID string `json:"project_id"`
Path string `json:"path"`
Have string `json:"have,omitempty"`
}
WorktreePackParams packs a worktree for another machine that already has commit Have ("" when it has none of the history).
type WorktreePackReadParams ¶ added in v0.1.4
WorktreePackReadParams reads a pack from Offset; the server deletes the pack once its end has been read.
type WorktreeRef ¶ added in v0.1.4
WorktreeRef names a worktree of a project.
type WorktreeRemoveParams ¶
WorktreeRemoveParams removes a (clean) linked worktree.
type WorktreeResult ¶
type WorktreeResult struct {
Path string `json:"path"`
Copied []string `json:"copied,omitempty"`
// Setup is the pane the project's setup command runs in; "" when the
// project has none.
Setup string `json:"setup,omitempty"`
}
WorktreeResult is the path of a created worktree and the local files copied into it from the main checkout.
type WorktreeStale ¶ added in v0.1.1
type WorktreeStale struct {
Worktrees []StaleWorktree `json:"worktrees"`
}
WorktreeStale lists a project's linked worktrees for cleaning up.
type WorktreeUnpackParams ¶ added in v0.1.4
WorktreeUnpackParams recreates a packed worktree in a project from a file uploaded with fs.upload.
type WorktreeUnpackResult ¶ added in v0.1.4
type WorktreeUnpackResult struct {
Path string `json:"path"`
Branch string `json:"branch"`
Files []string `json:"files,omitempty"` // untracked and local files written
}
WorktreeUnpackResult is the new worktree.