schedagent

package
v0.18.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Argv(s wire.Schedule, home string) []string

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

func InGitWorkTree(dir string) bool

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 Main

func Main(args []string) int

Main is `stagent schedule …`.

func Permission

func Permission(s wire.Schedule) string

Permission is s's permission, "" being read.

func ValidPermission

func ValidPermission(p string) bool

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

func ReadOutcome(path string) (Outcome, error)

ReadOutcome reads the outcome a run's wrapper left in path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL