feat(web): project plan mode through host API

This commit is contained in:
fz
2026-07-24 12:09:04 +08:00
parent bc7a89b81f
commit bc63b5fe00
34 changed files with 515 additions and 16 deletions

View File

@@ -44,6 +44,16 @@ export interface SessionSummary {
cwd?: string
}
/**
* Plan collaboration state exposed to clients. `active` is the logged state
* shaping the current request; `pending`, when present, is the user's
* next-boundary selection.
*/
export interface PlanModeState {
active: boolean
pending?: boolean
}
/** Session-domain unary methods (the map keys session.* of RpcMethodMap). */
export interface SessionsApi {
/** Lists persisted sessions (updatedAt descending). v1 returns everything; cursor is a reserved seat, unimplemented. */
@@ -70,4 +80,18 @@ export interface SessionsApi {
/** Stops: clears both FIFOs + aborts the current step (1:1 with agent.cancel). */
cancel(request: RpcRequest<{ sessionId: SessionId }>): Promise<RpcResponse<{ accepted: true }>>
/**
* Reads plan collaboration state. `null` means the host did not compose the
* optional plan-mode service; it is distinct from inactive state.
*/
planMode(request: RpcRequest<{ sessionId: SessionId }>): Promise<RpcResponse<PlanModeState | null>>
/**
* Selects plan collaboration state for the next model-request boundary.
* The returned state exposes the still-committed value and pending target;
* `null` means plan mode is unavailable on this host.
*/
setPlanMode(request: RpcRequest<{ sessionId: SessionId; active: boolean }>):
Promise<RpcResponse<PlanModeState | null>>
}