You've already forked agentic-coding-workflow
feat(acp): relay skeleton (subscribe/unsubscribe/fanout/close) + supervisor.GetRelay
This commit is contained in:
@@ -83,6 +83,7 @@ type Process struct {
|
||||
Stdin io.WriteCloser
|
||||
Stdout io.ReadCloser
|
||||
Stderr io.ReadCloser
|
||||
Relay *Relay
|
||||
|
||||
StderrBuf *stderrRing // 排障 ring buffer
|
||||
StartedAt time.Time
|
||||
@@ -121,6 +122,16 @@ func (r *stderrRing) Tail(maxBytes int) string {
|
||||
return out
|
||||
}
|
||||
|
||||
// Relay field + GetRelay method added in Task D7 when Relay type is wired.
|
||||
// GetRelay returns the relay for an active session, or nil if not running.
|
||||
// WS handler 用此判断是否进 live 模式。
|
||||
func (s *Supervisor) GetRelay(sid uuid.UUID) *Relay {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
p, ok := s.procs[sid]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return p.Relay
|
||||
}
|
||||
|
||||
// Spawn / Kill / ShutdownAll / monitorProcess / handshake are implemented in subsequent tasks (E2).
|
||||
|
||||
Reference in New Issue
Block a user