Documentation
¶
Overview ¶
Package schedagent runs the agent of an agent schedule (定期実行): the command line the daemon builds for a run (Argv), and `stagent schedule agent`, the wrapper a run's holder starts it under. The wrapper runs the agent non-interactively with JSON output, shows that output on the session's terminal as text, and judges the run from it (Outcome).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Argv ¶
Argv is the command line of an agent schedule's run (s valid), as its directory is now: the harness's non-interactive mode with JSON output and s's permission, the prompt last after "--". Nothing in it asks for the conversation not to be kept. claude answers no permission prompt (refused instead); codex outside a Git work tree is told it may run there; omp started in home is kept there (it would move to a temporary directory).
func InGitWorkTree ¶
InGitWorkTree reports whether dir is in a Git work tree: it or a directory above it has .git (a directory, or a worktree's file).
func Permission ¶
Permission is s's permission, "" being read.
func ValidPermission ¶
ValidPermission reports whether p is a permission ("" is read).
Types ¶
type Outcome ¶
type Outcome struct {
// Result is wire.RunSucceeded, RunDenied or RunFailed.
Result string `json:"result"`
Denials int `json:"denials,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
Summary string `json:"summary,omitempty"`
// Unjudged: the output was not the agent's JSON; Result is the exit
// code's alone.
Unjudged bool `json:"unjudged,omitempty"`
// Error says why it failed, when the output says.
Error string `json:"error,omitempty"`
// AuthFailed: the run failed because the agent could not log in
// (claude asked for /login or was refused with HTTP 401).
AuthFailed bool `json:"auth_failed,omitempty"`
}
Outcome is how an agent run went, as the wrapper judged it from the agent's JSON output and exit code. The wrapper leaves it in the file the daemon names (--result); the daemon records it on the run.
func ReadOutcome ¶
ReadOutcome reads the outcome a run's wrapper left in path.