build: rename server runtime binaries

This commit is contained in:
Keisuke Hirata 2026-07-29 19:36:05 +09:00
parent 699290ccb1
commit fb285b17e4
No known key found for this signature in database
16 changed files with 90 additions and 84 deletions

View File

@ -7,7 +7,7 @@ license.workspace = true
autobins = false autobins = false
[[bin]] [[bin]]
name = "worker-runtime-rest-server" name = "yoi-runtime"
path = "src/main.rs" path = "src/main.rs"
required-features = ["ws-server", "fs-store"] required-features = ["ws-server", "fs-store"]

View File

@ -9,7 +9,7 @@ From the repository root:
```bash ```bash
cargo run -p worker-runtime \ cargo run -p worker-runtime \
--features ws-server,fs-store \ --features ws-server,fs-store \
--bin worker-runtime-rest-server \ --bin yoi-runtime \
-- --bind 127.0.0.1:38800 -- --bind 127.0.0.1:38800
``` ```
@ -24,7 +24,7 @@ To bind another address explicitly:
```bash ```bash
cargo run -p worker-runtime \ cargo run -p worker-runtime \
--features ws-server,fs-store \ --features ws-server,fs-store \
--bin worker-runtime-rest-server \ --bin yoi-runtime \
-- --bind 0.0.0.0:38800 -- --bind 0.0.0.0:38800
``` ```

View File

@ -30,7 +30,7 @@ fn main() -> ExitCode {
match run() { match run() {
Ok(()) => ExitCode::SUCCESS, Ok(()) => ExitCode::SUCCESS,
Err(error) => { Err(error) => {
eprintln!("worker-runtime-rest-server: {error}"); eprintln!("yoi-runtime: {error}");
if let ProcessError::Usage(_) = error { if let ProcessError::Usage(_) = error {
eprintln!(); eprintln!();
eprintln!("{}", usage()); eprintln!("{}", usage());
@ -64,7 +64,7 @@ fn run() -> Result<(), ProcessError> {
let local_addr = listener.local_addr()?; let local_addr = listener.local_addr()?;
let worker_runtime = build_runtime(&config)?; let worker_runtime = build_runtime(&config)?;
eprintln!( eprintln!(
"worker-runtime REST server listening on {local_addr}; intended client is a trusted backend/proxy, not a browser" "yoi-runtime listening on {local_addr}; intended client is a trusted backend/proxy, not a browser"
); );
worker_runtime::http_server::serve_runtime_http_with_auth( worker_runtime::http_server::serve_runtime_http_with_auth(
worker_runtime, worker_runtime,
@ -796,7 +796,7 @@ fn run_trust_server_command(mut args: VecDeque<String>) -> Result<(), ProcessErr
} }
fn usage() -> &'static str { fn usage() -> &'static str {
r#"Usage: worker-runtime-rest-server [OPTIONS] r#"Usage: yoi-runtime [OPTIONS]
Starts a worker-backed Runtime REST command API for a trusted backend/proxy. Starts a worker-backed Runtime REST command API for a trusted backend/proxy.
Browsers must not connect to this Runtime process directly. Browsers must not connect to this Runtime process directly.

View File

@ -4,6 +4,11 @@ version = "0.1.0"
edition.workspace = true edition.workspace = true
license.workspace = true license.workspace = true
publish = false publish = false
autobins = false
[[bin]]
name = "yoi-server"
path = "src/main.rs"
[dependencies] [dependencies]
async-trait.workspace = true async-trait.workspace = true

View File

@ -306,7 +306,7 @@ impl WorkspaceBackendConfigFile {
match fs::read_to_string(&path) { match fs::read_to_string(&path) {
Ok(local) => Ok(ConfigDiff::new(WORKSPACE_BACKEND_CONFIG_TEMPLATE, &local)), Ok(local) => Ok(ConfigDiff::new(WORKSPACE_BACKEND_CONFIG_TEMPLATE, &local)),
Err(error) if error.kind() == io::ErrorKind::NotFound => Err(Error::Config(format!( Err(error) if error.kind() == io::ErrorKind::NotFound => Err(Error::Config(format!(
"workspace backend local config `{}` does not exist; run `yoi-workspace-server init --workspace {}` first", "workspace backend local config `{}` does not exist; run `yoi-server init --workspace {}` first",
path.display(), path.display(),
workspace_root.display() workspace_root.display()
))), ))),

View File

@ -46,7 +46,7 @@ impl WorkspaceIdentity {
Ok(raw) => Self::parse_str(&raw, &path), Ok(raw) => Self::parse_str(&raw, &path),
Err(error) if error.kind() == ErrorKind::NotFound => { Err(error) if error.kind() == ErrorKind::NotFound => {
Err(Error::WorkspaceIdentity(format!( Err(Error::WorkspaceIdentity(format!(
"workspace is not initialized at {}; run `yoi-workspace-server init --workspace {}` first", "workspace is not initialized at {}; run `yoi-server init --workspace {}` first",
workspace_root.as_ref().display(), workspace_root.as_ref().display(),
workspace_root.as_ref().display() workspace_root.as_ref().display()
))) )))

View File

@ -65,7 +65,7 @@ async fn main() -> ExitCode {
match run().await { match run().await {
Ok(()) => ExitCode::SUCCESS, Ok(()) => ExitCode::SUCCESS,
Err(error) => { Err(error) => {
eprintln!("yoi-workspace-server: {error}"); eprintln!("yoi-server: {error}");
ExitCode::FAILURE ExitCode::FAILURE
} }
} }
@ -160,7 +160,7 @@ async fn run_init_with_database_path(
})?; })?;
eprintln!( eprintln!(
"yoi-workspace-server: initialized workspace `{}` ({}) in server DB `{}`", "yoi-server: initialized workspace `{}` ({}) in server DB `{}`",
options.workspace.display(), options.workspace.display(),
identity.workspace_id, identity.workspace_id,
database_path.display() database_path.display()
@ -572,7 +572,7 @@ async fn run_serve(options: ServeOptions) -> Result<(), Box<dyn std::error::Erro
let listener = TcpListener::bind(resolved.listen).await?; let listener = TcpListener::bind(resolved.listen).await?;
eprintln!( eprintln!(
"yoi-workspace-server: serving workspace `{}` from server DB `{}` on http://{}", "yoi-server: serving workspace `{}` from server DB `{}` on http://{}",
workspace.workspace_id, workspace.workspace_id,
database_path.display(), database_path.display(),
listener.local_addr()? listener.local_addr()?
@ -588,7 +588,7 @@ fn append_trusted_runtime_sources(
let Some(server_identity) = read_server_identity_file(&server_identity_path())? else { let Some(server_identity) = read_server_identity_file(&server_identity_path())? else {
if !store.list_trusted_runtimes(false)?.is_empty() { if !store.list_trusted_runtimes(false)?.is_empty() {
return Err(Box::new(CliError( return Err(Box::new(CliError(
"trusted runtimes are registered but server identity is not initialized; run `yoi-workspace-server identity init`".to_string(), "trusted runtimes are registered but server identity is not initialized; run `yoi-server identity init`".to_string(),
))); )));
} }
return Ok(()); return Ok(());
@ -617,7 +617,8 @@ fn select_serve_workspace(store: &SqliteWorkspaceStore) -> Result<WorkspaceRecor
.map_err(|error| CliError(format!("failed to list workspaces from server DB: {error}")))?; .map_err(|error| CliError(format!("failed to list workspaces from server DB: {error}")))?;
match workspaces.as_slice() { match workspaces.as_slice() {
[] => Err(CliError( [] => Err(CliError(
"server DB has no workspace records; run `yoi-workspace-server init --workspace <PATH>`".to_string(), "server DB has no workspace records; run `yoi-server init --workspace <PATH>`"
.to_string(),
)), )),
[workspace] => Ok(workspace.clone()), [workspace] => Ok(workspace.clone()),
_ => Err(CliError(format!( _ => Err(CliError(format!(
@ -825,31 +826,31 @@ fn parse_listen(value: &str) -> Result<SocketAddr, CliError> {
fn print_help() { fn print_help() {
println!( println!(
"yoi-workspace-server\n\nUsage:\n yoi-workspace-server init [OPTIONS]\n yoi-workspace-server config <COMMAND> [OPTIONS]\n yoi-workspace-server identity init --server-id <SERVER_ID> [--replace]\n yoi-workspace-server identity show [--json]\n yoi-workspace-server trust-runtime add --runtime-id <RUNTIME_ID> --base-url <URL> --public-key <KEY> [--display-name <NAME>] [--replace]\n yoi-workspace-server trust-runtime list [--json] [--include-revoked]\n yoi-workspace-server trust-runtime revoke --runtime-id <RUNTIME_ID>\n yoi-workspace-server skills <COMMAND> [OPTIONS]\n yoi-workspace-server serve [OPTIONS]\n\nOptions:\n -h, --help Print help" "yoi-server\n\nUsage:\n yoi-server init [OPTIONS]\n yoi-server config <COMMAND> [OPTIONS]\n yoi-server identity init --server-id <SERVER_ID> [--replace]\n yoi-server identity show [--json]\n yoi-server trust-runtime add --runtime-id <RUNTIME_ID> --base-url <URL> --public-key <KEY> [--display-name <NAME>] [--replace]\n yoi-server trust-runtime list [--json] [--include-revoked]\n yoi-server trust-runtime revoke --runtime-id <RUNTIME_ID>\n yoi-server skills <COMMAND> [OPTIONS]\n yoi-server serve [OPTIONS]\n\nOptions:\n -h, --help Print help"
); );
} }
fn print_init_help() { fn print_init_help() {
println!( println!(
"yoi-workspace-server init\n\nUsage:\n yoi-workspace-server init [OPTIONS]\n\nDescription:\n Initializes a Workspace identity, copies the packaged Backend config template to .yoi/workspace-backend.local.toml, and registers the Workspace in the Yoi server DB.\n\nOptions:\n --workspace <PATH> Workspace root to initialize (defaults to cwd)\n -h, --help Print help" "yoi-server init\n\nUsage:\n yoi-server init [OPTIONS]\n\nDescription:\n Initializes a Workspace identity, copies the packaged Backend config template to .yoi/workspace-backend.local.toml, and registers the Workspace in the Yoi server DB.\n\nOptions:\n --workspace <PATH> Workspace root to initialize (defaults to cwd)\n -h, --help Print help"
); );
} }
fn print_config_help() { fn print_config_help() {
println!( println!(
"yoi-workspace-server config\n\nUsage:\n yoi-workspace-server config default\n yoi-workspace-server config diff [OPTIONS]\n\nDescription:\n Prints the packaged Workspace Backend config template or compares it with the workspace-local config.\n\nOptions for diff:\n --workspace <PATH> Workspace root (defaults to cwd)\n -h, --help Print help" "yoi-server config\n\nUsage:\n yoi-server config default\n yoi-server config diff [OPTIONS]\n\nDescription:\n Prints the packaged Workspace Backend config template or compares it with the workspace-local config.\n\nOptions for diff:\n --workspace <PATH> Workspace root (defaults to cwd)\n -h, --help Print help"
); );
} }
fn print_skills_help() { fn print_skills_help() {
println!( println!(
"yoi-workspace-server skills\n\nUsage:\n yoi-workspace-server skills list [OPTIONS]\n yoi-workspace-server skills lint [OPTIONS]\n yoi-workspace-server skills show <NAME> [OPTIONS]\n\nDescription:\n Uses the Workspace backend Skill catalog/lint/detail authority. Catalog output is lightweight and omits full SKILL.md bodies; detail output includes the body. allowed-tools and scripts are diagnostics only.\n\nOptions:\n --workspace <PATH> Workspace root (defaults to cwd)\n -h, --help Print help" "yoi-server skills\n\nUsage:\n yoi-server skills list [OPTIONS]\n yoi-server skills lint [OPTIONS]\n yoi-server skills show <NAME> [OPTIONS]\n\nDescription:\n Uses the Workspace backend Skill catalog/lint/detail authority. Catalog output is lightweight and omits full SKILL.md bodies; detail output includes the body. allowed-tools and scripts are diagnostics only.\n\nOptions:\n --workspace <PATH> Workspace root (defaults to cwd)\n -h, --help Print help"
); );
} }
fn print_serve_help() { fn print_serve_help() {
println!( println!(
"yoi-workspace-server serve\n\nUsage:\n yoi-workspace-server serve [OPTIONS]\n\nDescription:\n Serves the Workspace recorded in the Yoi server DB. Workspace records are stored in the XDG/Yoi data directory, and runtime sources are loaded from XDG runtimes.toml.\n\nOptions:\n --listen <ADDR> Listen address (default 127.0.0.1:8787)\n -h, --help Print help" "yoi-server serve\n\nUsage:\n yoi-server serve [OPTIONS]\n\nDescription:\n Serves the Workspace recorded in the Yoi server DB. Workspace records are stored in the XDG/Yoi data directory, and runtime sources are loaded from XDG runtimes.toml.\n\nOptions:\n --listen <ADDR> Listen address (default 127.0.0.1:8787)\n -h, --help Print help"
); );
} }

View File

@ -1671,8 +1671,8 @@ Backend-only commands:
login Run Backend device login and save the API token login Run Backend device login and save the API token
Standalone binaries: Standalone binaries:
yoi-workspace-server Workspace Backend server/admin CLI yoi-server Workspace Backend server/admin CLI
worker-runtime-rest-server Worker Runtime REST server yoi-runtime Worker Runtime REST server
Options: Options:
-h, --help Print help -h, --help Print help
@ -1826,8 +1826,8 @@ backend = "shared"
assert!(TOP_LEVEL_HELP.contains("--backend <URL>")); assert!(TOP_LEVEL_HELP.contains("--backend <URL>"));
assert!(TOP_LEVEL_HELP.contains("<data_dir>/client/config.toml")); assert!(TOP_LEVEL_HELP.contains("<data_dir>/client/config.toml"));
assert!(TOP_LEVEL_HELP.contains("<cwd>/.yoi/client.config.toml")); assert!(TOP_LEVEL_HELP.contains("<cwd>/.yoi/client.config.toml"));
assert!(TOP_LEVEL_HELP.contains("yoi-workspace-server")); assert!(TOP_LEVEL_HELP.contains("yoi-server"));
assert!(TOP_LEVEL_HELP.contains("worker-runtime-rest-server")); assert!(TOP_LEVEL_HELP.contains("yoi-runtime"));
assert!(!TOP_LEVEL_HELP.contains("yoi workspace")); assert!(!TOP_LEVEL_HELP.contains("yoi workspace"));
assert!(!TOP_LEVEL_HELP.contains("yoi server")); assert!(!TOP_LEVEL_HELP.contains("yoi server"));
assert!(!TOP_LEVEL_HELP.contains("TARGET_OPTIONS")); assert!(!TOP_LEVEL_HELP.contains("TARGET_OPTIONS"));

View File

@ -231,7 +231,7 @@ in
tag = imageTag; tag = imageTag;
copyToRoot = runtimeRoot; copyToRoot = runtimeRoot;
config = { config = {
Entrypoint = [ "/bin/worker-runtime-rest-server" ]; Entrypoint = [ "/bin/yoi-runtime" ];
Cmd = [ Cmd = [
"--bind" "--bind"
"0.0.0.0:38800" "0.0.0.0:38800"
@ -259,7 +259,7 @@ in
tag = imageTag; tag = imageTag;
copyToRoot = serverRoot; copyToRoot = serverRoot;
config = { config = {
Entrypoint = [ "/bin/yoi-workspace-server" ]; Entrypoint = [ "/bin/yoi-server" ];
Cmd = [ Cmd = [
"serve" "serve"
"--listen" "--listen"

View File

@ -32,10 +32,10 @@ Current image roles:
```text ```text
yoi-runtime:latest yoi-runtime:latest
worker-runtime-rest-server yoi-runtime
yoi-server:latest yoi-server:latest
yoi-workspace-server yoi-server
yoi-webui:latest yoi-webui:latest
nginx serving built WebUI assets and proxying API requests nginx serving built WebUI assets and proxying API requests
@ -62,7 +62,7 @@ docker/workspace/.yoi/workspace.toml
docker/workspace/.yoi/workspace-backend.local.toml docker/workspace/.yoi/workspace-backend.local.toml
``` ```
The WebUI container serves static assets and proxies `/api` to the Backend Server. The Backend Server registers the Runtime container as a remote Runtime such as `docker-runtime`. The Runtime container runs `worker-runtime-rest-server` and owns Worker spawning/materialization for that runtime. The WebUI container serves static assets and proxies `/api` to the Backend Server. The Backend Server registers the Runtime container as a remote Runtime such as `docker-runtime`. The Runtime container runs `yoi-runtime` and owns Worker spawning/materialization for that runtime.
Container user and writable data directories matter: runtime/server images must be able to write their configured data directories and named volumes. The current local-image Compose setup avoids an image-level `User` override and sets data-directory permissions accordingly. Container user and writable data directories matter: runtime/server images must be able to write their configured data directories and named volumes. The current local-image Compose setup avoids an image-level `User` override and sets data-directory permissions accordingly.

View File

@ -28,13 +28,13 @@ RUNTIME_BASE_URL=http://127.0.0.1:38800
From the Workspace Server host: From the Workspace Server host:
```bash ```bash
yoi-workspace-server identity init --server-id server-main yoi-server identity init --server-id server-main
``` ```
Show the public identity and copy the `public_key` value: Show the public identity and copy the `public_key` value:
```bash ```bash
yoi-workspace-server identity show --json yoi-server identity show --json
``` ```
The Server private identity is stored in the Yoi data directory under the Server data root, currently: The Server private identity is stored in the Yoi data directory under the Server data root, currently:
@ -50,13 +50,13 @@ On Unix this file is written with `0600` permissions. Do not copy the private ke
From the Runtime host, using the same Runtime storage flags that the Runtime server process will use: From the Runtime host, using the same Runtime storage flags that the Runtime server process will use:
```bash ```bash
worker-runtime-rest-server identity init --runtime-id runtime-main yoi-runtime identity init --runtime-id runtime-main
``` ```
Show the public identity and copy the `public_key` value: Show the public identity and copy the `public_key` value:
```bash ```bash
worker-runtime-rest-server identity show --json yoi-runtime identity show --json
``` ```
By default, Runtime auth state is stored at: By default, Runtime auth state is stored at:
@ -70,21 +70,21 @@ If the Runtime process is launched with `--fs-root` or `--fs-runtime-dir`, pass
Example with explicit Runtime storage: Example with explicit Runtime storage:
```bash ```bash
worker-runtime-rest-server identity init \ yoi-runtime identity init \
--runtime-id runtime-main \ --runtime-id runtime-main \
--fs-root /var/lib/yoi-runtime --fs-root /var/lib/yoi-runtime
worker-runtime-rest-server identity show \ yoi-runtime identity show \
--json \ --json \
--fs-root /var/lib/yoi-runtime --fs-root /var/lib/yoi-runtime
``` ```
## 3. Register the Server public key on Runtime ## 3. Register the Server public key on Runtime
On the Runtime host, register the Server public key copied from `yoi-workspace-server identity show --json`: On the Runtime host, register the Server public key copied from `yoi-server identity show --json`:
```bash ```bash
worker-runtime-rest-server trust-server add \ yoi-runtime trust-server add \
--server-id server-main \ --server-id server-main \
--public-key '<SERVER_PUBLIC_KEY>' --public-key '<SERVER_PUBLIC_KEY>'
``` ```
@ -92,7 +92,7 @@ worker-runtime-rest-server trust-server add \
With explicit Runtime storage, keep using the same storage flags: With explicit Runtime storage, keep using the same storage flags:
```bash ```bash
worker-runtime-rest-server trust-server add \ yoi-runtime trust-server add \
--server-id server-main \ --server-id server-main \
--public-key '<SERVER_PUBLIC_KEY>' \ --public-key '<SERVER_PUBLIC_KEY>' \
--fs-root /var/lib/yoi-runtime --fs-root /var/lib/yoi-runtime
@ -101,27 +101,27 @@ worker-runtime-rest-server trust-server add \
Verify: Verify:
```bash ```bash
worker-runtime-rest-server trust-server list --json yoi-runtime trust-server list --json
``` ```
## 4. Register the Runtime public key and endpoint on Server ## 4. Register the Runtime public key and endpoint on Server
On the Workspace Server host, register the Runtime public key copied from `worker-runtime-rest-server identity show --json`: On the Workspace Server host, register the Runtime public key copied from `yoi-runtime identity show --json`:
```bash ```bash
yoi-workspace-server trust-runtime add \ yoi-server trust-runtime add \
--runtime-id runtime-main \ --runtime-id runtime-main \
--base-url http://127.0.0.1:38800 \ --base-url http://127.0.0.1:38800 \
--public-key '<RUNTIME_PUBLIC_KEY>' \ --public-key '<RUNTIME_PUBLIC_KEY>' \
--display-name 'Runtime main' --display-name 'Runtime main'
``` ```
This writes a trusted Runtime record to the Server DB. During `yoi-workspace-server serve`, active trusted Runtime records are loaded as remote Runtime sources and receive signed capability tokens. You do not need to duplicate the same Runtime in `runtimes.toml` for this trust-backed path. This writes a trusted Runtime record to the Server DB. During `yoi-server serve`, active trusted Runtime records are loaded as remote Runtime sources and receive signed capability tokens. You do not need to duplicate the same Runtime in `runtimes.toml` for this trust-backed path.
Verify: Verify:
```bash ```bash
yoi-workspace-server trust-runtime list --json yoi-server trust-runtime list --json
``` ```
## 5. Start Runtime and Workspace Server ## 5. Start Runtime and Workspace Server
@ -129,7 +129,7 @@ yoi-workspace-server trust-runtime list --json
Start Runtime with the same storage flags used during Runtime identity/trust setup: Start Runtime with the same storage flags used during Runtime identity/trust setup:
```bash ```bash
worker-runtime-rest-server \ yoi-runtime \
--bind 127.0.0.1:38800 --bind 127.0.0.1:38800
``` ```
@ -138,26 +138,26 @@ For repository builds, the equivalent cargo command is:
```bash ```bash
cargo run -p worker-runtime \ cargo run -p worker-runtime \
--features ws-server,fs-store \ --features ws-server,fs-store \
--bin worker-runtime-rest-server \ --bin yoi-runtime \
-- --bind 127.0.0.1:38800 -- --bind 127.0.0.1:38800
``` ```
Start Workspace Server: Start Workspace Server:
```bash ```bash
yoi-workspace-server serve --listen 127.0.0.1:8787 yoi-server serve --listen 127.0.0.1:8787
``` ```
For repository builds: For repository builds:
```bash ```bash
cargo run -p yoi-workspace-server -- serve --listen 127.0.0.1:8787 cargo run -p yoi-workspace-server --bin yoi-server -- serve --listen 127.0.0.1:8787
``` ```
If the Server DB has no workspace record yet, initialize it first: If the Server DB has no workspace record yet, initialize it first:
```bash ```bash
yoi-workspace-server init --workspace <WORKSPACE_ROOT> yoi-server init --workspace <WORKSPACE_ROOT>
``` ```
## Smoke checks ## Smoke checks
@ -165,8 +165,8 @@ yoi-workspace-server init --workspace <WORKSPACE_ROOT>
Check both trust stores: Check both trust stores:
```bash ```bash
yoi-workspace-server trust-runtime list --json yoi-server trust-runtime list --json
worker-runtime-rest-server trust-server list --json yoi-runtime trust-server list --json
``` ```
Check that Workspace Server can see Runtime workers through the authenticated path. From the CLI: Check that Workspace Server can see Runtime workers through the authenticated path. From the CLI:
@ -186,13 +186,13 @@ Identity and trust records are intentionally not overwritten by default.
Rotate Server identity: Rotate Server identity:
```bash ```bash
yoi-workspace-server identity init --server-id server-main --replace yoi-server identity init --server-id server-main --replace
``` ```
After Server identity rotation, every Runtime that trusts that Server must be updated with the new Server public key: After Server identity rotation, every Runtime that trusts that Server must be updated with the new Server public key:
```bash ```bash
worker-runtime-rest-server trust-server add \ yoi-runtime trust-server add \
--server-id server-main \ --server-id server-main \
--public-key '<NEW_SERVER_PUBLIC_KEY>' \ --public-key '<NEW_SERVER_PUBLIC_KEY>' \
--replace --replace
@ -201,13 +201,13 @@ worker-runtime-rest-server trust-server add \
Rotate Runtime identity: Rotate Runtime identity:
```bash ```bash
worker-runtime-rest-server identity init --runtime-id runtime-main --replace yoi-runtime identity init --runtime-id runtime-main --replace
``` ```
After Runtime identity rotation, Server must be updated with the new Runtime public key: After Runtime identity rotation, Server must be updated with the new Runtime public key:
```bash ```bash
yoi-workspace-server trust-runtime add \ yoi-server trust-runtime add \
--runtime-id runtime-main \ --runtime-id runtime-main \
--base-url http://127.0.0.1:38800 \ --base-url http://127.0.0.1:38800 \
--public-key '<NEW_RUNTIME_PUBLIC_KEY>' \ --public-key '<NEW_RUNTIME_PUBLIC_KEY>' \
@ -219,13 +219,13 @@ yoi-workspace-server trust-runtime add \
Revoke a trusted Runtime on Server: Revoke a trusted Runtime on Server:
```bash ```bash
yoi-workspace-server trust-runtime revoke --runtime-id runtime-main yoi-server trust-runtime revoke --runtime-id runtime-main
``` ```
Remove a trusted Server from Runtime: Remove a trusted Server from Runtime:
```bash ```bash
worker-runtime-rest-server trust-server revoke --server-id server-main yoi-runtime trust-server revoke --server-id server-main
``` ```
## Troubleshooting ## Troubleshooting
@ -235,7 +235,7 @@ worker-runtime-rest-server trust-server revoke --server-id server-main
The Server DB contains trusted Runtime records, but the Server signing identity file does not exist. Run: The Server DB contains trusted Runtime records, but the Server signing identity file does not exist. Run:
```bash ```bash
yoi-workspace-server identity init --server-id server-main yoi-server identity init --server-id server-main
``` ```
If the identity was created in another environment, ensure the Server process is using the same Yoi data directory. If the identity was created in another environment, ensure the Server process is using the same Yoi data directory.
@ -245,8 +245,8 @@ If the identity was created in another environment, ensure the Server process is
Runtime only enables signed capability-token auth when both a Runtime identity and at least one trusted Server are present in its auth file. Check: Runtime only enables signed capability-token auth when both a Runtime identity and at least one trusted Server are present in its auth file. Check:
```bash ```bash
worker-runtime-rest-server identity show --json yoi-runtime identity show --json
worker-runtime-rest-server trust-server list --json yoi-runtime trust-server list --json
``` ```
Also confirm the Runtime process was started with the same `--fs-root` / `--fs-runtime-dir` used for setup. Also confirm the Runtime process was started with the same `--fs-root` / `--fs-runtime-dir` used for setup.
@ -256,8 +256,8 @@ Also confirm the Runtime process was started with the same `--fs-root` / `--fs-r
Confirm the `--runtime-id` registered on Server exactly matches the Runtime identity id: Confirm the `--runtime-id` registered on Server exactly matches the Runtime identity id:
```bash ```bash
worker-runtime-rest-server identity show --json yoi-runtime identity show --json
yoi-workspace-server trust-runtime list --json yoi-server trust-runtime list --json
``` ```
`RUNTIME_ID` is the token audience; mismatches are rejected by Runtime. `RUNTIME_ID` is the token audience; mismatches are rejected by Runtime.

View File

@ -43,7 +43,7 @@ rustPlatform.buildRustPackage rec {
filter = sourceFilter; filter = sourceFilter;
}; };
cargoHash = "sha256-iZaTREhL/aLixn67A1+Gi9opqh2j/yyFuGMyBBvuATM="; cargoHash = "sha256-R33Ty4414wGkqnwCt08zbDQbVu9ggMC5I3ZawgloNT0=";
depsExtraArgs = { depsExtraArgs = {
# Older fetchCargoVendor utilities used crates.io's API download endpoint, # Older fetchCargoVendor utilities used crates.io's API download endpoint,
@ -92,8 +92,8 @@ rustPlatform.buildRustPackage rec {
]; ];
postBuild = '' postBuild = ''
cargo build --offline --profile release -p yoi-workspace-server --bin yoi-workspace-server cargo build --offline --profile release -p yoi-workspace-server --bin yoi-server
cargo build --offline --profile release -p worker-runtime --bin worker-runtime-rest-server --features ws-server,fs-store cargo build --offline --profile release -p worker-runtime --bin yoi-runtime --features ws-server,fs-store
''; '';
# The package check is a credential-free install smoke check below. Running the # The package check is a credential-free install smoke check below. Running the
@ -105,16 +105,16 @@ rustPlatform.buildRustPackage rec {
runHook preInstall runHook preInstall
yoi_bin=$(find . -type f -name yoi | head -n 1) yoi_bin=$(find . -type f -name yoi | head -n 1)
workspace_server_bin=$(find . -type f -name yoi-workspace-server | head -n 1) workspace_server_bin=$(find . -type f -name yoi-server | head -n 1)
worker_runtime_bin=$(find . -type f -name worker-runtime-rest-server | head -n 1) worker_runtime_bin=$(find . -type f -name yoi-runtime | head -n 1)
if [ -z "$yoi_bin" ] || [ -z "$workspace_server_bin" ] || [ -z "$worker_runtime_bin" ]; then if [ -z "$yoi_bin" ] || [ -z "$workspace_server_bin" ] || [ -z "$worker_runtime_bin" ]; then
echo "built binaries not found" >&2 echo "built binaries not found" >&2
find . -maxdepth 6 -type f \( -name yoi -o -name yoi-workspace-server -o -name worker-runtime-rest-server \) -print >&2 find . -maxdepth 6 -type f \( -name yoi -o -name yoi-server -o -name yoi-runtime \) -print >&2
exit 1 exit 1
fi fi
install -Dm755 "$yoi_bin" "$out/bin/yoi" install -Dm755 "$yoi_bin" "$out/bin/yoi"
install -Dm755 "$workspace_server_bin" "$out/bin/yoi-workspace-server" install -Dm755 "$workspace_server_bin" "$out/bin/yoi-server"
install -Dm755 "$worker_runtime_bin" "$out/bin/worker-runtime-rest-server" install -Dm755 "$worker_runtime_bin" "$out/bin/yoi-runtime"
runHook postInstall runHook postInstall
''; '';
@ -125,10 +125,10 @@ rustPlatform.buildRustPackage rec {
"$out/bin/yoi" worker --help >/dev/null "$out/bin/yoi" worker --help >/dev/null
test -x "$out/bin/yoi" test -x "$out/bin/yoi"
test -x "$out/bin/yoi-workspace-server" test -x "$out/bin/yoi-server"
test -x "$out/bin/worker-runtime-rest-server" test -x "$out/bin/yoi-runtime"
"$out/bin/yoi-workspace-server" --help >/dev/null "$out/bin/yoi-server" --help >/dev/null
"$out/bin/worker-runtime-rest-server" --help >/dev/null "$out/bin/yoi-runtime" --help >/dev/null
test ! -e "$out/bin/yoi-pod" test ! -e "$out/bin/yoi-pod"
test ! -e "$out/share/yoi/resources" test ! -e "$out/share/yoi/resources"
if "$out/bin/yoi" --session not-a-uuid 2>yoi.err; then if "$out/bin/yoi" --session not-a-uuid 2>yoi.err; then

View File

@ -1,14 +1,14 @@
# Workspace Backend local config template. # Workspace Backend local config template.
# #
# `yoi-workspace-server init` copies this packaged template to # `yoi-server init` copies this packaged template to
# `.yoi/workspace-backend.local.toml` without overwriting an existing file. # `.yoi/workspace-backend.local.toml` without overwriting an existing file.
# The `.local` file is intentionally git-ignored. # The `.local` file is intentionally git-ignored.
# #
# Print the latest packaged template with: # Print the latest packaged template with:
# yoi-workspace-server config default # yoi-server config default
# #
# Compare the local config with the latest packaged template with: # Compare the local config with the latest packaged template with:
# yoi-workspace-server config diff # yoi-server config diff
# #
# Omit a key to use the built-in fallback. TOML has no `null`, so optional # Omit a key to use the built-in fallback. TOML has no `null`, so optional
# settings are represented by leaving the key commented out. # settings are represented by leaving the key commented out.

View File

@ -57,8 +57,8 @@ usage() {
Usage: $(basename "$0") <start|stop|restart|status> Usage: $(basename "$0") <start|stop|restart|status>
Manage the local Yoi development stack for this checkout: Manage the local Yoi development stack for this checkout:
runtime target/debug/worker-runtime-rest-server --bind $RUNTIME_BIND runtime target/debug/yoi-runtime --bind $RUNTIME_BIND
backend target/debug/yoi-workspace-server serve --listen $BACKEND_LISTEN backend target/debug/yoi-server serve --listen $BACKEND_LISTEN
frontend deno run -A npm:vite@7.2.7 dev --host $FRONTEND_HOST --port $FRONTEND_PORT (cwd: web/workspace) frontend deno run -A npm:vite@7.2.7 dev --host $FRONTEND_HOST --port $FRONTEND_PORT (cwd: web/workspace)
Actions: Actions:
@ -307,7 +307,7 @@ build_runtime_backend() {
log "building runtime binary" log "building runtime binary"
( (
cd "$ROOT_DIR" cd "$ROOT_DIR"
run_cargo build -p worker-runtime --features ws-server,fs-store --bin worker-runtime-rest-server run_cargo build -p worker-runtime --features ws-server,fs-store --bin yoi-runtime
) )
else else
log "runtime disabled by YOI_DEV_RUNTIME_ENABLED=0; skipping runtime build" log "runtime disabled by YOI_DEV_RUNTIME_ENABLED=0; skipping runtime build"
@ -316,7 +316,7 @@ build_runtime_backend() {
log "building backend binary" log "building backend binary"
( (
cd "$ROOT_DIR" cd "$ROOT_DIR"
run_cargo build -p yoi-workspace-server --bin yoi-workspace-server run_cargo build -p yoi-workspace-server --bin yoi-server
) )
} }
@ -327,7 +327,7 @@ start_runtime() {
fi fi
local port runtime_bin local port runtime_bin
port="$(port_for_addr "$RUNTIME_BIND")" port="$(port_for_addr "$RUNTIME_BIND")"
runtime_bin="$ROOT_DIR/target/debug/worker-runtime-rest-server" runtime_bin="$ROOT_DIR/target/debug/yoi-runtime"
if [[ ! -x "$runtime_bin" ]]; then if [[ ! -x "$runtime_bin" ]]; then
printf 'runtime binary not found or not executable: %s\n' "$runtime_bin" >&2 printf 'runtime binary not found or not executable: %s\n' "$runtime_bin" >&2
return 1 return 1
@ -339,7 +339,7 @@ start_runtime() {
start_backend() { start_backend() {
local port backend_bin local port backend_bin
port="$(port_for_addr "$BACKEND_LISTEN")" port="$(port_for_addr "$BACKEND_LISTEN")"
backend_bin="$ROOT_DIR/target/debug/yoi-workspace-server" backend_bin="$ROOT_DIR/target/debug/yoi-server"
if [[ ! -x "$backend_bin" ]]; then if [[ ! -x "$backend_bin" ]]; then
printf 'backend binary not found or not executable: %s\n' "$backend_bin" >&2 printf 'backend binary not found or not executable: %s\n' "$backend_bin" >&2
return 1 return 1

View File

@ -3,7 +3,7 @@
SvelteKit static SPA for the Yoi workspace control plane. SvelteKit static SPA for the Yoi workspace control plane.
The frontend is intentionally static. Workspace authority, validation, and API The frontend is intentionally static. Workspace authority, validation, and API
behavior live in the Rust `yoi-workspace-server` backend. behavior live in the Rust `yoi-server` backend.
## Development ## Development
@ -30,12 +30,12 @@ printed by `deno task dev`.
If you want to run the backend from the repository root instead: If you want to run the backend from the repository root instead:
```bash ```bash
cargo run -p yoi-workspace-server -- serve --listen 127.0.0.1:8787 cargo run -p yoi-workspace-server --bin yoi-server -- serve --listen 127.0.0.1:8787
``` ```
The backend reads Workspace records from the Yoi server DB at The backend reads Workspace records from the Yoi server DB at
`<data_dir>/server/server.db`. Run `<data_dir>/server/server.db`. Run
`cargo run -p yoi-workspace-server -- init --workspace .` first when the server `cargo run -p yoi-workspace-server --bin yoi-server -- init --workspace .` first when the server
DB has not been initialized. DB has not been initialized.
## Static build ## Static build

View File

@ -4,7 +4,7 @@
"tasks": { "tasks": {
"install": "deno install", "install": "deno install",
"dev": "deno run -A npm:vite@7.2.7 dev", "dev": "deno run -A npm:vite@7.2.7 dev",
"dev:backend": "cd ../.. && cargo run -p yoi-workspace-server -- serve --listen 127.0.0.1:8787", "dev:backend": "cd ../.. && cargo run -p yoi-workspace-server --bin yoi-server -- serve --listen 127.0.0.1:8787",
"check": "deno run -A npm:@sveltejs/kit@2.49.4 sync && deno run -A npm:svelte-check@4.3.4 --tsconfig ./tsconfig.json", "check": "deno run -A npm:@sveltejs/kit@2.49.4 sync && deno run -A npm:svelte-check@4.3.4 --tsconfig ./tsconfig.json",
"test": "deno test --allow-read=src --allow-env=VSCODE_TEXTMATE_DEBUG src/lib/workspace/auth/model.test.ts src/lib/workspace/api/http.test.ts src/lib/workspace/console/chat-submit.test.ts src/lib/workspace/console/composer-command.test.ts src/lib/workspace/console/composer-completion.test.ts src/lib/workspace/console/markdown.test.ts src/lib/workspace/console/model.test.ts src/lib/workspace/console/worker-console.ui.test.ts src/lib/workspace/settings/model.test.ts src/lib/workspace/sidebar/workers.test.ts src/lib/workspace/sidebar/worker-launch.test.ts src/lib/workspace/sidebar/repository-nav.test.ts", "test": "deno test --allow-read=src --allow-env=VSCODE_TEXTMATE_DEBUG src/lib/workspace/auth/model.test.ts src/lib/workspace/api/http.test.ts src/lib/workspace/console/chat-submit.test.ts src/lib/workspace/console/composer-command.test.ts src/lib/workspace/console/composer-completion.test.ts src/lib/workspace/console/markdown.test.ts src/lib/workspace/console/model.test.ts src/lib/workspace/console/worker-console.ui.test.ts src/lib/workspace/settings/model.test.ts src/lib/workspace/sidebar/workers.test.ts src/lib/workspace/sidebar/worker-launch.test.ts src/lib/workspace/sidebar/repository-nav.test.ts",
"build": "deno run -A npm:vite@7.2.7 build", "build": "deno run -A npm:vite@7.2.7 build",