feat(plugin): observe terminals across connected hosts

Share host-wide terminal observations across plugin surfaces and gate them on terminalCollection. Keep directory observations compatible, and carry creation time in worker v6 state so v5 terminals can drain with an unknown timestamp.
This commit is contained in:
Mohamed Boudra
2026-11-06 09:22:19 +01:00
parent 62bd21214b
commit c4e5a0e739
30 changed files with 795 additions and 61 deletions
+7 -1
View File
@@ -6506,10 +6506,16 @@ export class DaemonClient {
// ============================================================================
observeTerminals(input: {
cwd: string;
cwd?: string;
workspaceId?: string;
signal?: AbortSignal;
}): OwnedSubscription<CorrelatedResponsePayload<"terminals_changed">> {
// COMPAT(terminalCollection): added in v0.16, remove after 2027-06.
if (
input.cwd === undefined &&
this.getLastServerInfoMessage()?.features?.terminalCollection !== true
)
throw new Error("Update the host to list terminals across workspaces.");
const { signal, ...query } = input;
return this.observe(
"terminals_changed",