Documentation
¶
Overview ¶
Package amp is the Amp module for Amp's threads and orbs, a cloud-only module: Amp keeps every thread on its servers (an orb is a cloud machine a thread runs on), and hopsesh reaches them only through the amp CLI (amp threads list, amp threads markdown), signed in as the user. Amp's local CLI sessions are threads too, so they are listed here. It keeps nothing on any machine, so the file methods come from agent.NoLocal.
Index ¶
- type Module
- func (m *Module) CloudURL(_ string, sid agent.SessionID) string
- 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) ParseCloudLink(s string) (string, agent.SessionID, bool)
- 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 Amp 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 thread as Markdown (amp threads markdown <id>) as the conversation in text. The orb's code stays in the orb.
func (*Module) ListCloud ¶
func (m *Module) ListCloud(ctx context.Context, h agent.Host, _ agent.Install, q agent.CloudQuery) (agent.CloudListing, error)
ListCloud lists the threads (amp threads list). The CLI prints a table; its layout is not documented (a community SDK reads title, last updated, visibility, messages and thread id, split by runs of spaces), so each row is read by its cells' shapes: the T-… cell is the id, a number the message count, the first cell the title. Threads carry no repository or state in the list.
func (*Module) ParseCloudLink ¶
ParseCloudLink reads a thread's link (https://ampcode.com/threads/T-…) or its id.
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 lists the threads once (read-only; it needs the login), and checks that the CLI still has the commands the module uses. Amp documents no status command. It starts nothing.