refactor: shatter the eld*n ring
This commit is contained in:
@@ -10,7 +10,7 @@ import type {
|
||||
export const sessionsApi = {
|
||||
// --- Session lifecycle ---
|
||||
|
||||
/** Create a session. If agentPath is provided, loads a graph in one step. */
|
||||
/** Create a session. If agentPath is provided, loads a colony in one step. */
|
||||
create: (agentPath?: string, agentId?: string, model?: string, initialPrompt?: string, queenResumeFrom?: string, initialPhase?: string) =>
|
||||
api.post<LiveSession>("/sessions", {
|
||||
agent_path: agentPath,
|
||||
@@ -24,7 +24,7 @@ export const sessionsApi = {
|
||||
/** List all active sessions. */
|
||||
list: () => api.get<{ sessions: LiveSession[] }>("/sessions"),
|
||||
|
||||
/** Get session detail (includes entry_points, graphs when a graph is loaded). */
|
||||
/** Get session detail (includes entry_points, colonies when a worker is loaded). */
|
||||
get: (sessionId: string) =>
|
||||
api.get<LiveSessionDetail>(`/sessions/${sessionId}`),
|
||||
|
||||
@@ -34,23 +34,23 @@ export const sessionsApi = {
|
||||
`/sessions/${sessionId}`,
|
||||
),
|
||||
|
||||
// --- Graph lifecycle ---
|
||||
// --- Colony lifecycle ---
|
||||
|
||||
loadGraph: (
|
||||
loadColony: (
|
||||
sessionId: string,
|
||||
agentPath: string,
|
||||
graphId?: string,
|
||||
colonyId?: string,
|
||||
model?: string,
|
||||
) =>
|
||||
api.post<LiveSession>(`/sessions/${sessionId}/graph`, {
|
||||
api.post<LiveSession>(`/sessions/${sessionId}/colony`, {
|
||||
agent_path: agentPath,
|
||||
graph_id: graphId,
|
||||
colony_id: colonyId,
|
||||
model,
|
||||
}),
|
||||
|
||||
unloadGraph: (sessionId: string) =>
|
||||
api.delete<{ session_id: string; graph_unloaded: boolean }>(
|
||||
`/sessions/${sessionId}/graph`,
|
||||
unloadColony: (sessionId: string) =>
|
||||
api.delete<{ session_id: string; colony_unloaded: boolean }>(
|
||||
`/sessions/${sessionId}/colony`,
|
||||
),
|
||||
|
||||
// --- Session info ---
|
||||
@@ -73,8 +73,8 @@ export const sessionsApi = {
|
||||
patch,
|
||||
),
|
||||
|
||||
graphs: (sessionId: string) =>
|
||||
api.get<{ graphs: string[] }>(`/sessions/${sessionId}/graphs`),
|
||||
colonies: (sessionId: string) =>
|
||||
api.get<{ colonies: string[] }>(`/sessions/${sessionId}/colonies`),
|
||||
|
||||
/** Get persisted eventbus log for a session (works for cold sessions — used for full UI replay). */
|
||||
eventsHistory: (sessionId: string) =>
|
||||
|
||||
Reference in New Issue
Block a user