Documentation
¶
Index ¶
- Constants
- func CalculateCost(model string, input, output, cacheWrite, cacheRead int64) float64
- func FormatPlanAsMarkdown(plan *Plan) string
- func SavePlanToFile(plan *Plan, plansDir string) error
- func ValidateAttachment(att Attachment) error
- type AgentDoneMsg
- type Attachment
- type ClearMsg
- type ConfirmRequestMsg
- type DaemonDisconnectedMsg
- type DaemonEventMsg
- type DaemonStatusMsg
- type ErrorMsg
- type EventCompacted
- type EventConfirmRequest
- type EventError
- type EventInitState
- type EventJobDone
- type EventJobRun
- type EventPlanComplete
- type EventPlanProposed
- type EventPlanTaskDone
- type EventPlanTaskStart
- type EventQuestionOption
- type EventReplay
- type EventRetry
- type EventSessionStarted
- type EventSessionsChanged
- type EventSkillsAvailable
- type EventStreamChunk
- type EventStreamDone
- type EventThinkingChunk
- type EventThinkingStall
- type EventTitleUpdated
- type EventTodoListUpdated
- type EventToolCall
- type EventToolResult
- type EventUpdateAvailable
- type EventUserQuestion
- type EventWorkflowComplete
- type EventWorkflowStart
- type EventWorkflowStatus
- type EventWorkflowStepDone
- type EventWorkflowStepStart
- type EventWorkflowsAvailable
- type InitState
- type InitStateMsg
- type InstanceRegisterData
- type Plan
- type PlanAction
- type PlanActionType
- type PlanCompleteMsg
- type PlanProposedMsg
- type PlanTask
- type PlanTaskDoneMsg
- type PlanTaskStartMsg
- type QuestionDef
- type QuitMsg
- type ReplayBlock
- type ReplayMessage
- type SessionCommand
- type SessionConfirmData
- type SessionEvent
- type SessionInputData
- type SessionPlanActionData
- type SessionSetModelData
- type SessionStartData
- type SessionSummary
- type SessionTrimData
- type SessionUserAnswerData
- type SessionWorkflowData
- type SessionWorkflowMessageData
- type SkillInfo
- type StepCost
- type StreamChunkMsg
- type StreamDoneMsg
- type SubagentDoneMsg
- type SubagentStartMsg
- type TaskStatus
- type TodoItem
- type TodoStatus
- type ToolCallMsg
- type ToolResultMsg
- type ToolStat
- type TriggerInfo
- type WorkflowInfo
- type WorkflowStepInfo
Constants ¶
const MaxMessageSize = 32 * 1024 * 1024 // 32 MB
MaxMessageSize is the maximum size of a single JSON-line message on the vix IPC wire (daemon ↔ client socket, orchestrator ↔ python subprocess). Tool results — especially read_file on large source files — can easily exceed the old 1 MB ceiling, so buffers on both sides size up to this. The cap is an outer wall; individual tools still apply their own smaller caps (e.g. capFileReadOutput for read_file, maxOutput for bash).
Variables ¶
This section is empty.
Functions ¶
func CalculateCost ¶
CalculateCost returns the estimated dollar cost for the given token usage. model is the full prefixed spec (e.g. "anthropic/claude-opus-4-8"); the prefix is stripped before matching the per-provider pricing table. Returns 0 when no per-provider table matches — the caller should render that as "—" in the UI.
The API's input_tokens includes cache_creation + cache_read, so we subtract those to get the uncached input tokens billed at the regular rate.
func FormatPlanAsMarkdown ¶
FormatPlanAsMarkdown renders a plan as readable markdown.
func SavePlanToFile ¶
SavePlanToFile writes the plan as markdown to <plansDir>/YYYY-MM-DD_HHMMSS.md. plansDir is typically the session's paths.Plans() directory.
func ValidateAttachment ¶
func ValidateAttachment(att Attachment) error
ValidateAttachment checks if an attachment is valid.
Types ¶
type AgentDoneMsg ¶
type AgentDoneMsg struct{}
AgentDoneMsg signals the agent has finished its turn.
type Attachment ¶
type Attachment struct {
Type string `json:"type"`
MediaType string `json:"media_type"`
Data string `json:"data"`
Path string `json:"path,omitempty"`
}
Attachment represents a file attachment (e.g., image) sent with user input.
type ConfirmRequestMsg ¶
ConfirmRequestMsg asks the user to approve a tool execution.
type DaemonDisconnectedMsg ¶
type DaemonDisconnectedMsg struct{}
DaemonDisconnectedMsg signals the daemon connection was lost.
type DaemonEventMsg ¶
type DaemonEventMsg struct {
Event SessionEvent
}
DaemonEventMsg wraps a session event received from the daemon.
type DaemonStatusMsg ¶
type DaemonStatusMsg struct {
Connected bool
}
DaemonStatusMsg carries daemon connection status.
type EventCompacted ¶ added in v0.4.0
type EventCompacted struct {
FromTokens int64 `json:"from_tokens"`
ToTokens int64 `json:"to_tokens"`
SummarizedTurns int `json:"summarized_turns"`
Auto bool `json:"auto"` // true = auto-trigger, false = /compact
}
EventCompacted signals that the conversation history was summarized to free context. FromTokens is the prompt size before compaction; ToTokens is 0 when the post-compaction size is not yet known (recomputed on the next turn).
type EventConfirmRequest ¶
type EventConfirmRequest struct {
ToolName string `json:"tool_name"`
Params map[string]any `json:"params"`
RequestedDirs []string `json:"requested_dirs,omitempty"` // directories outside cwd that require approval
Detail string `json:"detail,omitempty"` // same format as EventToolResult.Detail — fenced code block or structured diff
}
EventConfirmRequest asks the user to approve a tool execution.
type EventError ¶
type EventError struct {
Message string `json:"message"`
// Code is an optional machine-readable discriminator. Used by the attach
// flow: "session_not_found" tells the client a resume target no longer
// exists on disk so it can orphan the session (offer /copy) instead of
// retrying the reconnect forever; "session_busy" tells the client the
// session is already open in another connection (exclusive single-writer
// ownership) so it should retry later or attach a different session.
Code string `json:"code,omitempty"`
}
EventError carries an error message.
type EventInitState ¶
type EventInitState struct {
State int `json:"state"`
Model string `json:"model,omitempty"` // resolved model spec, set on InitDone
}
EventInitState carries brain init progress.
type EventJobDone ¶ added in v0.5.0
type EventJobDone struct {
JobID string `json:"job_id"`
Name string `json:"name,omitempty"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
SessionID string `json:"session_id,omitempty"`
}
EventJobDone reports a finished job run. Status is ok | error | timeout (skipped runs are silent by design). SessionID references the persisted run session in the sessions list.
type EventJobRun ¶ added in v0.5.0
type EventJobRun struct {
JobID string `json:"job_id"`
Name string `json:"name,omitempty"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
}
EventJobRun signals a job lifecycle transition before/without a finished run: status is "started", "invalid" (spec failed validation), or "auto_disabled" (too many consecutive failures). Error carries detail for the non-started statuses.
type EventPlanComplete ¶
type EventPlanComplete struct {
Plan *Plan `json:"plan"`
}
EventPlanComplete signals all plan tasks are done.
type EventPlanProposed ¶
type EventPlanProposed struct {
Plan *Plan `json:"plan"`
}
EventPlanProposed carries a plan for user review.
type EventPlanTaskDone ¶
type EventPlanTaskDone struct {
TaskIdx int `json:"task_idx"`
Title string `json:"title"`
Success bool `json:"success"`
Summary string `json:"summary"`
}
EventPlanTaskDone signals a plan task has finished.
type EventPlanTaskStart ¶
type EventPlanTaskStart struct {
TaskIdx int `json:"task_idx"`
Title string `json:"title"`
Total int `json:"total"`
}
EventPlanTaskStart signals a plan task is starting.
type EventQuestionOption ¶
type EventQuestionOption struct {
Title string `json:"title"`
Description string `json:"description"`
HasUserInput bool `json:"has_user_input,omitempty"`
}
EventQuestionOption is a structured option for workflow tool steps.
type EventReplay ¶ added in v0.4.2
type EventReplay struct {
Messages []ReplayMessage `json:"messages"`
Todos []TodoItem `json:"todos,omitempty"`
ActivePlan *Plan `json:"active_plan,omitempty"`
Model string `json:"model,omitempty"`
Title string `json:"title,omitempty"`
SessionMode string `json:"session_mode,omitempty"`
ActiveWorkflow string `json:"active_workflow,omitempty"`
// Warnings are human-readable restore notices rendered into the viewport
// (e.g. "Saved with model X; switched to your current default Y.").
Warnings []string `json:"warnings,omitempty"`
}
EventReplay is emitted once, immediately after event.session_started, when a client attaches to a persisted session. It rebuilds the chat viewport and restores the session's mode/model/todos, plus any restore-time warnings (model changed, workflow missing, etc.).
type EventRetry ¶
type EventRetry struct {
Attempt int `json:"attempt"`
MaxRetries int `json:"max_retries"`
WaitSecs int `json:"wait_secs"`
Reason string `json:"reason"`
}
EventRetry notifies the UI about an API retry attempt.
type EventSessionStarted ¶
type EventSessionStarted struct {
SessionID string `json:"session_id"`
StartedAt string `json:"started_at"` // RFC3339
ParentID string `json:"parent_id,omitempty"`
ForkTurnIdx int `json:"fork_turn_idx,omitempty"`
}
EventSessionStarted acknowledges session creation.
type EventSessionsChanged ¶ added in v0.5.0
type EventSessionsChanged struct{}
EventSessionsChanged tells attached clients the persisted sessions list changed outside their own connection (a job run was persisted or swept), so they should re-fetch session.list.
type EventSkillsAvailable ¶ added in v0.4.1
type EventSkillsAvailable struct {
Skills []SkillInfo `json:"skills"`
}
EventSkillsAvailable carries the list of loaded skills to the UI so they can be offered as slash commands.
type EventStreamChunk ¶
type EventStreamChunk struct {
Text string `json:"text"`
}
EventStreamChunk carries an LLM text delta.
type EventStreamDone ¶
type EventStreamDone struct {
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CacheCreationTokens int64 `json:"cache_creation_tokens"`
CacheReadTokens int64 `json:"cache_read_tokens"`
ElapsedMs int64 `json:"elapsed_ms"`
}
EventStreamDone signals LLM turn completion with token stats.
type EventThinkingChunk ¶
type EventThinkingChunk struct {
Text string `json:"text"`
}
EventThinkingChunk carries an LLM extended-thinking delta.
type EventThinkingStall ¶
type EventThinkingStall struct {
ElapsedMs int64 `json:"elapsed_ms"`
SummaryChars int `json:"summary_chars"`
}
EventThinkingStall notifies the UI that extended thinking exceeded the stall timeout. The daemon cancels the stream and nudges the model to conclude on the next retry attempt.
type EventTitleUpdated ¶ added in v0.5.0
type EventTitleUpdated struct {
Title string `json:"title"`
}
EventTitleUpdated is emitted on a session's stream when its display title changes (LLM auto-titling after a few turns). The sessions list refresh for other clients goes through event.sessions_changed.
type EventTodoListUpdated ¶
type EventTodoListUpdated struct {
Todos []TodoItem `json:"todos"`
}
type EventToolCall ¶
type EventToolCall struct {
ToolID string `json:"tool_id"`
Name string `json:"name"`
// Arguments is the raw tool input as issued by the model (structured
// key/value payload). Included so trajectory consumers (ATIF exporters,
// SFT/RL pipelines) can round-trip the exact call without re-deriving
// it from Summary. Summary stays the human-readable one-liner.
Arguments map[string]any `json:"arguments,omitempty"`
Summary string `json:"summary"`
Reason string `json:"reason,omitempty"`
// TimeoutSec is the effective tool-call timeout in seconds, after daemon
// clamping. See daemon.resolveToolTimeout: floor and cap come from the
// `tool_timeouts` block in settings.json (defaulting to 120s / 600s when
// absent or invalid), and only bash/glob_files honor the model's
// `timeout` override.
TimeoutSec int `json:"timeout_sec,omitempty"`
// Bash-specific alternative-tool justifications (omitted when empty or "N/A").
ReasonNotReadFile string `json:"reason_not_read_file,omitempty"`
ReasonNotEditFile string `json:"reason_not_edit_file,omitempty"`
ReasonNotGlobFiles string `json:"reason_not_glob_files,omitempty"`
// ReasonToIncreaseTimeout is the model's justification for raising the
// bash/glob_files timeout above the 120s default. Populated from the
// `reason_to_increase_timeout` field of the tool input.
ReasonToIncreaseTimeout string `json:"reason_to_increase_timeout,omitempty"`
}
EventToolCall indicates a tool call is starting.
type EventToolResult ¶
type EventToolResult struct {
ToolID string `json:"tool_id"`
Name string `json:"name"`
Output string `json:"output"`
IsError bool `json:"is_error"`
Detail string `json:"detail,omitempty"` // optional rich detail (e.g. edit diff)
}
EventToolResult carries the result of a tool execution.
type EventUpdateAvailable ¶ added in v0.4.3
type EventUpdateAvailable struct {
Current string `json:"current"`
Latest string `json:"latest,omitempty"`
URL string `json:"url,omitempty"`
Method string `json:"method,omitempty"`
}
EventUpdateAvailable informs the UI of the running version versus the latest published GitHub release. Emitted once per session at init. Latest is empty when the daemon is up-to-date, the check is disabled, or it could not reach GitHub. Method is one of "brew" | "script" | "unknown" and selects the in-app upgrade command the TUI offers.
type EventUserQuestion ¶
type EventUserQuestion struct {
// Single-question fields (backward compatible)
Question string `json:"question"`
Options []string `json:"options"`
RichOptions []EventQuestionOption `json:"rich_options,omitempty"` // structured options (workflow tool steps)
Placeholder string `json:"placeholder,omitempty"`
Category string `json:"category,omitempty"`
// Multi-question batch (if set, overrides single fields)
Questions []QuestionDef `json:"questions,omitempty"`
}
EventUserQuestion asks the user a question with options.
type EventWorkflowComplete ¶
type EventWorkflowComplete struct {
WorkflowName string `json:"workflow_name"`
Success bool `json:"success"`
Summary string `json:"summary,omitempty"`
StepCosts []StepCost `json:"step_costs,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
}
EventWorkflowComplete signals a workflow has finished.
type EventWorkflowStart ¶
type EventWorkflowStart struct {
WorkflowName string `json:"workflow_name"`
TotalSteps int `json:"total_steps"`
Steps []WorkflowStepInfo `json:"steps,omitempty"`
}
EventWorkflowStart signals a workflow has started.
type EventWorkflowStatus ¶ added in v0.4.5
type EventWorkflowStatus struct {
WorkflowName string `json:"workflow_name"`
Status string `json:"status"`
StepID string `json:"step_id,omitempty"`
Iteration int `json:"iteration,omitempty"`
TokensUsed int64 `json:"tokens_used,omitempty"`
TokenBudget int64 `json:"token_budget,omitempty"`
ElapsedSeconds int64 `json:"elapsed_seconds,omitempty"`
Note string `json:"note,omitempty"`
}
EventWorkflowStatus signals a workflow run status transition (paused, blocked, budget_limited, resumed). Carries the run's live accounting so clients can render an indicator without tracking step events themselves.
type EventWorkflowStepDone ¶
type EventWorkflowStepDone struct {
StepID string `json:"step_id"`
StepIdx int `json:"step_idx"`
Total int `json:"total"`
Success bool `json:"success"`
TimedOut bool `json:"timed_out,omitempty"` // bash step killed by per-step timeout; workflow continues
Display string `json:"display,omitempty"`
Command string `json:"command,omitempty"` // bash step: resolved command that was run
BashOutput string `json:"bash_output,omitempty"` // bash step: first 5 lines of output
Model string `json:"model,omitempty"`
InputTokens int64 `json:"input_tokens,omitempty"`
OutputTokens int64 `json:"output_tokens,omitempty"`
CacheCreationTokens int64 `json:"cache_creation_tokens,omitempty"`
CacheReadTokens int64 `json:"cache_read_tokens,omitempty"`
ToolStats []ToolStat `json:"tool_stats,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
}
EventWorkflowStepDone signals a workflow step has finished.
type EventWorkflowStepStart ¶
type EventWorkflowStepStart struct {
StepID string `json:"step_id"`
StepIdx int `json:"step_idx"`
Total int `json:"total"`
Agent string `json:"agent"`
Explanation string `json:"explanation,omitempty"`
}
EventWorkflowStepStart signals a workflow step is starting.
type EventWorkflowsAvailable ¶
type EventWorkflowsAvailable struct {
Workflows []WorkflowInfo `json:"workflows"`
}
EventWorkflowsAvailable carries the list of configured workflows to the UI.
type InitStateMsg ¶
type InitStateMsg struct{ State int }
InitStateMsg carries the brain init state to the UI.
type InstanceRegisterData ¶ added in v0.4.2
type InstanceRegisterData struct {
InstanceID string `json:"instance_id,omitempty"`
Mode string `json:"mode,omitempty"` // "tui" | "headless"
}
InstanceRegisterData is the payload of an "instance.register" command. A vix process opens one such connection at startup and holds it open for its whole lifetime so the daemon can count attached instances independently of sessions (a single vix instance may hold several session connections, or none). The connection closing — on clean exit or process death — is the liveness signal; no heartbeat is sent. The fields are advisory (logging/observability only); counting relies on the connection itself.
type Plan ¶
type Plan struct {
Name string `json:"name"`
Context string `json:"context"`
Architecture string `json:"architecture,omitempty"`
Files []string `json:"files,omitempty"`
Risks string `json:"risks,omitempty"`
Tasks []*PlanTask `json:"tasks"`
CurrentIdx int `json:"current_idx"`
}
Plan represents a structured multi-step plan.
func (*Plan) AdvanceToNextPending ¶
AdvanceToNextPending moves CurrentIdx to the next pending task. Returns false if no pending tasks remain.
func (*Plan) CurrentTask ¶
CurrentTask returns the currently executing task, or nil.
type PlanAction ¶
type PlanAction struct {
Type PlanActionType
Text string // only used for PlanModify
}
PlanAction carries a user decision about a plan.
type PlanActionType ¶
type PlanActionType int
PlanActionType represents user actions on a proposed plan.
const ( PlanApprove PlanActionType = iota PlanReject PlanModify )
type PlanCompleteMsg ¶
type PlanCompleteMsg struct{ Plan *Plan }
PlanCompleteMsg signals all plan tasks are done.
type PlanProposedMsg ¶
type PlanProposedMsg struct{ Plan *Plan }
PlanProposedMsg signals a new plan is ready for review.
type PlanTask ¶
type PlanTask struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Substeps []string `json:"substeps,omitempty"`
Status TaskStatus `json:"status"`
Result string `json:"result,omitempty"`
}
PlanTask represents a single step in a plan.
type PlanTaskDoneMsg ¶
PlanTaskDoneMsg signals a plan task has finished.
type PlanTaskStartMsg ¶
PlanTaskStartMsg signals a plan task is starting execution.
type QuestionDef ¶
type QuestionDef struct {
ID string `json:"id"`
Category string `json:"category"`
Question string `json:"question"`
Options []string `json:"options,omitempty"`
}
QuestionDef defines a single question in a batch.
type ReplayBlock ¶ added in v0.4.2
type ReplayBlock struct {
Kind string `json:"kind"` // "text" | "thinking" | "tool_use" | "tool_result"
Text string `json:"text,omitempty"`
ToolID string `json:"tool_id,omitempty"`
ToolName string `json:"tool_name,omitempty"`
Input map[string]any `json:"input,omitempty"`
Output string `json:"output,omitempty"`
IsError bool `json:"is_error,omitempty"`
}
ReplayBlock is one content block of a replayed conversation turn, projected into a wire-stable shape owned by this package (so neither protocol nor the TUI needs to import the daemon's llm types).
type ReplayMessage ¶ added in v0.4.2
type ReplayMessage struct {
Role string `json:"role"` // "user" | "assistant"
Blocks []ReplayBlock `json:"blocks"`
}
ReplayMessage is one turn of a replayed conversation.
type SessionCommand ¶
type SessionCommand struct {
Type string `json:"type"`
AuthToken string `json:"auth_token,omitempty"`
Data json.RawMessage `json:"data"`
}
SessionCommand is a message sent from client to daemon.
AuthToken carries the shared-secret token the daemon was started with via -auth-token-path. The daemon validates it on every message — both the initial session.start and every follow-up — and closes the connection on mismatch. The auth check is OFF by default: when vixd is launched without -auth-token-path the daemon-side token is empty, AuthToken is ignored, and any caller is accepted (legacy single-user-host behaviour). The omitempty tag keeps the wire format clean in that mode.
type SessionConfirmData ¶
type SessionConfirmData struct {
Approved bool `json:"approved"`
PersistDirs bool `json:"persist_dirs,omitempty"` // save approved directories to settings.json
}
SessionConfirmData carries tool approval/denial.
type SessionEvent ¶
SessionEvent is a message sent from daemon to client.
type SessionInputData ¶
type SessionInputData struct {
Text string `json:"text"`
Attachments []Attachment `json:"attachments,omitempty"`
}
SessionInputData carries user chat input.
type SessionPlanActionData ¶
type SessionPlanActionData struct {
Action string `json:"action"` // "approve", "reject", "modify"
Text string `json:"text,omitempty"`
}
SessionPlanActionData carries plan review decisions.
type SessionSetModelData ¶
type SessionSetModelData struct {
Model string `json:"model"`
}
SessionSetModelData carries a model switch request.
type SessionStartData ¶
type SessionStartData struct {
CWD string `json:"cwd"`
ConfigDir string `json:"config_dir,omitempty"`
Model string `json:"model"`
ForceInit bool `json:"force_init"`
EnableAutomaticWritePermission bool `json:"enable_automatic_write_permission"`
EnableAutomaticDirectoryAccess bool `json:"enable_automatic_directory_access"`
Headless bool `json:"headless"`
// ClientVersion is the vix binary version opening this session. The daemon
// refuses the session (event.error, code "version_mismatch") when it does
// not exactly match the daemon's own version — a long-lived daemon must
// never serve a client from a different build.
ClientVersion string `json:"client_version,omitempty"`
// Fork fields: when ForkSessionID is non-empty the new session is seeded
// with the conversation history of the named session up to and including
// the turn at ForkTurnIdx (0-based).
ForkSessionID string `json:"fork_session_id,omitempty"`
ForkTurnIdx int `json:"fork_turn_idx,omitempty"`
// AttachSessionID, when non-empty, asks the daemon to resume a persisted
// session by ID instead of creating a fresh one: it loads the on-disk
// record from open/, reuses that ID, and replays the conversation to the
// client via event.replay. Records in closed/ are not attachable — an
// explicitly closed session stays closed. If no open record exists the
// daemon answers with event.error carrying Code "session_not_found".
AttachSessionID string `json:"attach_session_id,omitempty"`
}
SessionStartData is sent to start a new agent session.
type SessionSummary ¶ added in v0.4.2
type SessionSummary struct {
ID string `json:"id"`
CWD string `json:"cwd"`
Model string `json:"model"`
// Title is the session's display title: set by an LLM summarization pass
// after a few turns (user sessions) or at creation time (job runs). When
// empty, clients fall back to FirstMessage.
Title string `json:"title,omitempty"`
FirstMessage string `json:"first_message,omitempty"`
StartedAt string `json:"started_at,omitempty"` // RFC3339
LastRequestAt string `json:"last_request_at,omitempty"` // RFC3339
// Attached is true when this session is currently live in the daemon (open
// in some connection). The launching client uses it to avoid attaching a
// session another instance already owns (exclusive single-writer ownership).
Attached bool `json:"attached,omitempty"`
// Origin distinguishes user-started sessions ("", the default) from
// vix-initiated ones ("vix" — scheduled job runs, synthetic alerts). The
// TUI groups the sessions list by it and never auto-claims vix-initiated
// sessions on launch.
Origin string `json:"origin,omitempty"`
Trigger *TriggerInfo `json:"trigger,omitempty"`
// JobStatus carries the finished run's status (ok | error | timeout) for
// vix-initiated sessions, powering the badge in the sessions list.
JobStatus string `json:"job_status,omitempty"`
// Unread reports whether the session holds content the user hasn't seen
// (session-global, persisted — survives restarts). Cleared via the
// session.mark_read command when the user views the session.
Unread bool `json:"unread,omitempty"`
}
SessionSummary is the lightweight projection of a persisted session returned by the session.list RPC. It carries just enough to populate the Sessions list without loading full conversation histories.
type SessionTrimData ¶
type SessionTrimData struct {
TurnIdx int `json:"turn_idx"` // keep history up to and including this turn (0-based)
}
SessionTrimData carries a history trim request.
type SessionUserAnswerData ¶
type SessionUserAnswerData struct {
Answer string `json:"answer"`
Text string `json:"text,omitempty"` // user input when has_user_input
Answers map[string]string `json:"answers,omitempty"` // question ID → answer (batch mode)
}
SessionUserAnswerData carries the user's response to a question.
type SessionWorkflowData ¶
SessionWorkflowData carries a workflow execution request.
type SessionWorkflowMessageData ¶
type SessionWorkflowMessageData struct {
Text string `json:"text"`
}
SessionWorkflowMessageData carries a user message to inject into the running workflow.
type SkillInfo ¶ added in v0.4.1
SkillInfo describes a loaded skill available for slash-command autocomplete.
type StepCost ¶
type StepCost struct {
StepID string `json:"step_id"`
Explanation string `json:"explanation,omitempty"`
Model string `json:"model"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CacheCreationTokens int64 `json:"cache_creation_tokens"`
CacheReadTokens int64 `json:"cache_read_tokens"`
Cost float64 `json:"cost"`
DurationMs int64 `json:"duration_ms,omitempty"`
}
StepCost summarizes token usage and cost for a single workflow step.
type StreamChunkMsg ¶
type StreamChunkMsg struct{ Text string }
StreamChunkMsg carries a text delta from the streaming API.
type StreamDoneMsg ¶
type StreamDoneMsg struct {
InputTokens int64
OutputTokens int64
CacheCreationTokens int64
CacheReadTokens int64
Elapsed time.Duration
}
StreamDoneMsg signals that streaming is complete.
type SubagentDoneMsg ¶
SubagentDoneMsg signals that a subagent has finished.
type SubagentStartMsg ¶
SubagentStartMsg signals that a subagent is starting.
type TaskStatus ¶
type TaskStatus int
TaskStatus represents the state of a plan task.
const ( TaskPending TaskStatus = iota TaskInProgress TaskCompleted TaskFailed )
type TodoItem ¶
type TodoItem struct {
ID string `json:"id"`
Content string `json:"content"`
Status TodoStatus `json:"status"`
DependsOn []string `json:"depends_on,omitempty"`
}
type TodoStatus ¶
type TodoStatus string
const ( TodoPending TodoStatus = "pending" TodoInProgress TodoStatus = "in_progress" TodoCompleted TodoStatus = "completed" )
func (TodoStatus) Valid ¶
func (s TodoStatus) Valid() bool
type ToolCallMsg ¶
ToolCallMsg indicates a tool call is starting.
type ToolResultMsg ¶
ToolResultMsg carries the result of a tool execution.
type ToolStat ¶
type ToolStat struct {
Name string `json:"name"`
Calls int `json:"calls"`
Summary string `json:"summary"`
}
ToolStat summarizes tool usage within a workflow step.
type TriggerInfo ¶ added in v0.5.0
TriggerInfo records what fired a vix-initiated session: a scheduled job's trigger type ("cron" | "at") and the job id.
type WorkflowInfo ¶
type WorkflowInfo struct {
Name string `json:"name"`
}
WorkflowInfo describes a workflow available for UI mode cycling.
type WorkflowStepInfo ¶
type WorkflowStepInfo struct {
ID string `json:"id"`
Explanation string `json:"explanation,omitempty"`
}
WorkflowStepInfo carries static metadata about a single workflow step.