Documentation
¶
Overview ¶
Package routes exposes the services api declares on an rpc.Handler, one function per service. It is its own package so the tests that post as a client of another release (internal/cli) answer through the same routes the app does.
A service method nothing here routes cannot be reached over /rpc/, and the ones kept out are kept out on purpose: they exist for Go callers inside the process. Startup wiring (the Set* setters, store.Close) would rewire or end what the app runs on; the hooks' state stream and a worker's answer arrive over /hook and /mod/*, and called here would act for another session; terminal.CloseBy, the mod's command queue and terminal.SubmitPrompt skip the checks spawn.Close, spawn.Control and the relay make; terminal.SessionAccount returns a session's credentials; and a dropped file's bytes go to /drop, outside the JSON envelope.
Index ¶
- func AgentPlugin(d *rpc.Handler, s *agentplugin.Service)
- func AppUpdate(d *rpc.Handler, s *appupdate.Service)
- func Artifact(d *rpc.Handler, s *artifact.Service)
- func Browser(d *rpc.Handler, s *browser.Service)
- func ClaudeLoginCode(d *rpc.Handler, ...)
- func Drop(d *rpc.Handler, s *drop.Service)
- func PatchNotes(d *rpc.Handler, s *patchnotes.Service)
- func ProfileLogin(d *rpc.Handler, m api.ProfileLoginMethods, s ProfileLogins)
- func ProfilePluginCalls(d *rpc.Handler, m api.ProfilePluginMethods, s ProfilePlugins)
- func Profiles(d *rpc.Handler, m api.ProfileMethods, s ProfileService)
- func Project(d *rpc.Handler, s *project.Service)
- func Providers(d *rpc.Handler, s *providers.Service)
- func Quota(d *rpc.Handler, s *quota.Service)
- func Relay(d *rpc.Handler, s *relay.Service)
- func Services(d *rpc.Handler, s *services.Service)
- func Spawn(d *rpc.Handler, s *spawn.Service)
- func Store(d *rpc.Handler, s *store.Service)
- func System(d *rpc.Handler, s *system.Service)
- func Terminal(d *rpc.Handler, s *terminal.Service)
- func Themes(d *rpc.Handler, s *themes.Service)
- func Tray(d *rpc.Handler, t *tray.Tray)
- type ProfileLogins
- type ProfilePlugins
- type ProfileService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentPlugin ¶
func AgentPlugin(d *rpc.Handler, s *agentplugin.Service)
AgentPlugin exposes the lich plugin's install state as api declares it.
func Browser ¶ added in v0.80.0
Browser exposes the session browser as api declares it. Cleanup and CloseOwnedBy stay out: one ends every browser this process started, the other runs when the session that owns one is closed.
func ClaudeLoginCode ¶
func ClaudeLoginCode(d *rpc.Handler, loginCode func(context.Context, api.LoginCodeOptions) (api.None, error))
ClaudeLoginCode hands a running Claude Code login the code its page showed.
func Drop ¶
Drop exposes the drop service as api declares it. A dropped file's bytes arrive on /drop, outside the RPC's JSON envelope.
func PatchNotes ¶
func PatchNotes(d *rpc.Handler, s *patchnotes.Service)
PatchNotes exposes the patch notes as api declares them.
func ProfileLogin ¶
func ProfileLogin(d *rpc.Handler, m api.ProfileLoginMethods, s ProfileLogins)
ProfileLogin exposes s's login as the methods m.
func ProfilePluginCalls ¶
func ProfilePluginCalls(d *rpc.Handler, m api.ProfilePluginMethods, s ProfilePlugins)
ProfilePluginCalls exposes s's plugin calls as the methods m.
func Profiles ¶
func Profiles(d *rpc.Handler, m api.ProfileMethods, s ProfileService)
Profiles exposes s as the profile methods m.
func Relay ¶
Relay exposes the relay service as api declares it. The hooks' state stream and a worker's answer stay out: they arrive over /hook and /mod/answer, and called here would act for another session.
func Spawn ¶
Spawn exposes the spawn service as api declares it. CloseFinishedWorker stays out: it is the relay's, and closes a worker with none of Close's checks.
func Terminal ¶
Terminal exposes the terminal service as api declares it. A close on behalf of another session and the mod's command queue stay out: they skip the checks spawn.Close and spawn.Control make.
Types ¶
type ProfileLogins ¶
type ProfileLogins interface {
Login(_ context.Context, opts api.ProfileSlugOptions) (api.None, error)
CancelLogin(_ context.Context, opts api.ProfileSlugOptions) (api.None, error)
}
ProfileLogins is a profile service that runs its provider's login itself.
type ProfilePlugins ¶
type ProfilePlugins interface {
Plugins(_ context.Context, opts api.ProfileSlugOptions) ([]api.ProfilePlugin, error)
InstallPlugins(_ context.Context, opts api.InstallPluginsOptions) ([]api.ProfilePluginResult, error)
}
ProfilePlugins is a profile service that carries plugins between profiles.
type ProfileService ¶
type ProfileService interface {
Profiles(_ context.Context, _ api.None) ([]api.ProfileInfo, error)
CreateProfile(_ context.Context, opts api.CreateProfileOptions) (api.Profile, error)
UpdateProfile(_ context.Context, opts api.UpdateProfileOptions) (api.Profile, error)
DeleteProfile(_ context.Context, opts api.ProfileSlugOptions) (api.None, error)
LoginCommand(_ context.Context, opts api.ProfileSlugOptions) (string, error)
}
ProfileService is what every provider's profile service answers (claudeprofile, codexprofile, ompprofile, xdgprofile).