MCPcopy Create free account
hub / github.com/compozy/agh / GetWorkspace

Method GetWorkspace

internal/api/core/workspaces.go:77–103  ·  view source on GitHub ↗

GetWorkspace returns one resolved workspace with related sessions, agents, and skills.

(c *gin.Context)

Source from the content-addressed store, hash-verified

75
76// GetWorkspace returns one resolved workspace with related sessions, agents, and skills.
77func (h *BaseHandlers) GetWorkspace(c *gin.Context) {
78 resolved, err := h.Workspaces.Resolve(c.Request.Context(), workspaceRefFromRoute(c))
79 if err != nil {
80 h.respondError(c, StatusForWorkspaceError(err), err)
81 return
82 }
83
84 sessions, err := h.Sessions.ListAll(c.Request.Context())
85 if err != nil {
86 h.respondError(c, http.StatusInternalServerError, err)
87 return
88 }
89
90 agents, err := h.workspaceDetailAgents(c.Request.Context(), &resolved)
91 if err != nil {
92 h.respondError(c, http.StatusInternalServerError, err)
93 return
94 }
95
96 c.JSON(http.StatusOK, contract.WorkspaceDetailPayload{
97 Workspace: WorkspacePayloadFromWorkspace(resolved.Workspace),
98 Sessions: SessionPayloadsForWorkspace(sessions, resolved.WorkspaceID),
99 Agents: AgentPayloadsFromDefs(agents),
100 Skills: WorkspaceSkillPayloads(resolved.Skills),
101 Providers: SessionProviderOptionPayloadsFromConfig(&resolved.Config),
102 })
103}
104
105func (h *BaseHandlers) workspaceDetailAgents(
106 ctx context.Context,

Callers

nothing calls this directly

Calls 11

respondErrorMethod · 0.95
workspaceDetailAgentsMethod · 0.95
workspaceRefFromRouteFunction · 0.85
StatusForWorkspaceErrorFunction · 0.85
AgentPayloadsFromDefsFunction · 0.85
WorkspaceSkillPayloadsFunction · 0.85
ResolveMethod · 0.65
ListAllMethod · 0.65

Tested by

no test coverage detected