Versions 154 to 155
new file, 111 lines
1+// The --server flag (abso-core issue 10). Every command that talks to a server takes --server <url>, parsed and
3+// - A command that works on a joined folder ("folder") talks only to that folder's server. --server there must
4+// name that same server; another one is refused, never swapped in, so the folder's work and key never go to
5+// a server it wasn't joined on. Outside a joined folder it is refused too, with how to join one there.
6+// - A command that picks a server for itself ("chosen": join, init, login, whoami and the rest about this box)
9+// A value that isn't an http or https URL (a user name, a query or a fragment included) is refused before any
11+
16+
19+
33+
35+const LOCAL: ReadonlySet<string> = new Set(["skill", "check-ignore", "pause", "resume", "fix-eol"]);
36+
41+
43+
50+ `${from} takes an http or https URL with no user name, query or fragment, like ${EXAMPLE} (got ${JSON.stringify(value)})`,
54+
60+
61+/** Whether two servers are the same one: the same scheme, host, port and path, ignoring case and a trailing slash. */
65+
66+/** The server in the .abso/config.json of the folder `cwd` is in, or undefined outside one (or when it can't be read). */
71+ const server = (JSON.parse(readFileSync(configPath(root), "utf8")) as { server?: unknown }).server;
77+
79+ * For a command that works on a joined folder: refuses a --server that isn't the folder's own server, and one
86+ `abso ${command} works on a joined folder, and ${cwd} isn't in one. To work with ${flag}: abso join <project> --server ${flag}, or abso init --server ${flag} for a new project.`,
90+ `this folder is joined on ${own}, not ${flag}, so abso ${command} won't send its work or key there. Run it in a folder joined on ${flag} (abso join <project> --server ${flag}).`,
93+
100+ return "--server <url>: this folder's own server, which it uses anyway. Another server is refused, never swapped in, so the folder's work and key go only to the server it was joined on.";
103+ ? "--server <url>: the server the key is for; without it, this folder's. It is used as given, never swapped for another."
104+ : "--server <url>: the server to use, as given, never swapped for another. Each server gets only its own sign-in.";
107+
110+ return `abso ${command} works on this machine only and talks to no server, so it takes no --server`;
- MCP
- compare on this site's /mcp
- CLI
- abso diff 154 155 client/src/server-choice.ts --json
- JSON
- /christopher/abso-core/compare/154..155?file=client%2Fsrc%2Fserver-choice.ts&format=json