routes

package
v0.81.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: AGPL-3.0 Imports: 19 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 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

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 AppUpdate

func AppUpdate(d *rpc.Handler, s *appupdate.Service)

AppUpdate exposes the app update service as api declares it.

func Browser added in v0.80.0

func Browser(d *rpc.Handler, s *browser.Service)

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

func Drop(d *rpc.Handler, s *drop.Service)

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 Project

func Project(d *rpc.Handler, s *project.Service)

Project exposes the project service as api declares it.

func Providers

func Providers(d *rpc.Handler, s *providers.Service)

Providers exposes provider detection as api declares it.

func Quota

func Quota(d *rpc.Handler, s *quota.Service)

Quota exposes the plan readings as api declares them.

func Relay

func Relay(d *rpc.Handler, s *relay.Service)

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 Services added in v0.79.0

func Services(d *rpc.Handler, s *services.Service)

Services exposes the project services as api declares them.

func Spawn

func Spawn(d *rpc.Handler, s *spawn.Service)

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 Store

func Store(d *rpc.Handler, s *store.Service)

Store exposes the store service as api declares it.

func System

func System(d *rpc.Handler, s *system.Service)

System exposes the system service as api declares it.

func Terminal

func Terminal(d *rpc.Handler, s *terminal.Service)

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.

func Themes

func Themes(d *rpc.Handler, s *themes.Service)

Themes exposes the themes service as api declares it.

func Tray

func Tray(d *rpc.Handler, t *tray.Tray)

Tray exposes the tray as api declares it. tray.Labels keeps its own type for its methods; the conversion holds its fields to api's.

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).

Jump to

Keyboard shortcuts

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