Documentation
¶
Index ¶
- Constants
- func ActiveWorkspaceIDFromContext(ctx context.Context) string
- func ErrorMiddleware() gin.HandlerFunc
- func EventAfterCursor(event events.Event, cursor StreamCursor) bool
- func FormatCursor(timestamp time.Time, sequence uint64) string
- func RegisterRoutes(router gin.IRouter, handlers *Handlers)
- func RequestIDFromContext(ctx context.Context) string
- func RequestIDMiddleware() gin.HandlerFunc
- func RespondError(c *gin.Context, err error)
- func WithActiveWorkspaceID(ctx context.Context, workspaceID string) context.Context
- func WithRequestID(ctx context.Context, requestID string) context.Context
- func WorkspacePathMissingProblem(workspaceID string, rootDir string, err error) error
- func WriteSSE(writer FlushWriter, msg SSEMessage) error
- func WriteWorkspaceSocketMessage(ctx context.Context, conn *websocket.Conn, message WorkspaceSocketMessage) error
- type ArchiveRequest
- type ArchiveResult
- type ContentBlock
- type ContentBlockType
- type DaemonDatabaseDiagnostics
- type DaemonHealth
- type DaemonModeCount
- type DaemonReconcileDiagnostics
- type DaemonService
- type DaemonStatus
- type ExecRequest
- type ExecService
- type FlushWriter
- type HandlerConfig
- type Handlers
- func (h *Handlers) ArchiveTaskWorkflow(c *gin.Context)
- func (h *Handlers) CancelRun(c *gin.Context)
- func (h *Handlers) Clone() *Handlers
- func (h *Handlers) DaemonHealth(c *gin.Context)
- func (h *Handlers) DaemonMetrics(c *gin.Context)
- func (h *Handlers) DaemonStatus(c *gin.Context)
- func (h *Handlers) DeleteWorkspace(c *gin.Context)
- func (h *Handlers) FetchReview(c *gin.Context)
- func (h *Handlers) GetLatestReview(c *gin.Context)
- func (h *Handlers) GetReviewIssue(c *gin.Context)
- func (h *Handlers) GetReviewRound(c *gin.Context)
- func (h *Handlers) GetRun(c *gin.Context)
- func (h *Handlers) GetRunSnapshot(c *gin.Context)
- func (h *Handlers) GetRunTranscript(c *gin.Context)
- func (h *Handlers) GetTaskBoard(c *gin.Context)
- func (h *Handlers) GetTaskItemDetail(c *gin.Context)
- func (h *Handlers) GetTaskWorkflow(c *gin.Context)
- func (h *Handlers) GetWorkflowMemory(c *gin.Context)
- func (h *Handlers) GetWorkflowMemoryFile(c *gin.Context)
- func (h *Handlers) GetWorkflowSpec(c *gin.Context)
- func (h *Handlers) GetWorkspace(c *gin.Context)
- func (h *Handlers) ListReviewIssues(c *gin.Context)
- func (h *Handlers) ListRunEvents(c *gin.Context)
- func (h *Handlers) ListRuns(c *gin.Context)
- func (h *Handlers) ListTaskItems(c *gin.Context)
- func (h *Handlers) ListTaskWorkflows(c *gin.Context)
- func (h *Handlers) ListWorkspaces(c *gin.Context)
- func (h *Handlers) RegisterWorkspace(c *gin.Context)
- func (h *Handlers) ResolveWorkspace(c *gin.Context)
- func (h *Handlers) SetStreamDone(done <-chan struct{})
- func (h *Handlers) StartExecRun(c *gin.Context)
- func (h *Handlers) StartReviewRun(c *gin.Context)
- func (h *Handlers) StartReviewWatch(c *gin.Context)
- func (h *Handlers) StartTaskRun(c *gin.Context)
- func (h *Handlers) StopDaemon(c *gin.Context)
- func (h *Handlers) StreamRun(c *gin.Context)
- func (h *Handlers) StreamWorkspaceSocket(c *gin.Context)
- func (h *Handlers) SyncWorkflow(c *gin.Context)
- func (h *Handlers) SyncWorkspaces(c *gin.Context)
- func (h *Handlers) UpdateWorkspace(c *gin.Context)
- func (h *Handlers) ValidateTaskWorkflow(c *gin.Context)
- type HealthDetail
- type HeartbeatPayload
- type MarkdownDocument
- type MetricsPayload
- type OverflowPayload
- type Problem
- type ReviewDetailPayload
- type ReviewFetchRequest
- type ReviewFetchResult
- type ReviewIssue
- type ReviewIssueDetail
- type ReviewRound
- type ReviewRunRequest
- type ReviewService
- type ReviewSummary
- type ReviewWatchRequest
- type ReviewWatchResponse
- type Run
- type RunArtifactSyncEntry
- type RunDetailPayload
- type RunEventPage
- type RunEventPageQuery
- type RunJobCounts
- type RunJobState
- type RunJobSummary
- type RunListQuery
- type RunRuntimeSummary
- type RunService
- type RunShutdownState
- type RunSnapshot
- type RunStream
- type RunStreamItem
- type RunStreamOverflow
- type RunTranscript
- type RunTranscriptMessage
- type RunUIMessage
- type RunUIMessagePart
- type SSEMessage
- type SessionAvailableCommand
- type SessionEntry
- type SessionEntryKind
- type SessionMetaState
- type SessionPlanEntry
- type SessionPlanState
- type SessionStatus
- type SessionViewSnapshot
- type StreamCursor
- type SyncRequest
- type SyncResult
- type SyncService
- type TaskBoardPayload
- type TaskCard
- type TaskDetailPayload
- type TaskItem
- type TaskLane
- type TaskRunRequest
- type TaskService
- type ToolCallState
- type TransportError
- type ValidationSuccess
- type WorkflowMemoryEntry
- type WorkflowMemoryIndex
- type WorkflowOverviewPayload
- type WorkflowSpecDocument
- type WorkflowSummary
- type WorkflowTaskCounts
- type Workspace
- type WorkspaceEvent
- type WorkspaceEventKind
- type WorkspaceEventService
- type WorkspaceEventStream
- type WorkspaceRegisterResult
- type WorkspaceService
- type WorkspaceSocketHeartbeatPayload
- type WorkspaceSocketMessage
- func WorkspaceErrorSocketMessage(payload TransportError) (WorkspaceSocketMessage, error)
- func WorkspaceEventSocketMessage(event WorkspaceEvent) (WorkspaceSocketMessage, error)
- func WorkspaceHeartbeatSocketMessage(workspaceID string, now time.Time) (WorkspaceSocketMessage, error)
- func WorkspaceOverflowSocketMessage(workspaceID string, now time.Time, reason string) (WorkspaceSocketMessage, error)
- type WorkspaceSocketOverflowPayload
- type WorkspaceStreamItem
- type WorkspaceStreamOverflow
- type WorkspaceSyncResult
- type WorkspaceUpdateInput
Constants ¶
const ( // RunSnapshotSSEEvent is the canonical snapshot event name for daemon run streams. RunSnapshotSSEEvent = "run.snapshot" // RunEventSSEEvent is the canonical live event name for daemon run streams. RunEventSSEEvent = "run.event" // RunHeartbeatSSEEvent is the canonical heartbeat event name for daemon run streams. RunHeartbeatSSEEvent = "run.heartbeat" // RunOverflowSSEEvent is the canonical overflow event name for daemon run streams. RunOverflowSSEEvent = "run.overflow" )
const ( // WorkspaceEventSocketType is the live event message type for daemon workspace sockets. WorkspaceEventSocketType = "workspace.event" // WorkspaceHeartbeatSocketType is the heartbeat message type for daemon workspace sockets. WorkspaceHeartbeatSocketType = "workspace.heartbeat" // WorkspaceOverflowSocketType is the overflow message type for daemon workspace sockets. WorkspaceOverflowSocketType = "workspace.overflow" // WorkspaceErrorSocketType is the error message type for daemon workspace sockets. WorkspaceErrorSocketType = "error" )
const CookieCSRF = "productize" + "_csrf"
CookieCSRF carries the browser mutation CSRF cookie name.
const HeaderActiveWorkspaceID = "X-Productize-Workspace-ID"
HeaderActiveWorkspaceID carries the browser-selected active workspace ID.
const HeaderCSRF = "X-Productize-CSRF-" + "Token"
HeaderCSRF carries the double-submit CSRF header name for browser mutations.
const HeaderRequestID = "X-Request-Id"
HeaderRequestID is the canonical request ID response header.
Variables ¶
This section is empty.
Functions ¶
func ActiveWorkspaceIDFromContext ¶
ActiveWorkspaceIDFromContext returns the resolved active workspace ID when available.
func ErrorMiddleware ¶
func ErrorMiddleware() gin.HandlerFunc
ErrorMiddleware converts unhandled Gin errors into the transport error envelope.
func EventAfterCursor ¶
func EventAfterCursor(event events.Event, cursor StreamCursor) bool
EventAfterCursor reports whether an event should be emitted after the given cursor.
func FormatCursor ¶
FormatCursor renders the canonical cursor form.
func RegisterRoutes ¶
RegisterRoutes registers the shared daemon API routes on the supplied router.
func RequestIDFromContext ¶
RequestIDFromContext returns the propagated request ID when available.
func RequestIDMiddleware ¶
func RequestIDMiddleware() gin.HandlerFunc
RequestIDMiddleware ensures every request carries a transport request ID.
func RespondError ¶
RespondError writes a transport error response for one request.
func WithActiveWorkspaceID ¶
WithActiveWorkspaceID returns a child context carrying the resolved active workspace ID.
func WithRequestID ¶
WithRequestID returns a child context carrying the transport request ID.
func WriteSSE ¶
func WriteSSE(writer FlushWriter, msg SSEMessage) error
WriteSSE writes one SSE message with JSON-encoded data.
Types ¶
type ArchiveRequest ¶
type ArchiveRequest = contract.WorkflowArchiveRequest
type ArchiveResult ¶
type ArchiveResult = contract.ArchiveResult
type ContentBlock ¶
type ContentBlock = contract.ContentBlock
type ContentBlockType ¶
type ContentBlockType = contract.ContentBlockType
type DaemonDatabaseDiagnostics ¶
type DaemonDatabaseDiagnostics = contract.DaemonDatabaseDiagnostics
type DaemonHealth ¶
type DaemonHealth = contract.DaemonHealth
type DaemonModeCount ¶
type DaemonModeCount = contract.DaemonModeCount
type DaemonReconcileDiagnostics ¶
type DaemonReconcileDiagnostics = contract.DaemonReconcileDiagnostics
type DaemonService ¶
type DaemonService interface {
Status(context.Context) (DaemonStatus, error)
Health(context.Context) (DaemonHealth, error)
Metrics(context.Context) (MetricsPayload, error)
Stop(context.Context, bool) error
}
DaemonService exposes daemon-wide status, health, metrics, and shutdown control.
type DaemonStatus ¶
type DaemonStatus = contract.DaemonStatus
type ExecRequest ¶
type ExecRequest = contract.ExecRequest
type ExecService ¶
type ExecService interface {
Start(context.Context, ExecRequest) (Run, error)
}
ExecService exposes ad-hoc daemon-backed exec starts.
type FlushWriter ¶
FlushWriter is the subset of the response writer needed for streaming.
func PrepareSSE ¶
func PrepareSSE(c *gin.Context) (FlushWriter, error)
PrepareSSE configures one Gin response for server-sent events.
type HandlerConfig ¶
type HandlerConfig struct {
TransportName string
Logger *slog.Logger
Now func() time.Time
HeartbeatInterval time.Duration
StreamDone <-chan struct{}
WorkspaceSocketOriginPatterns []string
Daemon DaemonService
Workspaces WorkspaceService
WorkspaceEvents WorkspaceEventService
Tasks TaskService
Reviews ReviewService
Runs RunService
Sync SyncService
Exec ExecService
}
HandlerConfig wires the shared daemon transport handlers.
type Handlers ¶
type Handlers struct {
TransportName string
Logger *slog.Logger
Now func() time.Time
HeartbeatInterval time.Duration
Daemon DaemonService
Workspaces WorkspaceService
WorkspaceEvents WorkspaceEventService
Tasks TaskService
Reviews ReviewService
Runs RunService
Sync SyncService
Exec ExecService
// contains filtered or unexported fields
}
Handlers contains the shared daemon API handler logic used by both transports.
func NewHandlers ¶
func NewHandlers(cfg *HandlerConfig) *Handlers
NewHandlers builds the shared handler set with transport-specific defaults applied.
func (*Handlers) ArchiveTaskWorkflow ¶
ArchiveTaskWorkflow archives a completed workflow.
func (*Handlers) Clone ¶
Clone copies the handler set so each transport can own its runtime state independently.
func (*Handlers) DaemonHealth ¶
DaemonHealth returns daemon readiness and degraded-state details.
func (*Handlers) DaemonMetrics ¶
DaemonMetrics returns the daemon metrics in Prometheus text format.
func (*Handlers) DaemonStatus ¶
DaemonStatus returns the primary daemon status view.
func (*Handlers) DeleteWorkspace ¶
DeleteWorkspace unregisters one workspace.
func (*Handlers) FetchReview ¶
FetchReview imports provider feedback into a review round.
func (*Handlers) GetLatestReview ¶
GetLatestReview returns the latest review summary for one workflow.
func (*Handlers) GetReviewIssue ¶
GetReviewIssue returns the richer review issue detail payload.
func (*Handlers) GetReviewRound ¶
GetReviewRound returns one review round summary.
func (*Handlers) GetRunSnapshot ¶
GetRunSnapshot returns the attach snapshot for one run.
func (*Handlers) GetRunTranscript ¶
GetRunTranscript returns the canonical structured transcript for one run.
func (*Handlers) GetTaskBoard ¶
GetTaskBoard returns the workflow task-board read model.
func (*Handlers) GetTaskItemDetail ¶
GetTaskItemDetail returns the richer workflow task detail payload.
func (*Handlers) GetTaskWorkflow ¶
GetTaskWorkflow returns the richer workflow overview payload.
func (*Handlers) GetWorkflowMemory ¶
GetWorkflowMemory returns the memory index for one workflow.
func (*Handlers) GetWorkflowMemoryFile ¶
GetWorkflowMemoryFile returns one workflow memory document by opaque daemon-issued ID.
func (*Handlers) GetWorkflowSpec ¶
GetWorkflowSpec returns the workflow PRD, TechSpec, and ADR documents.
func (*Handlers) GetWorkspace ¶
GetWorkspace returns one workspace by ID or normalized path key.
func (*Handlers) ListReviewIssues ¶
ListReviewIssues returns one review round issue list.
func (*Handlers) ListRunEvents ¶
ListRunEvents pages through persisted run events.
func (*Handlers) ListTaskItems ¶
ListTaskItems lists parsed task items for one workflow.
func (*Handlers) ListTaskWorkflows ¶
ListTaskWorkflows lists task workflows for one workspace.
func (*Handlers) ListWorkspaces ¶
ListWorkspaces lists registered workspaces.
func (*Handlers) RegisterWorkspace ¶
RegisterWorkspace registers a workspace explicitly.
func (*Handlers) ResolveWorkspace ¶
ResolveWorkspace resolves or lazily registers a workspace path.
func (*Handlers) SetStreamDone ¶
func (h *Handlers) SetStreamDone(done <-chan struct{})
SetStreamDone updates the transport shutdown bridge used by streaming handlers.
func (*Handlers) StartExecRun ¶
StartExecRun starts one ad-hoc daemon-backed exec run.
func (*Handlers) StartReviewRun ¶
StartReviewRun starts one review-fix run.
func (*Handlers) StartReviewWatch ¶
StartReviewWatch starts one daemon-owned review-watch parent run.
func (*Handlers) StartTaskRun ¶
StartTaskRun starts one task workflow run.
func (*Handlers) StopDaemon ¶
StopDaemon requests a graceful daemon shutdown.
func (*Handlers) StreamRun ¶
StreamRun streams live run events with cursor resume, heartbeat, and overflow semantics.
func (*Handlers) StreamWorkspaceSocket ¶
StreamWorkspaceSocket streams workspace-scoped invalidation messages for the browser UI.
func (*Handlers) SyncWorkflow ¶
SyncWorkflow runs explicit daemon reconciliation for a workspace or workflow.
func (*Handlers) SyncWorkspaces ¶
SyncWorkspaces refreshes registered workspace filesystem state and artifact mirrors.
func (*Handlers) UpdateWorkspace ¶
UpdateWorkspace updates mutable workspace metadata.
func (*Handlers) ValidateTaskWorkflow ¶
ValidateTaskWorkflow validates task files for one workflow.
type HealthDetail ¶
type HealthDetail = contract.HealthDetail
type HeartbeatPayload ¶
type HeartbeatPayload = contract.HeartbeatPayload
type MarkdownDocument ¶
type MarkdownDocument struct {
ID string `json:"id"`
Kind string `json:"kind"`
Title string `json:"title"`
UpdatedAt time.Time `json:"updated_at"`
Markdown string `json:"markdown"`
Metadata json.RawMessage `json:"metadata,omitempty"`
}
MarkdownDocument is the normalized daemon-served markdown payload.
type MetricsPayload ¶
MetricsPayload carries pre-rendered metrics text.
type OverflowPayload ¶
type OverflowPayload = contract.OverflowPayload
type ReviewDetailPayload ¶
type ReviewDetailPayload struct {
Workspace Workspace `json:"workspace"`
Workflow WorkflowSummary `json:"workflow"`
Round ReviewRound `json:"round"`
Issue ReviewIssueDetail `json:"issue"`
Document MarkdownDocument `json:"document"`
RelatedRuns []Run `json:"related_runs,omitempty"`
}
ReviewDetailPayload captures the richer review issue detail read model.
type ReviewFetchRequest ¶
type ReviewFetchRequest = contract.ReviewFetchRequest
type ReviewFetchResult ¶
type ReviewFetchResult = contract.ReviewFetchResult
type ReviewIssue ¶
type ReviewIssue = contract.ReviewIssue
type ReviewIssueDetail ¶
type ReviewIssueDetail struct {
ID string `json:"id"`
IssueNumber int `json:"issue_number"`
Severity string `json:"severity"`
Status string `json:"status"`
UpdatedAt time.Time `json:"updated_at"`
}
ReviewIssueDetail captures the detail metadata for one review issue.
type ReviewRound ¶
type ReviewRound = contract.ReviewRound
type ReviewRunRequest ¶
type ReviewRunRequest = contract.ReviewRunRequest
type ReviewService ¶
type ReviewService interface {
Fetch(context.Context, string, string, ReviewFetchRequest) (ReviewFetchResult, error)
GetLatest(context.Context, string, string) (ReviewSummary, error)
GetRound(context.Context, string, string, int) (ReviewRound, error)
ListIssues(context.Context, string, string, int) ([]ReviewIssue, error)
ReviewDetail(context.Context, string, string, int, string) (ReviewDetailPayload, error)
StartRun(context.Context, string, string, int, ReviewRunRequest) (Run, error)
StartWatch(context.Context, string, string, ReviewWatchRequest) (Run, error)
}
ReviewService exposes review round state, review detail reads, and review-fix run starts.
type ReviewSummary ¶
type ReviewSummary = contract.ReviewSummary
type ReviewWatchRequest ¶
type ReviewWatchRequest = contract.ReviewWatchRequest
type ReviewWatchResponse ¶
type ReviewWatchResponse = contract.RunResponse
type RunArtifactSyncEntry ¶
type RunArtifactSyncEntry struct {
Sequence uint64 `json:"sequence"`
RelativePath string `json:"relative_path"`
ChangeKind string `json:"change_kind"`
Checksum string `json:"checksum,omitempty"`
SyncedAt time.Time `json:"synced_at"`
}
RunArtifactSyncEntry is one artifact sync history row from the run database.
type RunDetailPayload ¶
type RunDetailPayload struct {
Run Run `json:"run"`
Snapshot RunSnapshot `json:"snapshot"`
JobCounts RunJobCounts `json:"job_counts"`
Runtime RunRuntimeSummary `json:"runtime"`
Timeline []events.Event `json:"timeline,omitempty"`
ArtifactSync []RunArtifactSyncEntry `json:"artifact_sync,omitempty"`
}
RunDetailPayload captures the richer run detail read model exposed to the browser.
type RunEventPage ¶
type RunEventPage = contract.RunEventPage
type RunEventPageQuery ¶
type RunEventPageQuery = contract.RunEventPageQuery
type RunJobCounts ¶
type RunJobCounts struct {
Queued int `json:"queued"`
Running int `json:"running"`
Retrying int `json:"retrying"`
Completed int `json:"completed"`
Failed int `json:"failed"`
Canceled int `json:"canceled"`
}
RunJobCounts summarizes run jobs by status.
type RunJobState ¶
type RunJobState = contract.RunJobState
type RunJobSummary ¶
type RunJobSummary = contract.RunJobSummary
type RunListQuery ¶
type RunListQuery = contract.RunListQuery
type RunRuntimeSummary ¶
type RunRuntimeSummary struct {
IDEs []string `json:"ides,omitempty"`
Models []string `json:"models,omitempty"`
ReasoningEfforts []string `json:"reasoning_efforts,omitempty"`
AccessModes []string `json:"access_modes,omitempty"`
PresentationModes []string `json:"presentation_modes,omitempty"`
}
RunRuntimeSummary captures the distinct runtime settings observed in one run snapshot.
type RunService ¶
type RunService interface {
List(context.Context, RunListQuery) ([]Run, error)
Get(context.Context, string) (Run, error)
Snapshot(context.Context, string) (RunSnapshot, error)
Transcript(context.Context, string) (RunTranscript, error)
RunDetail(context.Context, string) (RunDetailPayload, error)
Events(context.Context, string, RunEventPageQuery) (RunEventPage, error)
OpenStream(context.Context, string, StreamCursor) (RunStream, error)
Cancel(context.Context, string) error
}
RunService exposes run snapshots, rich run detail, pagination, streaming, and cancellation.
type RunShutdownState ¶
type RunShutdownState = contract.RunShutdownState
type RunSnapshot ¶
type RunSnapshot = contract.RunSnapshot
type RunStream ¶
type RunStream interface {
Events() <-chan RunStreamItem
Errors() <-chan error
Close() error
}
RunStream is the live run event subscription surfaced to the transport layer.
type RunStreamItem ¶
type RunStreamItem struct {
Event *events.Event
Overflow *RunStreamOverflow
}
RunStreamItem carries one live stream delivery or an overflow notice.
type RunStreamOverflow ¶
type RunStreamOverflow struct {
Reason string
}
RunStreamOverflow notifies the transport that the client must reconnect from the last cursor.
type RunTranscript ¶
type RunTranscript = contract.RunTranscript
type RunTranscriptMessage ¶
type RunTranscriptMessage = contract.RunTranscriptMessage
type RunUIMessage ¶
type RunUIMessage = contract.RunUIMessage
type RunUIMessagePart ¶
type RunUIMessagePart = contract.RunUIMessagePart
type SSEMessage ¶
type SSEMessage = contract.SSEMessage
func EventMessage ¶
func EventMessage(event events.Event) SSEMessage
EventMessage builds the canonical live-event SSE frame.
func HeartbeatMessage ¶
func HeartbeatMessage(runID string, cursor StreamCursor, now time.Time) SSEMessage
HeartbeatMessage builds the canonical heartbeat SSE event.
func OverflowMessage ¶
func OverflowMessage(runID string, cursor StreamCursor, now time.Time, reason string) SSEMessage
OverflowMessage builds the canonical overflow SSE event.
type SessionAvailableCommand ¶
type SessionAvailableCommand = contract.SessionAvailableCommand
type SessionEntry ¶
type SessionEntry = contract.SessionEntry
type SessionEntryKind ¶
type SessionEntryKind = contract.SessionEntryKind
type SessionMetaState ¶
type SessionMetaState = contract.SessionMetaState
type SessionPlanEntry ¶
type SessionPlanEntry = contract.SessionPlanEntry
type SessionPlanState ¶
type SessionPlanState = contract.SessionPlanState
type SessionStatus ¶
type SessionStatus = contract.SessionStatus
type SessionViewSnapshot ¶
type SessionViewSnapshot = contract.SessionViewSnapshot
type StreamCursor ¶
type StreamCursor = contract.StreamCursor
func CursorFromEvent ¶
func CursorFromEvent(event events.Event) StreamCursor
CursorFromEvent builds the canonical cursor for one persisted event.
func ParseCursor ¶
func ParseCursor(raw string) (StreamCursor, error)
ParseCursor parses a Last-Event-ID or pagination cursor.
type SyncRequest ¶
type SyncRequest = contract.SyncRequest
type SyncResult ¶
type SyncResult = contract.SyncResult
type SyncService ¶
type SyncService interface {
Sync(context.Context, SyncRequest) (SyncResult, error)
}
SyncService exposes explicit workflow reconciliation.
type TaskBoardPayload ¶
type TaskBoardPayload struct {
Workspace Workspace `json:"workspace"`
Workflow WorkflowSummary `json:"workflow"`
TaskCounts WorkflowTaskCounts `json:"task_counts"`
Lanes []TaskLane `json:"lanes,omitempty"`
}
TaskBoardPayload captures the workflow task-board read model.
type TaskCard ¶
type TaskCard struct {
TaskNumber int `json:"task_number"`
TaskID string `json:"task_id"`
Title string `json:"title"`
Status string `json:"status"`
Type string `json:"type"`
DependsOn []string `json:"depends_on,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
TaskCard is the compact task row used by board and detail reads.
type TaskDetailPayload ¶
type TaskDetailPayload struct {
Workspace Workspace `json:"workspace"`
Workflow WorkflowSummary `json:"workflow"`
Task TaskCard `json:"task"`
Document MarkdownDocument `json:"document"`
MemoryEntries []WorkflowMemoryEntry `json:"memory_entries,omitempty"`
RelatedRuns []Run `json:"related_runs,omitempty"`
LiveTailAvailable bool `json:"live_tail_available"`
}
TaskDetailPayload captures the richer workflow task detail read model.
type TaskLane ¶
type TaskLane struct {
Status string `json:"status"`
Title string `json:"title"`
Items []TaskCard `json:"items,omitempty"`
}
TaskLane groups task cards under one normalized status lane.
type TaskRunRequest ¶
type TaskRunRequest = contract.TaskRunRequest
type TaskService ¶
type TaskService interface {
ListWorkflows(context.Context, string) ([]WorkflowSummary, error)
GetWorkflow(context.Context, string, string) (WorkflowSummary, error)
WorkflowOverview(context.Context, string, string) (WorkflowOverviewPayload, error)
ListItems(context.Context, string, string) ([]TaskItem, error)
TaskBoard(context.Context, string, string) (TaskBoardPayload, error)
WorkflowSpec(context.Context, string, string) (WorkflowSpecDocument, error)
WorkflowMemoryIndex(context.Context, string, string) (WorkflowMemoryIndex, error)
WorkflowMemoryFile(context.Context, string, string, string) (MarkdownDocument, error)
TaskDetail(context.Context, string, string, string) (TaskDetailPayload, error)
Validate(context.Context, string, string) (ValidationSuccess, error)
StartRun(context.Context, string, string, TaskRunRequest) (Run, error)
Archive(context.Context, string, string, ArchiveRequest) (ArchiveResult, error)
}
TaskService exposes workflow summary, rich read-model, validation, and run-start surfaces.
type ToolCallState ¶
type ToolCallState = contract.ToolCallState
type TransportError ¶
type TransportError = contract.TransportError
type ValidationSuccess ¶
type ValidationSuccess = contract.ValidationSuccess
type WorkflowMemoryEntry ¶
type WorkflowMemoryEntry struct {
FileID string `json:"file_id"`
DisplayPath string `json:"display_path"`
Kind string `json:"kind"`
Title string `json:"title"`
SizeBytes int64 `json:"size_bytes"`
UpdatedAt time.Time `json:"updated_at"`
}
WorkflowMemoryEntry describes one memory file without exposing raw filesystem paths.
type WorkflowMemoryIndex ¶
type WorkflowMemoryIndex struct {
Workspace Workspace `json:"workspace"`
Workflow WorkflowSummary `json:"workflow"`
Entries []WorkflowMemoryEntry `json:"entries,omitempty"`
}
WorkflowMemoryIndex lists workflow memory files using opaque daemon-issued identifiers.
type WorkflowOverviewPayload ¶
type WorkflowOverviewPayload struct {
Workspace Workspace `json:"workspace"`
Workflow WorkflowSummary `json:"workflow"`
TaskCounts WorkflowTaskCounts `json:"task_counts"`
LatestReview *ReviewSummary `json:"latest_review,omitempty"`
RecentRuns []Run `json:"recent_runs,omitempty"`
ArchiveEligible bool `json:"archive_eligible"`
ArchiveReason string `json:"archive_reason,omitempty"`
}
WorkflowOverviewPayload is the richer workflow summary aggregate used by browser reads.
type WorkflowSpecDocument ¶
type WorkflowSpecDocument struct {
Workspace Workspace `json:"workspace"`
Workflow WorkflowSummary `json:"workflow"`
PRD *MarkdownDocument `json:"prd,omitempty"`
TechSpec *MarkdownDocument `json:"techspec,omitempty"`
ADRs []MarkdownDocument `json:"adrs,omitempty"`
}
WorkflowSpecDocument captures the canonical workflow spec artifacts.
type WorkflowSummary ¶
type WorkflowSummary = contract.WorkflowSummary
type WorkflowTaskCounts ¶
type WorkflowTaskCounts = contract.WorkflowTaskCounts
WorkflowTaskCounts summarizes task progress for one workflow.
type WorkspaceEvent ¶
type WorkspaceEvent struct {
Seq uint64 `json:"seq"`
TS time.Time `json:"ts"`
WorkspaceID string `json:"workspace_id"`
WorkflowID *string `json:"workflow_id,omitempty"`
WorkflowSlug string `json:"workflow_slug,omitempty"`
RunID string `json:"run_id,omitempty"`
Mode string `json:"mode,omitempty"`
Status string `json:"status,omitempty"`
Kind WorkspaceEventKind `json:"kind"`
Paths []string `json:"paths,omitempty"`
}
WorkspaceEvent is a lightweight daemon-owned invalidation event for one workspace.
type WorkspaceEventKind ¶
type WorkspaceEventKind string
const ( WorkspaceEventKindRunCreated WorkspaceEventKind = "run.created" WorkspaceEventKindRunStatusChanged WorkspaceEventKind = "run.status_changed" WorkspaceEventKindRunTerminal WorkspaceEventKind = "run.terminal" WorkspaceEventKindWorkflowSyncCompleted WorkspaceEventKind = "workflow.sync_completed" WorkspaceEventKindArtifactChanged WorkspaceEventKind = "artifact.changed" )
type WorkspaceEventService ¶
type WorkspaceEventService interface {
OpenWorkspaceStream(context.Context, string) (WorkspaceEventStream, error)
}
WorkspaceEventService exposes workspace-scoped browser event streams.
type WorkspaceEventStream ¶
type WorkspaceEventStream interface {
Events() <-chan WorkspaceStreamItem
Errors() <-chan error
Close() error
}
WorkspaceEventStream is the live workspace event subscription surfaced to the transport layer.
type WorkspaceRegisterResult ¶
type WorkspaceRegisterResult = contract.WorkspaceRegisterResult
type WorkspaceService ¶
type WorkspaceService interface {
Register(context.Context, string, string) (WorkspaceRegisterResult, error)
List(context.Context) ([]Workspace, error)
Get(context.Context, string) (Workspace, error)
Update(context.Context, string, WorkspaceUpdateInput) (Workspace, error)
Delete(context.Context, string) error
Resolve(context.Context, string) (Workspace, error)
Sync(context.Context) (WorkspaceSyncResult, error)
}
WorkspaceService exposes workspace registration and lookup.
type WorkspaceSocketHeartbeatPayload ¶
type WorkspaceSocketHeartbeatPayload struct {
WorkspaceID string `json:"workspace_id"`
TS time.Time `json:"ts"`
}
WorkspaceSocketHeartbeatPayload carries a workspace socket heartbeat.
type WorkspaceSocketMessage ¶
type WorkspaceSocketMessage struct {
Type string `json:"type"`
ID string `json:"id,omitempty"`
Payload json.RawMessage `json:"payload"`
}
WorkspaceSocketMessage is the JSON envelope sent over workspace WebSocket connections.
func WorkspaceErrorSocketMessage ¶
func WorkspaceErrorSocketMessage(payload TransportError) (WorkspaceSocketMessage, error)
func WorkspaceEventSocketMessage ¶
func WorkspaceEventSocketMessage(event WorkspaceEvent) (WorkspaceSocketMessage, error)
func WorkspaceHeartbeatSocketMessage ¶
func WorkspaceHeartbeatSocketMessage(workspaceID string, now time.Time) (WorkspaceSocketMessage, error)
type WorkspaceSocketOverflowPayload ¶
type WorkspaceSocketOverflowPayload struct {
WorkspaceID string `json:"workspace_id"`
Reason string `json:"reason"`
TS time.Time `json:"ts"`
}
WorkspaceSocketOverflowPayload notifies a browser that workspace events were dropped.
type WorkspaceStreamItem ¶
type WorkspaceStreamItem struct {
Event *WorkspaceEvent
Overflow *WorkspaceStreamOverflow
}
WorkspaceStreamItem carries one workspace event delivery or an overflow notice.
type WorkspaceStreamOverflow ¶
type WorkspaceStreamOverflow struct {
Reason string `json:"reason"`
}
WorkspaceStreamOverflow notifies the browser that workspace events were dropped.
type WorkspaceSyncResult ¶
type WorkspaceSyncResult = contract.WorkspaceSyncResult
type WorkspaceUpdateInput ¶
type WorkspaceUpdateInput = contract.WorkspaceUpdateInput