refactor(monorepo): rename operator api runtime

This commit is contained in:
2026-03-20 14:46:04 +08:00
parent bc08feda59
commit 4a324d841e
19 changed files with 106 additions and 47 deletions
+10 -10
View File
@@ -20,7 +20,7 @@ The recommended direction is:
- keep a single monorepo
- add a standalone frontend app under `apps/web`
- add a standalone HTTP backend entrypoint, now owned under `packages/orchd-runtime/cmd/orchd`
- add a standalone HTTP backend entrypoint, now owned under `packages/operator-api/cmd/operator-api`
- keep the current Go repository as the backend source of truth
- evolve the backend by introducing shared application services and UI-oriented query layers
- avoid building the web backend by shelling out to the existing CLIs
@@ -113,9 +113,9 @@ Recommended stack:
The frontend should consume only HTTP APIs and event streams from the backend.
It should never read SQLite directly and should not depend on CLI output parsing.
### `packages/orchd-runtime`
### `packages/operator-api`
The backend HTTP service should live in a package-owned runtime with its Go binary under `packages/orchd-runtime/cmd/orchd`.
The backend HTTP service should live in a package-owned runtime with its Go binary under `packages/operator-api/cmd/operator-api`.
Responsibilities:
@@ -126,7 +126,7 @@ Responsibilities:
The existing orch and inbox runtimes should remain available as operator and debugging tools through their package-owned binaries under `packages/orch-runtime/cmd/orch` and `packages/inbox-runtime/cmd/inbox`.
### `packages/orchd-runtime/internal/app`
### `packages/operator-api/internal/app`
This package should become the shared application-service layer.
@@ -142,7 +142,7 @@ It should own business actions that currently sit mostly in CLI command handlers
Both CLI commands and HTTP handlers should call into this layer.
### `packages/orchd-runtime/internal/query`
### `packages/operator-api/internal/query`
This package should hold read models specifically shaped for the web UI.
@@ -156,7 +156,7 @@ Examples:
These should be query-oriented models rather than raw database table mirrors.
### `packages/orchd-runtime/internal/httpapi`
### `packages/operator-api/internal/httpapi`
This package should hold the web transport layer.
@@ -325,10 +325,10 @@ The goal is to avoid rewriting product boundaries just because the storage engin
Add:
- `apps/web`
- `packages/orchd-runtime/cmd/orchd`
- `packages/orchd-runtime/internal/httpapi`
- `packages/orchd-runtime/internal/app`
- `packages/orchd-runtime/internal/query`
- `packages/operator-api/cmd/operator-api`
- `packages/operator-api/internal/httpapi`
- `packages/operator-api/internal/app`
- `packages/operator-api/internal/query`
- `api/openapi.yaml`
- `api/events.md`
- root JS workspace files such as `package.json` and `pnpm-workspace.yaml`