The Resources layer exposes a per-workspace in-process subscription API for status-change events. This API allows server-side callers to register one handler and receive a unified stream of resource status changes for a specific workspace.
This is currently an internal TypeScript API (not an HTTP endpoint).
Entry point:
server.resources.getWorkspaceResources(workspaceId)Subscription method on WorkspaceResources:
subscribe(handler: (event: ResourceEvent) => void): () => void
Behavior:
handler for resource events in one workspace.NotFoundError when workspaceId does not exist.ResourceEvent payload:
type ResourceEvent<T = unknown> = {
group: string;
version: string;
resource: string;
namespace: string;
name: string;
status: T;
};
Fields identify the changed Kubernetes resource (group, version, resource, namespace, name) and carry the latest status snapshot.
Workspace-level subscribe currently aggregates these resource modules:
modelstoolskbsdocumentsagentsstacks and secrets expose their own subscribe(...) methods but are not included in the workspace-level aggregate subscription yet.
Underlying emission is implemented by K8sResource and follows these rules:
status.status (JSON.stringify(status ?? null)).This API is intentionally scoped to server-internal observers.
Out of scope in current implementation: