Documentation
¶
Overview ¶
Package mcp: thin-client stdio proxy.
Every Claude Code subagent process spawns its own copy of the project's .mcp.json-configured MCP servers, including "stapler-squad --mcp". Prior to this file, that meant each subprocess called buildMCPDeps() -> BuildCoreDeps() -> NewSessionServiceFromConfig(), which opens its own ent/SQLite client, EventBus, ReviewQueue, and ApprovalStore — a full duplicate of state the already-running stapler-squad HTTP server (localhost:8543) already holds. With N subagents in a session tree, that's N redundant SQLite connections and event buses for read-mostly MCP tool calls.
NewProxyCore/RunProxyServer instead connect to the running server's Streamable HTTP MCP endpoint (mounted at /mcp by NewHTTPHandler) and forward every stdio tool call to it, so the stdio subprocess holds no storage of its own. If the HTTP server isn't reachable (e.g. no daemon running yet), the caller falls back to the original fully-local NewCore() path.
Package mcp implements the MCP (Model Context Protocol) server for Stapler Squad. Activated by the --mcp flag; communicates over stdio transport.
Index ¶
- Constants
- Variables
- func InitMCPLogging()
- func NewCore(store session.InstanceStore, svc *services.SessionService, ...) *mcpserver.MCPServer
- func NewHTTPHandler(store session.InstanceStore, svc *services.SessionService, ...) *mcpserver.StreamableHTTPServer
- func NewProxyCore(ctx context.Context, httpURL string, headers map[string]string) (*mcpserver.MCPServer, *mcpclient.Client, error)
- func ProxyHeaders() map[string]string
- func RunProxyServer(ctx context.Context, httpURL string, headers map[string]string) error
- func RunServer(ctx context.Context, store session.InstanceStore, svc *services.SessionService, ...) error
- func WithSessionUUID(ctx context.Context, id string) context.Context
- type ApprovalRuleResult
- type BacklogItemSummaryResult
- type BranchInfo
- type CreateSessionForPRResult
- type CreateSessionResult
- type CreateWorkflowResult
- type DiffStats
- type GetNotificationHistoryResult
- type GetSessionDiffResult
- type GetSessionResult
- type GitHubPRSummary
- type ListApprovalRulesResult
- type ListBacklogItemsResult
- type ListGitHubPRsResult
- type ListSessionBranchesResult
- type ListSessionsResult
- type ListWorkflowsResult
- type ListWorkspacePeersResult
- type MCPError
- type MCPResult
- type NotificationRecordResult
- type PRVerification
- type ReadSessionOutputResult
- type ReviewCompletionSignaler
- type ReviewTrigger
- type RunCommandResult
- type RunWorkflowResult
- type SearchClaudeHistoryResult
- type SearchResultSummary
- type SearchSessionsResult
- type SendControlResult
- type SessionDetail
- type SessionSummary
- type SetSessionGoalResult
- type SnippetResult
- type SteerSessionResult
- type UpdateSessionTaskResult
- type UpdateWorkflowResult
- type UpsertApprovalRuleResult
- type WaitForBacklogEventResult
- type WaitForOutputResult
- type WorkflowResult
- type WorkspacePeerResult
- type WriteSessionResult
Constants ¶
const ( ErrPermissionDenied = "PERMISSION_DENIED" ErrItemNotFound = "ITEM_NOT_FOUND" ErrFeatureDisabled = "FEATURE_DISABLED" )
const ( ErrSessionNotFound = "SESSION_NOT_FOUND" ErrInvalidArgument = "INVALID_ARGUMENT" ErrInternalError = "INTERNAL_ERROR" ErrConfirmationRequired = "CONFIRMATION_REQUIRED" ErrInvalidStatusTrans = "INVALID_STATUS_TRANSITION" ErrSessionNotRunning = "SESSION_NOT_RUNNING" ErrRateLimitExceeded = "RATE_LIMIT_EXCEEDED" ErrSessionStartupTimeout = "SESSION_STARTUP_TIMEOUT" ErrInvalidPath = "INVALID_PATH" ErrPTYWriteTimeout = "PTY_WRITE_TIMEOUT" )
Error code constants — machine-readable identifiers for all tool failures.
Variables ¶
ErrProxyUnavailable wraps any failure to connect to the running HTTP MCP server during the initial handshake (transport start, initialize, or tools/list). Callers should treat this as non-fatal and fall back to a fully local MCP core.
Functions ¶
func InitMCPLogging ¶
func InitMCPLogging()
InitMCPLogging redirects all application loggers to stderr so that log lines do not pollute the MCP stdio channel (stdout). Must be called before RunServer.
func NewCore ¶
func NewCore(store session.InstanceStore, svc *services.SessionService, sbMgr *scrollback.ScrollbackManager, storage *session.Storage, eventBus *events.EventBus, prCache *githubpkg.UserPRCache, backlogEnabled func() bool, autoReopener session.AutoReopenSpawner, backlogSvc *services.BacklogService) *mcpserver.MCPServer
NewCore creates an MCPServer with all tools registered. Shared by the stdio path (RunServer) and the HTTP path (NewHTTPHandler). storage is optional — when nil, backlog tools are not registered. eventBus is optional — when nil, triage-complete notifications are disabled. prCache is optional — when nil, GitHub PR tools are not registered. backlogEnabled is optional — when nil, backlog/goal tools are always enabled (matches pre-flag behavior, used by tests). When set, it gates registration at startup (belt-and-suspenders) and is threaded into each backlog/goal handler so a live flag flip takes effect without restarting the MCP server. autoReopener is optional — when nil, submit_review_verdict skips its eager review->in_progress transition on FAIL/PARTIAL/UNVERIFIABLE verdicts and falls back to the pre-existing session-exit/sweep paths. backlogSvc is optional — when nil, create_backlog_item/import_github_issue skip the post-create auto-triage trigger (BUG-061) and create the item exactly as before that fix; see BacklogService.MaybeTriggerTriage.
func NewHTTPHandler ¶
func NewHTTPHandler(store session.InstanceStore, svc *services.SessionService, sbMgr *scrollback.ScrollbackManager, storage *session.Storage, eventBus *events.EventBus, prCache *githubpkg.UserPRCache, backlogEnabled func() bool, autoReopener session.AutoReopenSpawner, backlogSvc *services.BacklogService) *mcpserver.StreamableHTTPServer
NewHTTPHandler returns an http.Handler that serves the MCP protocol over Streamable HTTP (the MCP 2025-03-26 transport). Mount it at /mcp on the existing HTTP server so Claude sessions can connect without spawning a subprocess. eventBus is optional — pass nil to disable triage-complete notifications. prCache is optional — pass nil to disable GitHub PR tools. backlogEnabled is optional — see NewCore. backlogSvc is optional — see NewCore.
func NewProxyCore ¶ added in v1.37.0
func NewProxyCore(ctx context.Context, httpURL string, headers map[string]string) (*mcpserver.MCPServer, *mcpclient.Client, error)
NewProxyCore connects to an already-running stapler-squad HTTP server at httpURL and builds a local *mcpserver.MCPServer whose tools simply forward CallTool requests to it. Returns an error wrapping ErrProxyUnavailable if the remote server cannot be reached or fails the MCP handshake.
The returned *mcpclient.Client must be closed by the caller once the local server is done serving (e.g. via defer).
func ProxyHeaders ¶ added in v1.37.0
ProxyHeaders builds the HTTP headers forwarded on every request to the remote MCP endpoint. Mirrors the X-Stapler-Session-UUID header injected by claudeMCPConfigArgs for the primary (non-proxied) HTTP MCP path, so backlog tools can identify the calling session the same way regardless of transport.
func RunProxyServer ¶ added in v1.37.0
RunProxyServer connects to the running stapler-squad HTTP server and serves stdio MCP as a thin forwarding proxy, blocking until stdin closes or ctx is cancelled. Returns an error wrapping ErrProxyUnavailable (safe to fall back to a local core) if the initial handshake fails; any error returned after a successful handshake reflects a mid-session failure and should not trigger a fallback (stdout may already carry a partial MCP session).
func RunServer ¶
func RunServer(ctx context.Context, store session.InstanceStore, svc *services.SessionService, sbMgr *scrollback.ScrollbackManager, storage *session.Storage, eventBus *events.EventBus, prCache *githubpkg.UserPRCache, backlogEnabled func() bool, autoReopener session.AutoReopenSpawner, backlogSvc *services.BacklogService) error
RunServer initializes and starts the MCP stdio server. It blocks until the context is cancelled or stdin is closed. store is used for read-only discovery tools. svc provides lifecycle operations. sbMgr provides read access to terminal scrollback data persisted on disk. storage is used for backlog tools (optional; pass nil to disable). eventBus is optional — pass nil to disable triage-complete notifications on stdio path. prCache is optional — pass nil to disable GitHub PR tools. backlogEnabled is optional — see NewCore. autoReopener is optional — see NewCore. The stdio fallback path (buildMCPDeps in main.go) only builds Phase 1 (CoreDeps) dependencies, which has no *services.BacklogService, so callers on that path pass nil and submit_review_verdict's eager transition is skipped there — the session-exit/sweep paths still apply. backlogSvc is optional — see NewCore. Same Phase-1-only caveat as autoReopener above: the stdio fallback path has no *services.BacklogService to pass, so create_backlog_item/import_github_issue skip auto-triage there.
Types ¶
type ApprovalRuleResult ¶ added in v1.41.0
type ApprovalRuleResult struct {
ID string `json:"id"`
Name string `json:"name"`
ToolName string `json:"tool_name,omitempty"`
ToolPattern string `json:"tool_pattern,omitempty"`
ToolCategory string `json:"tool_category,omitempty"`
CommandPattern string `json:"command_pattern,omitempty"`
FilePattern string `json:"file_pattern,omitempty"`
Decision string `json:"decision"`
RiskLevel string `json:"risk_level"`
Reason string `json:"reason,omitempty"`
Alternative string `json:"alternative,omitempty"`
Priority int32 `json:"priority"`
Enabled bool `json:"enabled"`
Source string `json:"source,omitempty"`
Programs []string `json:"programs,omitempty"`
Subcommands []string `json:"subcommands,omitempty"`
BlockedSubcommands []string `json:"blocked_subcommands,omitempty"`
RequiredFlags []string `json:"required_flags,omitempty"`
ForbiddenFlags []string `json:"forbidden_flags,omitempty"`
}
ApprovalRuleResult is the wire representation of an approval rule returned by MCP tools.
type BacklogItemSummaryResult ¶ added in v1.44.0
type BacklogItemSummaryResult struct {
ID string `json:"id"`
Title string `json:"title"`
Status string `json:"status"`
Priority int `json:"priority"`
CreatedAt time.Time `json:"created_at"`
}
BacklogItemSummaryResult is a trimmed backlog item shown in list_backlog_items results.
type BranchInfo ¶
BranchInfo holds branch metadata for list_session_branches.
type CreateSessionForPRResult ¶ added in v1.35.0
type CreateSessionForPRResult struct {
MCPResult
Session *SessionDetail `json:"session,omitempty"`
}
CreateSessionForPRResult is returned by create_session_for_pr.
type CreateSessionResult ¶
type CreateSessionResult struct {
MCPResult
Session *SessionDetail `json:"session,omitempty"`
MCPInjectionFailed bool `json:"mcp_injection_failed,omitempty"`
}
CreateSessionResult is returned by create_session.
type CreateWorkflowResult ¶ added in v1.41.0
type CreateWorkflowResult struct {
MCPResult
Workflow WorkflowResult `json:"workflow"`
}
type DiffStats ¶
type DiffStats struct {
FilesChanged int `json:"files_changed"`
Insertions int `json:"insertions"`
Deletions int `json:"deletions"`
}
DiffStats mirrors git.DiffStats for JSON output.
type GetNotificationHistoryResult ¶ added in v1.44.0
type GetNotificationHistoryResult struct {
MCPResult
Notifications []NotificationRecordResult `json:"notifications"`
TotalCount int `json:"total_count"`
UnreadCount int `json:"unread_count"`
HasMore bool `json:"has_more"`
}
GetNotificationHistoryResult is returned by get_notification_history.
type GetSessionDiffResult ¶
type GetSessionDiffResult struct {
MCPResult
Diff string `json:"diff"`
Stats DiffStats `json:"stats"`
Truncated bool `json:"truncated"`
}
GetSessionDiffResult is the response for get_session_diff.
type GetSessionResult ¶
type GetSessionResult struct {
MCPResult
Session *SessionDetail `json:"session,omitempty"`
}
GetSessionResult is returned by get_session.
type GitHubPRSummary ¶ added in v1.35.0
type GitHubPRSummary struct {
Owner string `json:"owner"`
Repo string `json:"repo"`
Number int `json:"number"`
Title string `json:"title"`
URL string `json:"url"`
Branch string `json:"branch"`
BaseBranch string `json:"base_branch"`
IsDraft bool `json:"is_draft"`
CIStatus string `json:"ci_status"`
ApprovedCount int `json:"approved_count"`
ChangesReqCount int `json:"changes_req_count"`
UpdatedAt time.Time `json:"updated_at"`
ExistingSessionID string `json:"existing_session_id,omitempty"`
WorktreePath string `json:"worktree_path,omitempty"`
}
GitHubPRSummary is the MCP representation of one open pull request.
type ListApprovalRulesResult ¶ added in v1.41.0
type ListApprovalRulesResult struct {
MCPResult
Rules []ApprovalRuleResult `json:"rules"`
}
type ListBacklogItemsResult ¶ added in v1.44.0
type ListBacklogItemsResult struct {
MCPResult
Items []BacklogItemSummaryResult `json:"items"`
TotalCount int `json:"total_count"`
HasMore bool `json:"has_more"`
}
ListBacklogItemsResult is returned by list_backlog_items.
type ListGitHubPRsResult ¶ added in v1.35.0
type ListGitHubPRsResult struct {
MCPResult
PRs []GitHubPRSummary `json:"prs"`
TotalCount int `json:"total_count"`
Accounts []string `json:"accounts"`
}
ListGitHubPRsResult is returned by list_github_prs.
type ListSessionBranchesResult ¶
type ListSessionBranchesResult struct {
MCPResult
Branches []BranchInfo `json:"branches"`
CurrentBranch string `json:"current_branch"`
}
ListSessionBranchesResult is the response for list_session_branches.
type ListSessionsResult ¶
type ListSessionsResult struct {
MCPResult
Sessions []SessionSummary `json:"sessions"`
TotalCount int `json:"total_count"`
NextCursor *string `json:"next_cursor"`
}
ListSessionsResult is returned by list_sessions.
type ListWorkflowsResult ¶ added in v1.41.0
type ListWorkflowsResult struct {
MCPResult
Workflows []WorkflowResult `json:"workflows"`
}
type ListWorkspacePeersResult ¶ added in v1.41.0
type ListWorkspacePeersResult struct {
MCPResult
WorkspaceKey string `json:"workspace_key"`
Peers []WorkspacePeerResult `json:"peers"`
}
type MCPError ¶
type MCPError struct {
Code string `json:"code"`
Message string `json:"message"`
Remediation string `json:"remediation,omitempty"`
}
MCPError is the structured error returned in every tool result on failure.
type MCPResult ¶
MCPResult is the top-level wrapper for all tool responses. On success, Success=true and Error is nil. On failure, Success=false and Error is set.
type NotificationRecordResult ¶ added in v1.44.0
type NotificationRecordResult struct {
ID string `json:"id"`
SessionID string `json:"session_id"`
Type string `json:"type"`
Priority string `json:"priority"`
Title string `json:"title"`
Message string `json:"message"`
CreatedAt time.Time `json:"created_at"`
IsRead bool `json:"is_read"`
}
NotificationRecordResult is a single notification record returned by get_notification_history.
type PRVerification ¶ added in v1.41.0
type PRVerification struct {
Exists bool
Matched bool
ActualHeadBranch string
State string
Author string
}
PRVerification is the result of cross-checking a self-reported PR number against GitHub. It replaces a bare (bool, error) return so callers can see *why* a mismatch occurred (a different head branch vs. no PR at all) and make a policy decision — e.g. reportPRCreated's override path — instead of VerifyPRMatchesBranch having to bake that policy in itself.
The implicit invariant Matched ⇒ Exists is enforced at construction by NewPRVerification — every PRVerification value, in production and in tests, must be built through NewPRVerification, never a bare struct literal, or the invariant has no enforcement point.
func NewPRVerification ¶ added in v1.41.0
func NewPRVerification(exists, matched bool, actualHeadBranch, state, author string) PRVerification
NewPRVerification is the sole constructor for PRVerification. It enforces Matched ⇒ Exists: a caller passing matched=true with exists=false has produced an illegal state (a PR can't match a branch if it doesn't exist). Rather than panic — which would take down the whole handler for what's almost certainly a code-level logic bug in this package rather than bad external input — the violation is forced to matched=false and logged loudly via log.ErrorLog.Printf so it's impossible to miss in logs/tests, while production keeps running.
Author is not part of this invariant and is carried through unvalidated; it is consumed only by reportPRCreated's override-path author-match gate (tools_backlog.go's decideOverridePolicy) — this constructor makes no policy decision based on it.
func VerifyPRMatchesBranch ¶ added in v1.41.0
func VerifyPRMatchesBranch(ctx context.Context, owner, repo string, prNumber int, expectedBranch string) (PRVerification, error)
VerifyPRMatchesBranch confirms a PR number self-reported to report_pr_created (tools_backlog.go, Epic 3.1 of "PR Metadata Capture Fix" — project_plans/backlog-agent-communication) genuinely exists on GitHub, before that self-report is trusted and persisted. A hallucinated, stale, or mistyped PR reference would otherwise silently poison the item record — a class of bad data the mechanical pushAndCreatePR path (session/backlog_lifecycle.go) never has to guard against, since it only ever writes PR data it itself just created.
Root-cause fix: this looks the PR up by its immutable number (githubpkg.GetPRByNumber) rather than by branch name (githubpkg.GetPRForBranch, the prior implementation). A branch-keyed lookup silently matches the wrong PR whenever the branch was reused, renamed, or (the confirmed real-world case) polluted by another session sharing the same worktree, so the caller opened the PR from a different, clean branch — the branch name the item is tracked under and the PR's actual head branch legitimately diverge, and a branch-keyed lookup cannot tell that apart from an unrelated PR.
Because the lookup is now number-keyed, Matched == false with Exists == true is a distinct, *possible-to-accept* outcome — it's a real, existing PR for this repo whose head branch just doesn't match the item's tracked branch, rather than a fabricated PR number. Whether to accept that fallback case is a policy decision made by the caller (reportPRCreated's decideOverridePolicy, tools_backlog.go), never by this function — it stays a pure fact-reporter about what GitHub actually says.
Returns:
- (NewPRVerification(false, false, "", "", ""), nil): no PR exists for prNumber in owner/repo at all (githubpkg.ErrNoPR). Callers must NOT persist on this result, with or without an override — re-asking GitHub the same question will not change the answer.
- (NewPRVerification(true, ..., info.HeadRef, info.State, info.Author), nil): the PR exists; Matched reflects whether info.HeadRef == expectedBranch.
- (PRVerification{}, err): the lookup itself failed (rate limit, network, auth) — transient. Callers should surface a retryable error rather than treating this as a confirmed mismatch or a confirmed non-existence.
type ReadSessionOutputResult ¶
type ReadSessionOutputResult struct {
MCPResult
Output string `json:"output,omitempty"`
TotalLines int `json:"total_lines"`
Truncated bool `json:"truncated"`
}
ReadSessionOutputResult is the response type for read_session_output.
type ReviewCompletionSignaler ¶ added in v1.35.0
type ReviewCompletionSignaler interface {
StopDriverForSession(sessionTitle string)
}
ReviewCompletionSignaler allows the MCP handler to stop an AutonomousDriver after submit_review_verdict completes. The stop call is belt-and-suspenders; the LLM orchestrator will also detect completion from the terminal tail. Note: Stop() fires fireCompletion(Stuck=true), but the role-aware callback skips all status transitions for SessionRoleReview, so this is safe.
type ReviewTrigger ¶ added in v1.37.0
type ReviewTrigger interface {
TriggerReviewForSession(sessionUUID string)
}
ReviewTrigger allows the MCP handler to spawn a review gate immediately when request_review is called, instead of waiting for the next ReconcileStuck tick (up to 60s later). Implemented by SessionService, which delegates to the BacklogLifecycleListener wired via SetReviewGateTrigger.
type RunCommandResult ¶
type RunCommandResult struct {
MCPResult
Output string `json:"output"`
Truncated bool `json:"truncated"`
TimedOut bool `json:"timed_out"`
LastSequence uint64 `json:"last_sequence"`
}
RunCommandResult is the response for run_command.
type RunWorkflowResult ¶ added in v1.41.0
type SearchClaudeHistoryResult ¶ added in v1.44.0
type SearchClaudeHistoryResult struct {
MCPResult
Results []SearchResultSummary `json:"results"`
TotalCount int `json:"total_count"`
HasMore bool `json:"has_more"`
QueryTimeMs int64 `json:"query_time_ms"`
}
SearchClaudeHistoryResult is returned by search_claude_history.
type SearchResultSummary ¶ added in v1.44.0
type SearchResultSummary struct {
SessionID string `json:"session_id"`
SessionName string `json:"session_name"`
Project string `json:"project"`
Score float32 `json:"score"`
Snippets []SnippetResult `json:"snippets"`
}
SearchResultSummary is a single matching conversation returned by search_claude_history.
type SearchSessionsResult ¶
type SearchSessionsResult struct {
MCPResult
Sessions []SessionSummary `json:"sessions"`
TotalCount int `json:"total_count"`
}
SearchSessionsResult is returned by search_sessions.
type SendControlResult ¶
SendControlResult is the response for send_control.
type SessionDetail ¶
type SessionDetail struct {
SessionSummary
Program string `json:"program"`
SessionType string `json:"session_type"`
WorkingDir string `json:"working_dir,omitempty"`
}
SessionDetail extends SessionSummary with additional fields returned by get_session.
type SessionSummary ¶
type SessionSummary struct {
ID string `json:"id"`
Title string `json:"title"`
Status string `json:"status"`
Tags []string `json:"tags"`
Branch string `json:"branch,omitempty"`
Path string `json:"path"`
CreatedAt time.Time `json:"created_at"`
LastActivityAt time.Time `json:"last_activity_at"`
}
SessionSummary is returned by list_sessions and search_sessions.
type SetSessionGoalResult ¶ added in v1.35.0
type SnippetResult ¶ added in v1.44.0
SnippetResult is a single context snippet within a SearchResultSummary.
type SteerSessionResult ¶ added in v1.35.0
type SteerSessionResult struct {
MCPResult
SessionID string `json:"session_id"`
CharsSent int `json:"chars_sent"`
Result string `json:"result,omitempty"` // set when using --resume subprocess
Method string `json:"method"` // "send_keys" or "resume_subprocess"
}
SteerSessionResult is the response for steer_session.
type UpdateSessionTaskResult ¶ added in v1.35.0
type UpdateWorkflowResult ¶ added in v1.41.0
type UpdateWorkflowResult struct {
MCPResult
Workflow WorkflowResult `json:"workflow"`
}
type UpsertApprovalRuleResult ¶ added in v1.41.0
type UpsertApprovalRuleResult struct {
MCPResult
Rule ApprovalRuleResult `json:"rule"`
Created bool `json:"created"`
}
type WaitForBacklogEventResult ¶ added in v1.42.0
type WaitForBacklogEventResult struct {
MCPResult
EventReceived bool `json:"event_received"`
FromCurrentState bool `json:"from_current_state,omitempty"`
EventKind string `json:"event_kind,omitempty"`
ItemID string `json:"item_id"`
Status string `json:"status,omitempty"`
OldStatus string `json:"old_status,omitempty"`
NewStatus string `json:"new_status,omitempty"`
VerdictOutcome string `json:"verdict_outcome,omitempty"`
VerdictSummary string `json:"verdict_summary,omitempty"`
UpdatedFields []string `json:"updated_fields,omitempty"`
RemovedReason string `json:"removed_reason,omitempty"`
IsTerminal bool `json:"is_terminal,omitempty"`
}
WaitForBacklogEventResult is the response for wait_for_backlog_event.
type WaitForOutputResult ¶
type WaitForOutputResult struct {
MCPResult
Matched bool `json:"matched"`
MatchedLine string `json:"matched_line,omitempty"`
Output string `json:"output"`
Truncated bool `json:"truncated"`
}
WaitForOutputResult is the response for wait_for_output.
type WorkflowResult ¶ added in v1.41.0
type WorkflowResult struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Command string `json:"command"`
TargetDirectory string `json:"target_directory,omitempty"`
InputTemplate string `json:"input_template,omitempty"`
SessionType string `json:"session_type"`
Model string `json:"model,omitempty"`
AgentType string `json:"agent_type,omitempty"`
CronExpression string `json:"cron_expression,omitempty"`
CronEnabled bool `json:"cron_enabled"`
Enabled bool `json:"enabled"`
KeepSessions *int32 `json:"keep_sessions,omitempty"`
ArchiveAfterHours *int32 `json:"archive_after_hours,omitempty"`
}
WorkflowResult is the wire representation of a workflow returned by MCP tools.
type WorkspacePeerResult ¶ added in v1.41.0
type WorkspacePeerResult struct {
SessionUUID string `json:"session_uuid"`
Title string `json:"title"`
Branch string `json:"branch"`
Path string `json:"path"`
Status string `json:"status"`
Lifecycle string `json:"lifecycle"` // active | stuck | gone
InstanceLive bool `json:"instance_live"`
GoalText string `json:"goal_text,omitempty"`
GoalStatus string `json:"goal_status,omitempty"`
GoalUpdatedAt string `json:"goal_updated_at,omitempty"`
}
WorkspacePeerResult is the wire representation of a session.WorkspacePeer for MCP callers.
type WriteSessionResult ¶
WriteSessionResult is the response for write_to_session.