Skip to content

Commit 889b393

Browse files
committed
Rename API Server to WM Server
1 parent 83c4737 commit 889b393

47 files changed

Lines changed: 261 additions & 261 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/cli.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The `run` command supports two usage modes.
1515

1616
### Standalone (one-shot) — default
1717

18-
Each `run` invocation is fully independent. FineCode starts a dedicated API server subprocess for the duration of the command, then shuts it down on exit. This is the default behavior.
18+
Each `run` invocation is fully independent. FineCode starts a dedicated WM Server subprocess for the duration of the command, then shuts it down on exit. This is the default behavior.
1919

2020
```bash
2121
python -m finecode run lint
@@ -25,7 +25,7 @@ Use this in CI/CD pipelines or any context where you don't want persistent backg
2525

2626
### Persistent server
2727

28-
A long-lived API server holds warm state — loaded configuration, started runners — across multiple `run` calls. Use `--shared-server` to connect to a running shared instance instead of starting a dedicated one.
28+
A long-lived WM Server holds warm state — loaded configuration, started runners — across multiple `run` calls. Use `--shared-server` to connect to a running shared instance instead of starting a dedicated one.
2929

3030
```bash
3131
# Connect to the shared server (start it first if needed):
@@ -35,7 +35,7 @@ python -m finecode run --shared-server format
3535

3636
This mode is used automatically by the LSP and MCP integrations. It gives faster repeated runs because configuration loading and runner startup are amortized across calls.
3737

38-
The server waits 30 seconds after the last client disconnects before shutting down (configurable via `--disconnect-timeout` on `start-api-server`).
38+
The server waits 30 seconds after the last client disconnects before shutting down (configurable via `--disconnect-timeout` on `start-wm-server`).
3939

4040
---
4141

@@ -54,7 +54,7 @@ python -m finecode run [options] <action> [<action> ...] [payload] [--config.<ke
5454
| `--workdir=<path>` | Use `<path>` as the workspace root instead of `cwd` |
5555
| `--project=<name>` | Run only in this project. Repeatable for multiple projects. |
5656
| `--concurrently` | Run actions concurrently within each project |
57-
| `--shared-server` | Connect to the shared persistent API server instead of starting a dedicated one |
57+
| `--shared-server` | Connect to the shared persistent WM Server instead of starting a dedicated one |
5858
| `--trace` | Enable verbose (trace-level) logging |
5959
| `--no-env-config` | Ignore `FINECODE_CONFIG_*` environment variables |
6060
| `--no-save-results` | Do not write action results to the cache directory |
@@ -163,13 +163,13 @@ python -m finecode start-lsp --stdio | --socket <port> | --ws [--host <host>] [-
163163
| `--trace` | Enable verbose logging |
164164
| `--debug` | Wait for a debugpy client on port 5680 |
165165

166-
The LSP server connects to the **FineCode API server** on startup (starting one if needed). See [LSP and MCP Architecture](reference/lsp-mcp-architecture.md) for details.
166+
The LSP server connects to the **FineCode WM Server** on startup (starting one if needed). See [LSP and MCP Architecture](reference/lsp-mcp-architecture.md) for details.
167167

168168
---
169169

170170
## `start-mcp`
171171

172-
Start the FineCode MCP server on stdio. Connects to a running FineCode API server (or starts one) and exposes FineCode tools via the Model Context Protocol.
172+
Start the FineCode MCP server on stdio. Connects to a running FineCode WM Server (or starts one) and exposes FineCode tools via the Model Context Protocol.
173173

174174
```text
175175
.venvs/dev_workspace/bin/python -m finecode start-mcp [--workdir=<path>] [--trace]
@@ -184,12 +184,12 @@ Typically started automatically by MCP-compatible clients (for example, Claude C
184184

185185
---
186186

187-
## `start-api-server`
187+
## `start-wm-server`
188188

189-
Start the FineCode API server standalone (TCP JSON-RPC), listen for client connections. Shuts down after the last client disconnects and the disconnect timeout expires.
189+
Start the FineCode Workspace Manager Server standalone (TCP JSON-RPC), listen for client connections. Shuts down after the last client disconnects and the disconnect timeout expires.
190190

191191
```text
192-
python -m finecode start-api-server [--trace] [--disconnect-timeout=<seconds>]
192+
python -m finecode start-wm-server [--trace] [--disconnect-timeout=<seconds>]
193193
```
194194

195195
| Option | Description |

docs/development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The FineCode documentation is organized into the following sections:
2525

2626
### Developer Documentation
2727
- **Overview** (`development.md`): Contributing to FineCode core development
28-
- **API Protocol** (`api-protocol.md`): Technical protocol and endpoint reference
28+
- **WM Protocol** (`wm-protocol.md`): Technical protocol and endpoint reference
2929
- **Developing FineCode** (`guides/developing-finecode.md`): Monorepo workflows and conventions
3030

3131
### Potential Additions

docs/reference/lsp-mcp-architecture.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# LSP and MCP Architecture
22

3-
FineCode uses one shared API server for CLI, IDE (LSP), and AI-agent (MCP) clients.
3+
FineCode uses one shared Workspace Manager Server (WM Server) for CLI, IDE (LSP), and AI-agent (MCP) clients.
44

55
## Component model
66

77
```text
8-
FineCode API Server (TCP JSON-RPC, auto-managed)
8+
FineCode WM Server (TCP JSON-RPC, auto-managed)
99
├── WorkspaceContext, runners, services
1010
└── auto-stops when no clients remain
1111
1212
LSP Server (start-lsp, started by IDE)
13-
└── connects to API server (starts one if needed)
13+
└── connects to WM Server (starts one if needed)
1414
1515
MCP Server (start-mcp, started by MCP client)
16-
└── connects to API server (starts one if needed)
16+
└── connects to WM Server (starts one if needed)
1717
```
1818

19-
The API server writes its port to `.venvs/dev_workspace/cache/finecode/api_port` for client discovery.
19+
The WM Server writes its port to `.venvs/dev_workspace/cache/finecode/wm_port` for client discovery.
2020

2121
## LSP request flow
2222

@@ -41,9 +41,9 @@ The LSP layer translates protocol messages into FineCode actions, delegates exec
4141

4242
## Lifecycle behavior
4343

44-
- Any client (CLI, LSP, MCP) can start the API server if it is not already running.
45-
- Each connected client keeps the API server alive.
46-
- When the last client disconnects, the API server exits automatically.
44+
- Any client (CLI, LSP, MCP) can start the WM Server if it is not already running.
45+
- Each connected client keeps the WM Server alive.
46+
- When the last client disconnects, the WM Server exits automatically.
4747

4848
## Manual server startup for debugging
4949

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# FineCode API Server Protocol
1+
# FineCode WM Server Protocol
22

3-
The FineCode API server is a TCP JSON-RPC 2.0 service that manages the workspace state
3+
The FineCode Workspace Manager Server (WM Server) is a TCP JSON-RPC 2.0 service that manages the workspace state
44
(projects, configs, extension runners). Any client — LSP server, MCP server, or CLI — can
55
connect to it.
66

77
## Transport
88

99
- TCP on `127.0.0.1`, random free port
1010
- Content-Length framing (same as LSP): `Content-Length: N\r\n\r\n{json_body}`
11-
- Discovery: port written to `.venvs/dev_workspace/cache/finecode/api_port`
12-
- Auto-stops when the last client disconnects (after a 5s grace period) or if no client connects 30 seconds after start of API Server
11+
- Discovery: port written to `.venvs/dev_workspace/cache/finecode/wm_port`
12+
- Auto-stops when the last client disconnects (after a 5s grace period) or if no client connects 30 seconds after start of WM Server
1313

1414
## JSON-RPC 2.0
1515

@@ -89,7 +89,7 @@ list all projects and perform path comparisons itself.
8989
```
9090

9191
The server internally calls
92-
:func:`finecode.api_server.services.run_service.find_action_project` with
92+
:func:`finecode.wm_server.services.run_service.find_action_project` with
9393
``action_name="lint"`` and returns the corresponding project name.
9494

9595
---
@@ -102,7 +102,7 @@ and optionally starts extension runners.
102102
> **Design note:** Ideally, workspace directories would be a single shared
103103
> definition independent of which client connects (LSP, MCP, CLI). Currently,
104104
> each client calls `workspace/addDir` with its own working directory, so the
105-
> API server's workspace is the union of what clients have registered. This is a
105+
> WM Server's workspace is the union of what clients have registered. This is a
106106
> known simplification — a future improvement would introduce a workspace
107107
> configuration file or a dedicated workspace management layer so that the set
108108
> of directories is not environment-specific.
@@ -455,7 +455,7 @@ Supported `result_formats`: `"json"`, `"string"`, etc. (same as `actions/run`).
455455

456456
During execution, the server sends `actions/partialResult` notifications (see below).
457457

458-
> **Guarantee:** The API server always delivers results via `actions/partialResult`
458+
> **Guarantee:** The WM Server always delivers results via `actions/partialResult`
459459
> notifications, even when an extension runner does not stream incrementally (i.e.
460460
> it collects all results internally and returns them as a single final response).
461461
> In that case the server emits the final result as a partial result notification
@@ -485,7 +485,7 @@ Hot-reload handler code for an action without restarting runners.
485485

486486
### `documents/` — Document Sync
487487

488-
Notifications from the LSP client to keep the API server (and extension runners)
488+
Notifications from the LSP client to keep the WM Server (and extension runners)
489489
informed about open documents. These are fire-and-forget (no response).
490490

491491
#### `documents/opened`
@@ -645,7 +645,7 @@ environment, it is stopped first.
645645

646646
#### `server/shutdown`
647647

648-
Explicitly shut down the API server.
648+
Explicitly shut down the WM Server.
649649

650650
- **Type:** request
651651
- **Clients:** any
@@ -659,7 +659,7 @@ Explicitly shut down the API server.
659659

660660
### Server -> Client Notifications
661661

662-
These are sent by the API server to connected clients. Clients must implement
662+
These are sent by the WM Server to connected clients. Clients must implement
663663
a background reader to receive them.
664664

665665
#### `actions/partialResult`
@@ -692,7 +692,7 @@ but without `return_code`).
692692

693693
> **Note:** Notifications are delivered only to the client connection that
694694
> initiated the corresponding `actions/runWithPartialResults` request. The
695-
> API server does **not** broadcast these messages to every connected client.
695+
> WM Server does **not** broadcast these messages to every connected client.
696696
697697
---
698698

src/finecode/cli.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from finecode import logger_utils, user_messages
1313
from finecode.lsp_server import communication_utils
1414
from finecode.cli_app.commands import dump_config_cmd, prepare_envs_cmd, run_cmd
15-
from finecode.api_server.config.config_models import ConfigurationError
15+
from finecode.wm_server.config.config_models import ConfigurationError
1616

1717

1818
FINECODE_CONFIG_ENV_PREFIX = "FINECODE_CONFIG_"
@@ -461,7 +461,7 @@ def dump_config(trace: bool, debug: bool, project: str | None, shared_server: bo
461461
@click.option("--workdir", "workdir", default=None, type=str, help="Workspace root directory")
462462
@click.option("--trace", "trace", is_flag=True, default=False)
463463
def start_mcp(workdir: str | None, trace: bool):
464-
"""Start the FineCode MCP server (stdio). Connects to a running FineCode API server."""
464+
"""Start the FineCode MCP server (stdio). Connects to a running FineCode WM Server."""
465465
from finecode import mcp_server
466466

467467
logger_utils.init_logger(log_name="mcp_server", trace=trace, stdout=False)
@@ -487,13 +487,13 @@ def start_mcp(workdir: str | None, trace: bool):
487487
show_default=True,
488488
help="Seconds to wait after the last client disconnects before shutting down.",
489489
)
490-
def start_api_server(trace: bool, port_file: str | None, disconnect_timeout: int):
491-
"""Start the FineCode API server standalone (TCP JSON-RPC). Auto-stops when all clients disconnect."""
492-
from finecode.api_server import api_server
490+
def start_wm_server(trace: bool, port_file: str | None, disconnect_timeout: int):
491+
"""Start the FineCode WM Server standalone (TCP JSON-RPC). Auto-stops when all clients disconnect."""
492+
from finecode.wm_server import wm_server
493493

494-
logger_utils.init_logger(log_name="api_server", trace=trace, stdout=False)
494+
logger_utils.init_logger(log_name="wm_server", trace=trace, stdout=False)
495495
port_file_path = pathlib.Path(port_file) if port_file else None
496-
asyncio.run(api_server.start_standalone(port_file=port_file_path, disconnect_timeout=disconnect_timeout))
496+
asyncio.run(wm_server.start_standalone(port_file=port_file_path, disconnect_timeout=disconnect_timeout))
497497

498498

499499
if __name__ == "__main__":

src/finecode/cli_app/commands/dump_config_cmd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pathlib
22

3-
from finecode.api_client import ApiClient, ApiError
4-
from finecode.api_server import api_server
3+
from finecode.wm_client import ApiClient, ApiError
4+
from finecode.wm_server import wm_server
55

66

77
class DumpFailed(Exception):
@@ -15,15 +15,15 @@ async def dump_config(
1515
port_file = None
1616
try:
1717
if own_server:
18-
port_file = api_server.start_own_server(workdir_path)
18+
port_file = wm_server.start_own_server(workdir_path)
1919
try:
20-
port = await api_server.wait_until_ready_from_file(port_file)
20+
port = await wm_server.wait_until_ready_from_file(port_file)
2121
except TimeoutError as exc:
2222
raise DumpFailed(str(exc)) from exc
2323
else:
24-
api_server.ensure_running(workdir_path)
24+
wm_server.ensure_running(workdir_path)
2525
try:
26-
port = await api_server.wait_until_ready()
26+
port = await wm_server.wait_until_ready()
2727
except TimeoutError as exc:
2828
raise DumpFailed(str(exc)) from exc
2929

src/finecode/cli_app/commands/prepare_envs_cmd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from loguru import logger
44

5-
from finecode.api_client import ApiClient, ApiError
6-
from finecode.api_server import api_server
5+
from finecode.wm_client import ApiClient, ApiError
6+
from finecode.wm_server import wm_server
77

88

99
class PrepareEnvsFailed(Exception):
@@ -27,15 +27,15 @@ async def prepare_envs(
2727
port_file = None
2828
try:
2929
if own_server:
30-
port_file = api_server.start_own_server(workdir_path)
30+
port_file = wm_server.start_own_server(workdir_path)
3131
try:
32-
port = await api_server.wait_until_ready_from_file(port_file)
32+
port = await wm_server.wait_until_ready_from_file(port_file)
3333
except TimeoutError as exc:
3434
raise PrepareEnvsFailed(str(exc)) from exc
3535
else:
36-
api_server.ensure_running(workdir_path)
36+
wm_server.ensure_running(workdir_path)
3737
try:
38-
port = await api_server.wait_until_ready()
38+
port = await wm_server.wait_until_ready()
3939
except TimeoutError as exc:
4040
raise PrepareEnvsFailed(str(exc)) from exc
4141

src/finecode/cli_app/commands/run_cmd.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
import click
77

8-
from finecode.api_client import ApiClient, ApiError
9-
from finecode.api_server import api_server
10-
from finecode.api_server.runner import runner_client
8+
from finecode.wm_client import ApiClient, ApiError
9+
from finecode.wm_server import wm_server
10+
from finecode.wm_server.runner import runner_client
1111
from finecode.cli_app import utils
1212

1313

@@ -30,15 +30,15 @@ async def run_actions(
3030
port_file = None
3131
try:
3232
if own_server:
33-
port_file = api_server.start_own_server(workdir_path)
33+
port_file = wm_server.start_own_server(workdir_path)
3434
try:
35-
port = await api_server.wait_until_ready_from_file(port_file)
35+
port = await wm_server.wait_until_ready_from_file(port_file)
3636
except TimeoutError as exc:
3737
raise RunFailed(str(exc)) from exc
3838
else:
39-
api_server.ensure_running(workdir_path)
39+
wm_server.ensure_running(workdir_path)
4040
try:
41-
port = await api_server.wait_until_ready()
41+
port = await wm_server.wait_until_ready()
4242
except TimeoutError as exc:
4343
raise RunFailed(str(exc)) from exc
4444

src/finecode/cli_app/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import click
55

6-
from finecode.api_server import context
7-
from finecode.api_server.runner import runner_client
8-
from finecode.api_server.services import run_service
6+
from finecode.wm_server import context
7+
from finecode.wm_server.runner import runner_client
8+
from finecode.wm_server.services import run_service
99

1010

1111
class RunActionsResult(typing.NamedTuple):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""
2-
- all LSP handlers must wait on API Server start (e.g. `await global_state.server_initialized.wait()`)
2+
- all LSP handlers must wait on WM server start (e.g. `await global_state.server_initialized.wait()`)
33
"""

0 commit comments

Comments
 (0)