Documentation
¶
Overview ¶
Package copilot is the GitHub Copilot cloud agent module, a cloud-only module: the agent works in GitHub's cloud and hands back a pull request on a copilot/… branch, and hopsesh reaches it only through the GitHub CLI's agent-task commands (gh agent-task list, gh agent-task view [--log]) and gh pr, signed in as the user. It keeps nothing on any machine, so the file methods come from agent.NoLocal.
Index ¶
- type Module
- func (m *Module) Detect(_ context.Context, h agent.Host) (agent.Install, error)
- func (m *Module) FetchCloud(ctx context.Context, h agent.Host, _ agent.Install, sid agent.SessionID, ...) (agent.Fetched, error)
- func (m *Module) ListCloud(ctx context.Context, h agent.Host, _ agent.Install, q agent.CloudQuery) (agent.CloudListing, error)
- func (m *Module) SendCloud(ctx context.Context, h agent.Host, _ agent.Install, r agent.SendRequest) (agent.Sent, error)
- func (*Module) Spec() agent.Spec
- func (m *Module) TestCloud(ctx context.Context, h agent.Host, _ agent.Install, _ string) (agent.CloudTest, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
Module is the Copilot cloud agent module.
func (*Module) FetchCloud ¶
func (m *Module) FetchCloud(ctx context.Context, h agent.Host, _ agent.Install, sid agent.SessionID, _ agent.FetchTarget) (agent.Fetched, error)
FetchCloud reads a task, its pull request's branch (gh pr view) and its session log (gh agent-task view --log). The code comes home as the pull request's branch, which the core fetches into a worktree; the log is the conversation as text. Neither changes anything on GitHub.
func (*Module) ListCloud ¶
func (m *Module) ListCloud(ctx context.Context, h agent.Host, _ agent.Install, q agent.CloudQuery) (agent.CloudListing, error)
ListCloud lists the agent tasks gh can see (gh agent-task list --json), refreshes the ones hopsesh recorded that the listing leaves out (view --json), and reads the branches of their pull requests (gh pr list --json, once per repository).
func (*Module) SendCloud ¶
func (m *Module) SendCloud(ctx context.Context, h agent.Host, _ agent.Install, r agent.SendRequest) (agent.Sent, error)
SendCloud starts the session without a terminal (send) and returns it.
func (*Module) TestCloud ¶
func (m *Module) TestCloud(ctx context.Context, h agent.Host, _ agent.Install, _ string) (agent.CloudTest, error)
TestCloud asks gh which GitHub login it uses (gh auth status --json hosts; never the token), asks for one task to learn whether the account has the cloud agent, and checks that gh still has the agent-task commands the module uses. It starts nothing.