mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat(servers): bring linked-server sessions to parity with local
Add a read-only Source Control panel for linked servers backed by the OpenCode VCS API, broadcast remote events to every client, include recent linked-server sessions in Activity with per-server sidebar indicators, and enable the session picker, tool shortcuts, mobile activity, remote Skills panel and remote permission prompt titles.
This commit is contained in:
1 parent
9ec2ed5903
commit
7874afdab9
38 files changed
+1506
-279
No files matched your search
@@ -520,12 +520,17 @@ class SSEAggregator {
|
||||
this.notifyServerEvent(LOCAL_OPENCODE_SERVER_ID, directory, event)
|
||||
}
|
||||
|
||||
private writeEnvelopeToClients(clientIds: Iterable<string>, directory: string | null, payloadJson: string): void {
|
||||
private writeEnvelopeToClients(
|
||||
clientIds: Iterable<string>,
|
||||
directory: string | null,
|
||||
payloadJson: string,
|
||||
serverId?: string,
|
||||
): void {
|
||||
let frame: Uint8Array | null = null
|
||||
for (const clientId of clientIds) {
|
||||
const client = this.clients.get(clientId)
|
||||
if (!client) continue
|
||||
frame ??= encodeSSEFrame('message', serializeEnvelope(directory, payloadJson))
|
||||
frame ??= encodeSSEFrame('message', serializeEnvelope(directory, payloadJson, serverId))
|
||||
this.writeFrame(client, frame, 'Failed to send to client')
|
||||
}
|
||||
}
|
||||
@@ -543,16 +548,7 @@ class SSEAggregator {
|
||||
}
|
||||
|
||||
deliverRemoteEnvelope(serverId: string, directory: string | null, payloadJson: string): void {
|
||||
const clientIds = directory === null
|
||||
? this.clientIdsForServer(serverId)
|
||||
: Array.from(this.directoryClients.get(buildServerDirectoryKey(serverId, directory)) ?? [])
|
||||
if (clientIds.length === 0) return
|
||||
const frame = encodeSSEFrame('message', serializeEnvelope(directory, payloadJson, serverId))
|
||||
for (const clientId of clientIds) {
|
||||
const client = this.clients.get(clientId)
|
||||
if (!client) continue
|
||||
this.writeFrame(client, frame, 'Failed to send remote event to client')
|
||||
}
|
||||
this.writeEnvelopeToClients(this.clients.keys(), directory, payloadJson, serverId)
|
||||
}
|
||||
|
||||
deliverRemoteEnvelopeToClient(clientId: string, serverId: string, directory: string, payloadJson: string): void {
|
||||
|
||||
Reference in new issue
Block a user