(c echo.Context)
| 275 | } |
| 276 | |
| 277 | func (s *Server) getSession(c echo.Context) error { |
| 278 | sess, err := s.sm.GetSession(c.Request().Context(), c.Param("id")) |
| 279 | if err != nil { |
| 280 | return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("session not found: %v", err)) |
| 281 | } |
| 282 | |
| 283 | return c.JSON(http.StatusOK, api.SessionResponse{ |
| 284 | ID: sess.ID, |
| 285 | Title: sess.Title, |
| 286 | CreatedAt: sess.CreatedAt, |
| 287 | Messages: sess.GetAllMessages(), |
| 288 | ToolsApproved: sess.ToolsApproved, |
| 289 | InputTokens: sess.InputTokens, |
| 290 | OutputTokens: sess.OutputTokens, |
| 291 | WorkingDir: sess.WorkingDir, |
| 292 | Permissions: sess.Permissions, |
| 293 | }) |
| 294 | } |
| 295 | |
| 296 | // getSessionStatus returns the session's current runtime state. With |
| 297 | // ?wait=<duration> it blocks until the session's runtime is attached (ready |
nothing calls this directly
no test coverage detected