Documentation
¶
Overview ¶
Package app wires configuration, the profile store, transports, the domain client and the MCP server together for the CLI.
Index ¶
Constants ¶
const ( EnvCookies = "NOTEBOOKLM_COOKIES" EnvCookiesFile = "NOTEBOOKLM_COOKIES_FILE" )
Sign-in without `sourcebolt login`, for containers (Docker MCP Toolkit, docker run): the cookie export itself, or the path of a file holding it (a Docker secret under /run/secrets). Same formats as `login --import`.
Variables ¶
This section is empty.
Functions ¶
func EnvProfile ¶ added in v0.3.2
EnvProfile builds an in-memory profile from EnvCookies or EnvCookiesFile, and the name of the variable used. It returns nil, "", nil when neither is set (an empty value counts as unset: catalogs pass "" for a secret nobody filled in). Build calls it; call it directly only where Build is not used (status).
Both variables are removed from the process environment before anything else happens, valid or not, so a child process (the fallback browser) never inherits the cookies.
Errors name the variable and, for an incomplete jar, the missing cookie names. They never include the input: a parser error can quote it.
Types ¶
type Config ¶
type Config struct {
ConfigDir string // NOTEBOOKLM_CONFIG_DIR, default %USERPROFILE%\.sourcebolt (Windows) or <user config>/sourcebolt
Profile string // NOTEBOOKLM_PROFILE, default "default"
Host session.Host // NOTEBOOKLM_HOST overrides the profile's host
RPCIDs string // NOTEBOOKLM_RPC_IDS, default <config>/rpc-ids.json if present
// BrowserFallback enables the lazy headless-browser fallback transport.
// Default true; NOTEBOOKLM_BROWSER_FALLBACK=0 (or false/off/no) disables.
BrowserFallback bool
// contains filtered or unexported fields
}
Config comes from flags and environment.
func ConfigFromEnv ¶
ConfigFromEnv reads the NOTEBOOKLM_* variables.
type Option ¶
type Option func(*options)
Option customizes ForProfile.
func WithBrowserFallback ¶
WithBrowserFallback adds the lazy browser fallback; its profile dir is <configDir>/browser/<profile>. No browser starts before the first call that the fallback policy allows.
type Runtime ¶
type Runtime struct {
Deps mcpserver.Deps
Transport *rpc.Transport // the rpc transport (Warm, doctor)
Active transport.Transport // what the nlm client calls: Router, or Transport when fallback is off
Router *transport.Router // nil when the browser fallback is disabled
Profile *session.Profile
Store session.Store // nil for env cookies: nothing is written to disk
// CookieSource names the environment variable the cookies came from
// (EnvCookies or EnvCookiesFile); empty for a saved profile.
CookieSource string
// ProfileErr is why the saved profile could not be read (wrong or
// missing key, corrupt file); nil otherwise. The server still starts
// and tool calls report AUTH_REQUIRED until `sourcebolt login`
// replaces the profile.
ProfileErr error
// contains filtered or unexported fields
}
Runtime is a fully wired server for one profile.
func Build ¶
Build loads the profile (or an empty one, so tools report AUTH_REQUIRED instead of the server failing to start) and wires every layer.
func ForProfile ¶
ForProfile wires a runtime around an in-memory profile. Without options the nlm client uses the bare rpc transport.