feat(shell): add parallel bash shell subsystem auto-started per workspace
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// NewRouter builds a Gin engine with all API routes registered.
|
||||
func NewRouter(workspaces *service.WorkspaceService, files *service.FileService, processes *service.ProcessService, lg *slog.Logger, ginMode string) *gin.Engine {
|
||||
func NewRouter(workspaces *service.WorkspaceService, files *service.FileService, processes *service.ProcessService, shells *service.ShellService, lg *slog.Logger, ginMode string) *gin.Engine {
|
||||
gin.SetMode(ginMode)
|
||||
r := gin.New()
|
||||
r.Use(gin.Recovery())
|
||||
@@ -19,6 +19,7 @@ func NewRouter(workspaces *service.WorkspaceService, files *service.FileService,
|
||||
wsHandler := &workspaceHandler{svc: workspaces}
|
||||
fileHandler := &fileHandler{svc: files}
|
||||
procHandler := &processHandler{svc: processes}
|
||||
shellHandler := &shellHandler{svc: shells}
|
||||
|
||||
r.GET("/healthz", healthHandler)
|
||||
|
||||
@@ -42,6 +43,12 @@ func NewRouter(workspaces *service.WorkspaceService, files *service.FileService,
|
||||
api.GET("/workspaces/:id/process/status", procHandler.status)
|
||||
api.GET("/workspaces/:id/process/ws", procHandler.ws)
|
||||
|
||||
api.POST("/workspaces/:id/shell/start", shellHandler.start)
|
||||
api.POST("/workspaces/:id/shell/stop", shellHandler.stop)
|
||||
api.POST("/workspaces/:id/shell/restart", shellHandler.restart)
|
||||
api.GET("/workspaces/:id/shell/status", shellHandler.status)
|
||||
api.GET("/workspaces/:id/shell/ws", shellHandler.ws)
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user