Class AhpHost
java.lang.Object
com.github.copilot.AhpHost
- All Implemented Interfaces:
AutoCloseable
A ready, connection-owned AHP listener. The handle remains bound to its
original transport across client reconnects. Disposal never deletes
application sessions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Disposes the listener and waits for acknowledged cleanup.dispose()Stops the listener and joins runtime cleanup.Gets the GitHub Mission Control environment identity.Gets the listener identity.getPid()Gets the legacy process ID.getToken()Gets the secret token.getUrl()Gets the bound address.Lists all live and dormant catalog sessions advertised by this host.publishSession(String sessionId) Durably advertises an exact attached session in the compute-scoped catalog, without invoking a factory or transferring session ownership.unpublishSession(String sessionId) Withdraws a live or dormant application publication and revokes AHP attachments.
-
Method Details
-
getHostId
-
getUrl
Gets the bound address.- Returns:
- the actual bound WebSocket URL, or
nullwithout a local server
-
getToken
Gets the secret token.- Returns:
- the token, or
nullwithout an authenticated local server
-
getPid
Gets the legacy process ID.- Returns:
- the process ID, or
nullfor in-process hosting
-
getEnvironmentId
Gets the GitHub Mission Control environment identity.- Returns:
- the environment ID, or
nullwithout a GitHub environment
-
dispose
Stops the listener and joins runtime cleanup. Every call reaches the runtime, including concurrent and repeated disposal calls.- Returns:
- completion of listener cleanup
-
publishSession
Durably advertises an exact attached session in the compute-scoped catalog, without invoking a factory or transferring session ownership.- Parameters:
sessionId- resident session identity- Returns:
- the published AHP session identity
-
unpublishSession
Withdraws a live or dormant application publication and revokes AHP attachments. Preserves local history, worktrees and ongoing work. Rejects nonapplication publications without stopping the host.- Parameters:
sessionId- canonical application session identity- Returns:
- whether a publication was removed; false when already absent
-
listSessions
Lists all live and dormant catalog sessions advertised by this host.- Returns:
- the advertised host sessions
-
close
public void close()Disposes the listener and waits for acknowledged cleanup.- Specified by:
closein interfaceAutoCloseable
-