Skip to main content

Module server_input

Module server_input 

Source
Expand description

What a pasted or typed server is (#47, the Add dialog and surject server add <URL> / -- <COMMAND...>): an address, a config snippet, a command line, a repository or a folder; the transport an address suggests; the clients a new server is enabled for by default; and the entries client files already hold for the same address or command (the dialog offers Import instead).

Analysis reads no network and runs nothing; the folder check only asks whether the path is a directory.

Modules§

suggest
Server id suggestions (#47): one slug rule for the app’s Add dialog, surject server add <URL> and surject server add -- <COMMAND...>, so both suggest the same id for the same input.

Structs§

Analysis
The result of analyze.
ExistingEntry
A client entry Surjection does not manage that runs the same server.

Enums§

InputKind
What the text is.
Launch
What a client entry must run to be the same server.

Functions§

analyze
Reads text (see the module docs). The order: an address (a repository when it names one), a folder, a snippet, a command line.
default_clients
The clients a new server with transport is enabled for by default: the ones all-detected selects here (detected or forced on in clients.toml, with an MCP config Surjection writes on this OS, able to run the transport), minus clients this machine excludes. In table order. Read-only; no store is fine.
default_clients_in
default_clients for a desired state already loaded.
existing_entries
The entries not managed by Surjection (the import scan of user files and known projects) that run launch: the same address (scheme and host case, a trailing / ignored), or the same program (its name, so npx and C:\...\npx.cmd match; cmd /c unwrapped) with the same arguments. Read-only.
looks_like_command
Whether argv starts a local server: its program is a known runner ([RUNNERS]) or a path to a program.
repository_url
text as a repository address: git@host:owner/repo, ssh:// and git:// addresses, an address ending in .git, or https://<forge>/<owner>/<repo>[/tree/...] on a known forge.
split_command
A one-line command as words: whitespace separates, "..." and '...' group (quotes removed). A backslash is an ordinary character, so Windows paths stay whole. A leading $ or > prompt is dropped. None for empty text or an unclosed quote.
transport_from_url
The transport an address suggests: sse when its path ends in /sse, else Streamable HTTP.