Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
feat: raw docker CLI output for all operations + interactive watch mode (#3376)
Kyle Mendellf1251b004974
diff --git a/backend/api/handlers/containers.go b/backend/api/handlers/containers.goindex 9439d6e06..afad02d58 100644--- a/backend/api/handlers/containers.go+++ b/backend/api/handlers/containers.go@@ -15,9 +15,9 @@ import ("github.com/getarcaneapp/arcane/backend/v2/internal/models""github.com/getarcaneapp/arcane/backend/v2/internal/services""github.com/getarcaneapp/arcane/backend/v2/pkg/authz"+ dockerutils "github.com/getarcaneapp/arcane/backend/v2/pkg/dockerutil""github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane"activitylib "github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane/activity"- "github.com/getarcaneapp/arcane/backend/v2/pkg/projects""github.com/getarcaneapp/arcane/backend/v2/pkg/utils""github.com/getarcaneapp/arcane/types/v2/base"containertypes "github.com/getarcaneapp/arcane/types/v2/container"@@ -763,7 +763,7 @@ func (h *ContainerHandler) RedeployContainer(ctx context.Context, input *ContainactivityID, runtimeCtx := activitylib.StartQueuedHandlerActivityForUser(runtimeCtx, h.activityService, input.EnvironmentID, models.ActivityTypeContainerRedeploy, "container", input.ContainerID, input.ContainerID, user, "Starting redeploy", "Container redeploy requested", models.JSON{"containerID": input.ContainerID})activitylib.AwaitHandlerActivitySlot(runtimeCtx, h.activityService, activityID, input.EnvironmentID)activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, "Redeploying container")- redeployCtx := context.WithValue(runtimeCtx, projects.ProgressWriterKey{}, activityWriter)+ redeployCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)newContainerID, err := h.containerService.RedeployContainer(redeployCtx, input.ContainerID, *user)if err != nil {activitylib.FlushWriter(activityWriter)diff --git a/backend/api/handlers/images.go b/backend/api/handlers/images.goindex 395be6062..763a01638 100644--- a/backend/api/handlers/images.go+++ b/backend/api/handlers/images.go@@ -628,9 +628,13 @@ func (h *ImageHandler) PullImage(ctx context.Context, input *PullImageInput) (*hactivitylib.FlushWriter(writer)activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Image pull failed", err)_, _ = fmt.Fprintf(writer, `{"error":%q}`+"\n", err.Error())+ if f, ok := writer.(http.Flusher); ok {+ f.Flush()+ }return}activitylib.FlushWriter(writer)+ activitylib.WriteDoneLine(rawWriter)activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Image pull completed", nil)},}, nil@@ -681,9 +685,13 @@ func (h *ImageHandler) BuildImage(ctx context.Context, input *BuildImageInput) (activitylib.FlushWriter(writer)activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Image build failed", err)_, _ = fmt.Fprintf(writer, `{"error":%q}`+"\n", err.Error())+ if f, ok := writer.(http.Flusher); ok {+ f.Flush()+ }return}activitylib.FlushWriter(writer)+ activitylib.WriteDoneLine(rawWriter)activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Image build completed", nil)},}, nildiff --git a/backend/api/handlers/projects.go b/backend/api/handlers/projects.goindex 8bfaf5e8e..460f15a10 100644--- a/backend/api/handlers/projects.go+++ b/backend/api/handlers/projects.go@@ -17,9 +17,9 @@ import ("github.com/getarcaneapp/arcane/backend/v2/internal/models""github.com/getarcaneapp/arcane/backend/v2/internal/services""github.com/getarcaneapp/arcane/backend/v2/pkg/authz"+ dockerutils "github.com/getarcaneapp/arcane/backend/v2/pkg/dockerutil"activitylib "github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane/activity""github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane/volumes"- "github.com/getarcaneapp/arcane/backend/v2/pkg/projects""github.com/getarcaneapp/arcane/backend/v2/pkg/utils""github.com/getarcaneapp/arcane/backend/v2/pkg/utils/httpx""github.com/getarcaneapp/arcane/backend/v2/pkg/utils/mapper"@@ -114,10 +114,6 @@ type RedeployProjectInput struct {Body *project.DeployOptions}-type RedeployProjectOutput struct {- Body base.ApiResponse[base.MessageResponse]-}-type DestroyProjectInput struct {EnvironmentID string `path:"id" doc:"Environment ID"`ProjectID string `path:"projectId" doc:"Project ID"`@@ -204,18 +200,6 @@ type BuildProjectInput struct {}}-// PullProgressEvent represents a Docker pull progress event-type PullProgressEvent struct {- Status string `json:"status,omitempty"`- ID string `json:"id,omitempty"`- Progress string `json:"progress,omitempty"`- ProgressDetail struct {- Current int64 `json:"current,omitempty"`- Total int64 `json:"total,omitempty"`- } `json:"progressDetail"`- Error string `json:"error,omitempty"`-}-// RegisterProjects registers project management routes using Huma.// Note: WebSocket and streaming endpoints remain as Gin handlers.func RegisterProjects(api huma.API, projectService *services.ProjectService, activityService *services.ActivityService, appCtx ActivityAppContext) {@@ -491,51 +475,63 @@ func (h *ProjectHandler) GetProjectStatusCounts(ctx context.Context, input *GetP}// DeployProject deploys a Docker Compose project.-func (h *ProjectHandler) DeployProject(ctx context.Context, input *DeployProjectInput) (*huma.StreamResponse, error) {- if input.ProjectID == "" {- return nil, huma.Error400BadRequest("Project ID is required")- }-- user, err := requireUserInternal(ctx)- if err != nil {- return nil, err- }-+// projectStreamOperationConfigInternal describes one streamed project+// operation (deploy, redeploy, pull, build): the activity it records and the+// action whose raw docker CLI output is streamed to the client.+type projectStreamOperationConfigInternal struct {+ ActivityType models.ActivityType+ Step string+ StartMessage string+ WriterStep string+ FailureMessage string+ SuccessMessage string+ Metadata models.JSON+ // Action runs the operation. ctx carries the stream writer under+ // dockerutils.ProgressWriterKey; it is also passed directly for actions+ // that take a writer parameter.+ Action func(ctx context.Context, writer io.Writer) error+}++// streamProjectOperationInternal is the shared scaffold for the streamed+// project endpoints: NDJSON headers, activity lifecycle (started frame, queue+// slot, completion), the activity-teeing writer, and the terminal done/error+// frames.+func (h *ProjectHandler) streamProjectOperationInternal(environmentID, projectID string, user *models.User, cfg projectStreamOperationConfigInternal) *huma.StreamResponse {return &huma.StreamResponse{- Body: func(humaCtx huma.Context) { //nolint:contextcheck // context is obtained from humaCtx.Context()+ Body: func(humaCtx huma.Context) {httpx.SetJSONStreamHeaders(humaCtx)runtimeCtx := utils.ActivityRuntimeContext(humaCtx.Context(), h.appCtx)rawWriter := humaCtx.BodyWriter()+ metadata := cfg.Metadata+ if metadata == nil {+ metadata = models.JSON{"projectID": projectID}+ }activityID, runtimeCtx := activitylib.StartQueuedHandlerActivityForUser(runtimeCtx,h.activityService,- input.EnvironmentID,- models.ActivityTypeProjectDeploy,+ environmentID,+ cfg.ActivityType,"project",- input.ProjectID,- input.ProjectID,+ projectID,+ projectID,user,- "Starting deployment",- "Project deployment started",- models.JSON{"projectID": input.ProjectID},+ cfg.Step,+ cfg.StartMessage,+ metadata,)activitylib.WriteStartedLine(rawWriter, activityID)if f, ok := rawWriter.(http.Flusher); ok {f.Flush()}- activitylib.AwaitHandlerActivitySlot(runtimeCtx, h.activityService, activityID, input.EnvironmentID)+ activitylib.AwaitHandlerActivitySlot(runtimeCtx, h.activityService, activityID, environmentID)- writer := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, rawWriter, "Deploying project")- _, _ = writer.Write([]byte(`{"type":"deploy","phase":"begin"}` + "\n"))- if f, ok := writer.(http.Flusher); ok {- f.Flush()- }+ writer := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, rawWriter, cfg.WriterStep)- deployCtx := context.WithValue(runtimeCtx, projects.ProgressWriterKey{}, writer)- if err := h.projectService.DeployProject(deployCtx, input.ProjectID, *user, input.Body); err != nil {+ opCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, writer)+ if err := cfg.Action(opCtx, writer); err != nil {activitylib.FlushWriter(writer)- activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Project deployment failed", err)+ activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, cfg.FailureMessage, err)_, _ = fmt.Fprintf(writer, `{"error":%q}`+"\n", err.Error())if f, ok := writer.(http.Flusher); ok {f.Flush()@@ -543,13 +539,34 @@ func (h *ProjectHandler) DeployProject(ctx context.Context, input *DeployProjectreturn}- _, _ = writer.Write([]byte(`{"type":"deploy","phase":"complete"}` + "\n"))- if f, ok := writer.(http.Flusher); ok {- f.Flush()- }- activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Project deployment completed", nil)+ activitylib.FlushWriter(writer)+ activitylib.WriteDoneLine(rawWriter)+ activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, cfg.SuccessMessage, nil)},- }, nil+ }+}++func (h *ProjectHandler) DeployProject(ctx context.Context, input *DeployProjectInput) (*huma.StreamResponse, error) {+ if input.ProjectID == "" {+ return nil, huma.Error400BadRequest("Project ID is required")+ }++ user, err := requireUserInternal(ctx)+ if err != nil {+ return nil, err+ }++ return h.streamProjectOperationInternal(input.EnvironmentID, input.ProjectID, user, projectStreamOperationConfigInternal{ //nolint:contextcheck // the stream body runs on humaCtx.Context(), not the handler ctx+ ActivityType: models.ActivityTypeProjectDeploy,+ Step: "Starting deployment",+ StartMessage: "Project deployment started",+ WriterStep: "Deploying project",+ FailureMessage: "Project deployment failed",+ SuccessMessage: "Project deployment completed",+ Action: func(opCtx context.Context, _ io.Writer) error {+ return h.projectService.DeployProject(opCtx, input.ProjectID, *user, input.Body)+ },+ }), nil}// DownProject brings down a Docker Compose project.@@ -562,7 +579,7 @@ func (h *ProjectHandler) DownProject(ctx context.Context, input *DownProjectInpuruntimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)activityID, runtimeCtx := activitylib.StartHandlerActivityForUser(runtimeCtx, h.activityService, input.EnvironmentID, models.ActivityTypeProjectDown, "project", input.ProjectID, input.ProjectID, user, "Stopping project", "Project stop requested", models.JSON{"projectID": input.ProjectID})activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, "Stopping project")- downCtx := context.WithValue(runtimeCtx, projects.ProgressWriterKey{}, activityWriter)+ downCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)if err := h.projectService.DownProject(downCtx, input.ProjectID, *user); err != nil {activitylib.FlushWriter(activityWriter)activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Project stopped", err)@@ -765,15 +782,29 @@ func (h *ProjectHandler) GetProjectFile(ctx context.Context, input *GetProjectFi}// RedeployProject redeploys a Docker Compose project.-func (h *ProjectHandler) RedeployProject(ctx context.Context, input *RedeployProjectInput) (*RedeployProjectOutput, error) {- response, err := h.runProjectActivityActionResponseInternal(ctx, input.EnvironmentID, input.ProjectID, h.redeployProjectActivityConfigInternal(input.Body))+// RedeployProject pulls project images and re-deploys, streaming the raw+// docker CLI output as NDJSON like DeployProject.+func (h *ProjectHandler) RedeployProject(ctx context.Context, input *RedeployProjectInput) (*huma.StreamResponse, error) {+ if input.ProjectID == "" {+ return nil, huma.Error400BadRequest("Project ID is required")+ }++ user, err := requireUserInternal(ctx)if err != nil {return nil, err}- return &RedeployProjectOutput{- Body: response,- }, nil+ return h.streamProjectOperationInternal(input.EnvironmentID, input.ProjectID, user, projectStreamOperationConfigInternal{ //nolint:contextcheck // the stream body runs on humaCtx.Context(), not the handler ctx+ ActivityType: models.ActivityTypeProjectRedeploy,+ Step: "Starting redeploy",+ StartMessage: "Project redeploy started",+ WriterStep: "Redeploying project",+ FailureMessage: "Project redeploy failed",+ SuccessMessage: "Project redeploy completed",+ Action: func(opCtx context.Context, _ io.Writer) error {+ return h.projectService.RedeployProject(opCtx, input.ProjectID, *user, input.Body)+ },+ }), nil}// DestroyProject destroys a Docker Compose project.@@ -802,7 +833,7 @@ func (h *ProjectHandler) DestroyProject(ctx context.Context, input *DestroyProjeruntimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)activityID, runtimeCtx := activitylib.StartHandlerActivityForUser(runtimeCtx, h.activityService, input.EnvironmentID, models.ActivityTypeProjectDestroy, "project", input.ProjectID, input.ProjectID, user, "Destroying project", "Project destroy requested", models.JSON{"projectID": input.ProjectID, "removeFiles": removeFiles, "removeVolumes": removeVolumes})activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, "Destroying project")- destroyCtx := context.WithValue(runtimeCtx, projects.ProgressWriterKey{}, activityWriter)+ destroyCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)if err := h.projectService.DestroyProject(destroyCtx, input.ProjectID, removeFiles, removeVolumes, *user); err != nil {activitylib.FlushWriter(activityWriter)activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Project destroyed", err)@@ -981,25 +1012,6 @@ type projectActivityActionConfigInternal struct {Error func(error) error}-func (h *ProjectHandler) redeployProjectActivityConfigInternal(options *project.DeployOptions) projectActivityActionConfigInternal {- return projectActivityActionConfigInternal{- ActivityType: models.ActivityTypeProjectRedeploy,- Step: "Starting redeploy",- StartMessage: "Project redeploy started",- WriterStep: "Redeploying project",- FailureMessage: "Project redeploy failed",- SuccessComplete: "Project redeploy completed",- SuccessMessage: "Project redeployed successfully",- Queue: true,- Action: func(runtimeCtx context.Context, projectID string, user models.User) error {- return h.projectService.RedeployProject(runtimeCtx, projectID, user, options)- },- Error: projectArchivedActionErrorInternal(func(err error) error {- return huma.Error400BadRequest(errors.WithMessage(err, "Failed to redeploy project").Error())- }),- }-}-func (h *ProjectHandler) updateProjectServicesActivityConfigInternal(services []string) projectActivityActionConfigInternal {return projectActivityActionConfigInternal{ActivityType: models.ActivityTypeAutoUpdate,@@ -1082,7 +1094,7 @@ func (h *ProjectHandler) runProjectActivityActionInternal(ctx context.Context, eactivityID, runtimeCtx = activitylib.StartHandlerActivityForUser(runtimeCtx, h.activityService, environmentID, cfg.ActivityType, "project", projectID, projectID, user, cfg.Step, cfg.StartMessage, models.JSON{"projectID": projectID})}activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, cfg.WriterStep)- actionCtx := context.WithValue(runtimeCtx, projects.ProgressWriterKey{}, activityWriter)+ actionCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)if err := cfg.Action(actionCtx, projectID, *user); err != nil {activitylib.FlushWriter(activityWriter)activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, cfg.FailureMessage, err)@@ -1155,51 +1167,17 @@ func (h *ProjectHandler) PullProjectImages(ctx context.Context, input *PullProjereturn nil, err}- return &huma.StreamResponse{- Body: func(humaCtx huma.Context) { //nolint:contextcheck // context is obtained from humaCtx.Context()- httpx.SetJSONStreamHeaders(humaCtx)-- runtimeCtx := utils.ActivityRuntimeContext(humaCtx.Context(), h.appCtx)- rawWriter := humaCtx.BodyWriter()- activityID, runtimeCtx := activitylib.StartQueuedHandlerActivityForUser(- runtimeCtx,- h.activityService,- input.EnvironmentID,- models.ActivityTypeProjectPull,- "project",- input.ProjectID,- input.ProjectID,- user,- "Pulling project images",- "Project image pull started",- models.JSON{"projectID": input.ProjectID},- )- activitylib.WriteStartedLine(rawWriter, activityID)- activitylib.AwaitHandlerActivitySlot(runtimeCtx, h.activityService, activityID, input.EnvironmentID)-- writer := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, rawWriter, "Pulling project images")- _, _ = writer.Write([]byte(`{"status":"starting project image pull"}` + "\n"))- if f, ok := writer.(http.Flusher); ok {- f.Flush()- }-- if err := h.projectService.PullProjectImages(runtimeCtx, input.ProjectID, writer, *user, nil); err != nil {- activitylib.FlushWriter(writer)- activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Project image pull failed", err)- _, _ = fmt.Fprintf(writer, `{"error":%q}`+"\n", err.Error())- if f, ok := writer.(http.Flusher); ok {- f.Flush()- }- return- }-- _, _ = writer.Write([]byte(`{"status":"complete"}` + "\n"))- if f, ok := writer.(http.Flusher); ok {- f.Flush()- }- activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Project image pull completed", nil)+ return h.streamProjectOperationInternal(input.EnvironmentID, input.ProjectID, user, projectStreamOperationConfigInternal{ //nolint:contextcheck // the stream body runs on humaCtx.Context(), not the handler ctx+ ActivityType: models.ActivityTypeProjectPull,+ Step: "Pulling project images",+ StartMessage: "Project image pull started",+ WriterStep: "Pulling project images",+ FailureMessage: "Project image pull failed",+ SuccessMessage: "Project image pull completed",+ Action: func(opCtx context.Context, writer io.Writer) error {+ return h.projectService.PullProjectImages(opCtx, input.ProjectID, writer, *user, nil)},- }, nil+ }), nil}// BuildProjectImages builds compose services with build directives.@@ -1221,49 +1199,16 @@ func (h *ProjectHandler) BuildProjectImages(ctx context.Context, input *BuildProoptions.Load = input.Body.Load}- return &huma.StreamResponse{- Body: func(humaCtx huma.Context) { //nolint:contextcheck // context is obtained from humaCtx.Context()- httpx.SetJSONStreamHeaders(humaCtx)-- runtimeCtx := utils.ActivityRuntimeContext(humaCtx.Context(), h.appCtx)- rawWriter := humaCtx.BodyWriter()- activityID, runtimeCtx := activitylib.StartQueuedHandlerActivityForUser(- runtimeCtx,- h.activityService,- input.EnvironmentID,- models.ActivityTypeProjectBuild,- "project",- input.ProjectID,- input.ProjectID,- user,- "Building project images",- "Project image build started",- models.JSON{"projectID": input.ProjectID, "services": options.Services},- )- activitylib.WriteStartedLine(rawWriter, activityID)- activitylib.AwaitHandlerActivitySlot(runtimeCtx, h.activityService, activityID, input.EnvironmentID)-- writer := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, rawWriter, "Building project images")- _, _ = writer.Write([]byte(`{"type":"build","phase":"begin"}` + "\n"))- if f, ok := writer.(http.Flusher); ok {- f.Flush()- }-- if err := h.projectService.BuildProjectServices(runtimeCtx, input.ProjectID, options, writer, user); err != nil {- activitylib.FlushWriter(writer)- activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Project image build failed", err)- _, _ = fmt.Fprintf(writer, `{"error":%q}`+"\n", err.Error())- if f, ok := writer.(http.Flusher); ok {- f.Flush()- }- return- }-- _, _ = writer.Write([]byte(`{"type":"build","phase":"complete"}` + "\n"))- if f, ok := writer.(http.Flusher); ok {- f.Flush()- }- activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Project image build completed", nil)+ return h.streamProjectOperationInternal(input.EnvironmentID, input.ProjectID, user, projectStreamOperationConfigInternal{ //nolint:contextcheck // the stream body runs on humaCtx.Context(), not the handler ctx+ ActivityType: models.ActivityTypeProjectBuild,+ Step: "Building project images",+ StartMessage: "Project image build started",+ WriterStep: "Building project images",+ FailureMessage: "Project image build failed",+ SuccessMessage: "Project image build completed",+ Metadata: models.JSON{"projectID": input.ProjectID, "services": options.Services},+ Action: func(opCtx context.Context, writer io.Writer) error {+ return h.projectService.BuildProjectServices(opCtx, input.ProjectID, options, writer, user)},- }, nil+ }), nil}diff --git a/backend/cli/upgrade/upgrade.go b/backend/cli/upgrade/upgrade.goindex 71f657ff0..7d88c71c1 100644--- a/backend/cli/upgrade/upgrade.go+++ b/backend/cli/upgrade/upgrade.go@@ -5,6 +5,7 @@ import ("fmt""log/slog""maps"+ "os""strings""time"@@ -350,7 +351,7 @@ func pullImage(ctx context.Context, dockerClient *client.Client, imageName strin}defer func() { _ = reader.Close() }()- return docker.ConsumeJSONMessageStream(reader, nil)+ return docker.RenderJSONMessageStream(reader, os.Stdout)}func upgradeContainer(ctx context.Context, dockerClient *client.Client, oldContainer container.InspectResponse, newImage string) error {diff --git a/backend/go.mod b/backend/go.modindex d1efaf303..3439f8462 100644--- a/backend/go.mod+++ b/backend/go.mod@@ -54,7 +54,7 @@ require (github.com/stretchr/testify v1.11.1github.com/subosito/gotenv v1.6.0github.com/wneessen/go-mail v0.8.1- go.getarcane.app/builds v0.2.0+ go.getarcane.app/builds v0.3.0go.getarcane.app/docker/convert v0.1.0go.getarcane.app/streams v0.3.1go.getarcane.app/sys/atomic v0.1.0diff --git a/backend/go.sum b/backend/go.sumindex bb696c0f9..ad7d69ab2 100644--- a/backend/go.sum+++ b/backend/go.sum@@ -547,8 +547,8 @@ github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUgithub.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=-go.getarcane.app/builds v0.2.0 h1:IXl78t2Lpr4FJ+HQhAGbTgENyPr2WLBxAmFebRu5kuU=-go.getarcane.app/builds v0.2.0/go.mod h1:korkB7gWCiWx00SbKtX0sTwxWYeL1pxeTKOYxohjJUA=+go.getarcane.app/builds v0.3.0 h1:6fCgHy6PaEr3LpCtiF1iCdT4nuV3D3xvUHnV+E/0cqk=+go.getarcane.app/builds v0.3.0/go.mod h1:yZJDSh9XX/sgZlwx7lghHEucgZeQ74Gr/Fx+XdR2bdk=go.getarcane.app/docker/convert v0.1.0 h1:prlIOs6dMx6CdnetsJFZ6ak0vcistM3DcH5lrZiFHBU=go.getarcane.app/docker/convert v0.1.0/go.mod h1:o9y4z/vah8HiHFtI+jJVFHbs8nLrkARYt88OaUlvGig=go.getarcane.app/streams v0.3.1 h1:Exs9a9G3paM9PnB6DQc8YvIKNbfaUTB7q271SD30zL8=diff --git a/backend/internal/services/build_service.go b/backend/internal/services/build_service.goindex 2b7a5ed5a..6294c8105 100644--- a/backend/internal/services/build_service.go+++ b/backend/internal/services/build_service.go@@ -2,7 +2,6 @@ package servicesimport ("context"- json "encoding/json/v2""fmt""io""log/slog"@@ -16,6 +15,7 @@ import ("github.com/getarcaneapp/arcane/backend/v2/internal/database""github.com/getarcaneapp/arcane/backend/v2/internal/models"+ dockerutils "github.com/getarcaneapp/arcane/backend/v2/pkg/dockerutil"buildgit "github.com/getarcaneapp/arcane/backend/v2/pkg/gitutil""github.com/getarcaneapp/arcane/backend/v2/pkg/pagination"imagetypes "github.com/getarcaneapp/arcane/types/v2/image"@@ -90,10 +90,14 @@ func (s *BuildService) BuildImage(ctx context.Context, environmentID string, reqreturn nil, errors.New("build service not available")}+ // The builder emits raw docker-CLI text. The log capture stores it verbatim+ // for build history; the progress writer gets it framed as {"log":...} lines.logCapture := buildapi.NewLogCapture(buildHistoryOutputLimitBytes)writer := io.Writer(logCapture)+ var logWriter io.WriteCloserif progressWriter != nil {- writer = io.MultiWriter(progressWriter, logCapture)+ logWriter = dockerutils.NewLogLineWriter(progressWriter)+ writer = io.MultiWriter(logWriter, logCapture)}buildRecordID := ""@@ -120,6 +124,9 @@ func (s *BuildService) BuildImage(ctx context.Context, environmentID string, req}completedAt := time.Now()+ if logWriter != nil {+ _ = logWriter.Close()+ }if cleanupErr := cleanupResolvedContext(); cleanupErr != nil {slog.WarnContext(ctx, "failed to cleanup temporary git build context", "error", cleanupErr)}@@ -375,16 +382,12 @@ func writeBuildProgressStatusInternal(progressWriter io.Writer, serviceName, stareturn}- if err := json.MarshalWrite(progressWriter, buildtypes.ProgressEvent{- Type: "build",- Service: serviceName,- Status: status,- }); err != nil {- slog.Debug("failed to write build progress status", "error", err)- return+ line := status+ if service := strings.TrimSpace(serviceName); service != "" {+ line = service + ": " + status}- if _, err := io.WriteString(progressWriter, "\n"); err != nil {- slog.Debug("failed to terminate build progress status", "error", err)+ if _, err := io.WriteString(progressWriter, line+"\n"); err != nil {+ slog.Debug("failed to write build progress status", "error", err)}}diff --git a/backend/internal/services/build_service_test.go b/backend/internal/services/build_service_test.goindex 5f32a8059..65c89059e 100644--- a/backend/internal/services/build_service_test.go+++ b/backend/internal/services/build_service_test.go@@ -3,11 +3,13 @@ package servicesimport ("bytes""context"+ json "encoding/json/v2""errors""io""os""path/filepath""reflect"+ "strings""testing""github.com/getarcaneapp/arcane/backend/v2/internal/database"@@ -384,7 +386,11 @@ func TestBuildService_BuildImage_FailureExporterErrorsAppearInOutputHistoryAndEvassert.Equal(t, "depot", event.Metadata["provider"])assert.Equal(t, "/builds/demo", event.Metadata["contextDir"])assert.Equal(t, buildErr.Error(), event.Metadata["error"])- assert.Equal(t, buildErr.Error(), progress.String())+ // The progress writer is the wire transport: raw builder text arrives framed+ // as {"log":...} NDJSON lines.+ var frame map[string]string+ require.NoError(t, json.Unmarshal([]byte(strings.TrimSpace(progress.String())), &frame))+ assert.Equal(t, buildErr.Error(), frame["log"])assert.Equal(t, buildErr.Error(), *record.ErrorMessage)assert.NotEmpty(t, event.Metadata["buildRecordId"])assert.Equal(t, record.ID, event.Metadata["buildRecordId"])diff --git a/backend/internal/services/container_service.go b/backend/internal/services/container_service.goindex 3af80c062..607e39367 100644--- a/backend/internal/services/container_service.go+++ b/backend/internal/services/container_service.go@@ -155,17 +155,6 @@ func shouldStartRedeployedContainerInternal(containerInfo container.InspectResporeturn shouldStart}-func writeContainerProgressInternal(ctx context.Context, message string, progress int, phase string) {- progressWriter, _ := ctx.Value(projects.ProgressWriterKey{}).(io.Writer)- if progressWriter == nil {- return- }- payload := fmt.Sprintf(`{"type":"container","phase":%q,"status":%q,"progressDetail":{"current":%d,"total":100}}`+"\n", phase, message, progress)- if _, err := progressWriter.Write([]byte(payload)); err != nil {- slog.DebugContext(ctx, "failed to write container progress", "phase", phase, "error", err)- }-}-func (s *ContainerService) pullRedeployImageInternal(ctx context.Context, dockerClient *client.Client, imageName, containerID, containerName string, user models.User) error {settings := s.settingsService.GetSettingsConfig()pullCtx, pullCancel := timeouts.WithTimeout(ctx, settings.DockerImagePullTimeout.AsInt(), timeouts.DefaultDockerImagePull)@@ -208,7 +197,11 @@ func (s *ContainerService) pullRedeployImageInternal(ctx context.Context, docker}defer func() { _ = reader.Close() }()- streamErr := dockerutils.ConsumeJSONMessageStream(reader, nil)+ progressWriter, _ := ctx.Value(dockerutils.ProgressWriterKey{}).(io.Writer)+ logWriter := dockerutils.NewLogLineWriter(progressWriter)+ defer func() { _ = logWriter.Close() }()++ streamErr := dockerutils.RenderJSONMessageStream(reader, logWriter)if streamErr != nil {s.eventService.LogErrorEvent(ctx, models.EventTypeContainerError, "container", containerID, containerName, user.ID, user.Username, "0", streamErr, models.JSON{"action": "redeploy",@@ -626,14 +619,12 @@ func (s *ContainerService) RedeployContainer(ctx context.Context, containerID st}if imageName != "" {- writeContainerProgressInternal(ctx, "Pulling latest container image", 20, "pull")if err := s.pullRedeployImageInternal(ctx, dockerClient, imageName, containerID, containerName, user); err != nil {return "", err}}backupName := buildRedeployBackupNameInternal(containerName, containerID)- writeContainerProgressInternal(ctx, "Preparing existing container", 45, "prepare")if err := s.prepareContainerForRedeployInternal(ctx, dockerClient, containerID, containerName, backupName, wasRunning, user); err != nil {return "", err}@@ -645,7 +636,6 @@ func (s *ContainerService) RedeployContainer(ctx context.Context, containerID stnewConfig.Hostname = ""}- writeContainerProgressInternal(ctx, "Creating replacement container", 65, "create")createResp, err := libarcane.ContainerCreateWithCompatibilityForAPIVersion(ctx, dockerClient, client.ContainerCreateOptions{Config: &newConfig,HostConfig: containerInfo.HostConfig,@@ -663,7 +653,6 @@ func (s *ContainerService) RedeployContainer(ctx context.Context, containerID st}if shouldStartRedeployedContainerInternal(containerInfo, wasRunning) {- writeContainerProgressInternal(ctx, "Starting replacement container", 80, "start")_, err = dockerClient.ContainerStart(ctx, createResp.ID, client.ContainerStartOptions{})if err != nil {if _, removeErr := dockerClient.ContainerRemove(ctx, createResp.ID, client.ContainerRemoveOptions{Force: true}); removeErr != nil {@@ -705,7 +694,6 @@ func (s *ContainerService) RedeployContainer(ctx context.Context, containerID stslog.WarnContext(ctx, "failed to log deploy event", "err", logErr)}- writeContainerProgressInternal(ctx, "Container redeployed", 100, "complete")return createResp.ID, nil}@@ -842,7 +830,10 @@ func (s *ContainerService) CreateContainer(ctx context.Context, config *containe}defer func() { _ = reader.Close() }()- streamErr := dockerutils.ConsumeJSONMessageStream(reader, nil)+ progressWriter, _ := ctx.Value(dockerutils.ProgressWriterKey{}).(io.Writer)+ logWriter := dockerutils.NewLogLineWriter(progressWriter)+ streamErr := dockerutils.RenderJSONMessageStream(reader, logWriter)+ _ = logWriter.Close()if streamErr != nil {s.eventService.LogErrorEvent(ctx, models.EventTypeContainerError, "container", "", containerName, user.ID, user.Username, "0", streamErr, models.JSON{"action": "create", "image": config.Image, "step": "complete_pull"})return nil, errors.WrapIf(streamErr, "failed to complete image pull")diff --git a/backend/internal/services/image_service.go b/backend/internal/services/image_service.goindex 34b3cc401..c45fc3fc6 100644--- a/backend/internal/services/image_service.go+++ b/backend/internal/services/image_service.go@@ -5,7 +5,6 @@ import ("fmt""io""log/slog"- "net/http""strings""time"@@ -198,24 +197,9 @@ func (s *ImageService) PullImage(ctx context.Context, imageName string, progress}defer func() { _ = reader.Close() }()- streamWriter := progressWriter- if streamWriter == nil {- streamWriter = io.Discard- }-- flusher, implementsFlusher := streamWriter.(http.Flusher)- streamErr := dockerutils.ConsumeJSONMessageStream(reader, func(line []byte) error {- if _, writeErr := streamWriter.Write(line); writeErr != nil {- return writeErr- }- if _, writeErr := streamWriter.Write([]byte("\n")); writeErr != nil {- return writeErr- }- if implementsFlusher {- flusher.Flush()- }- return nil- })+ logWriter := dockerutils.NewLogLineWriter(progressWriter)+ streamErr := dockerutils.RenderJSONMessageStream(reader, logWriter)+ _ = logWriter.Close()if streamErr != nil {if errors.Is(streamErr, context.Canceled) || strings.Contains(streamErr.Error(), "context canceled") {slog.Debug("image pull stream canceled", "image", imageName, "err", streamErr)@@ -398,15 +382,7 @@ func (s *ImageService) LoadImageFromReader(ctx context.Context, reader io.Readervar result imagetypes.LoadResultvar responseBuilder strings.Builder- streamErr := dockerutils.ConsumeJSONMessageStream(loadResp, func(line []byte) error {- if _, err := responseBuilder.Write(line); err != nil {- return err- }- if err := responseBuilder.WriteByte('\n'); err != nil {- return err- }- return nil- })+ streamErr := dockerutils.RenderJSONMessageStream(loadResp, &responseBuilder)if streamErr != nil {s.eventService.LogErrorEvent(ctx, models.EventTypeImageError, "image", "", fileName, user.ID, user.Username, "0", streamErr, models.JSON{"action": "load", "file": fileName, "step": "read_response"})return nil, errors.WrapIf(streamErr, "failed to read load response")diff --git a/backend/internal/services/lifecycle_service.go b/backend/internal/services/lifecycle_service.goindex 54261f182..5e361af9c 100644--- a/backend/internal/services/lifecycle_service.go+++ b/backend/internal/services/lifecycle_service.go@@ -371,7 +371,7 @@ func (s *LifecycleService) ensureRunnerImageInternal(ctx context.Context, docker}defer func() { _ = pullReader.Close() }()- if err := dockerutils.ConsumeJSONMessageStream(pullReader, nil); err != nil {+ if err := dockerutils.RenderJSONMessageStream(pullReader, io.Discard); err != nil {return errors.WrapIf(err, "failed to complete runner image pull")}return nildiff --git a/backend/internal/services/project_service.go b/backend/internal/services/project_service.goindex 97022b38a..1de87e39a 100644--- a/backend/internal/services/project_service.go+++ b/backend/internal/services/project_service.go@@ -745,7 +745,7 @@ func (s *ProjectService) composePullSelectedServicesInternal(return nil}- progressWriter, _ := ctx.Value(projects.ProgressWriterKey{}).(io.Writer)+ progressWriter, _ := ctx.Value(dockerutil.ProgressWriterKey{}).(io.Writer)for _, imageRef := range imageRefsToPull {if err := s.pullAndReconcileImageInternal(ctx, imageRef, progressWriter, user, credentials); err != nil {return err@@ -782,26 +782,6 @@ func (s *ProjectService) pullAndReconcileImageInternal(return nil}-type projectProgressSuppressedContextKey struct{}--func withProjectProgressSuppressedInternal(ctx context.Context) context.Context {- return context.WithValue(ctx, projectProgressSuppressedContextKey{}, true)-}--func writeProjectProgressInternal(ctx context.Context, message string, progress int, phase string) {- if suppressed, _ := ctx.Value(projectProgressSuppressedContextKey{}).(bool); suppressed {- return- }- progressWriter, _ := ctx.Value(projects.ProgressWriterKey{}).(io.Writer)- if progressWriter == nil {- return- }- payload := fmt.Sprintf(`{"type":"project","phase":%q,"status":%q,"progressDetail":{"current":%d,"total":100}}`+"\n", phase, message, progress)- if _, err := progressWriter.Write([]byte(payload)); err != nil {- slog.DebugContext(ctx, "failed to write project progress", "phase", phase, "error", err)- }-}-func (s *ProjectService) UpdateProjectServices(ctx context.Context, projectID string, servicesToUpdate []string, user models.User) error {projectFromDb, err := s.GetProjectFromDatabaseByID(ctx, projectID)if err != nil {@@ -829,7 +809,6 @@ func (s *ProjectService) UpdateProjectServices(ctx context.Context, projectID st}// 3. Pull images for specific services- writeProjectProgressInternal(ctx, "Pulling updated service images", 20, "pull")if err := s.composePullSelectedServicesInternal(ctx, compProj, servicesToUpdate, user, credentials); err != nil {if statusErr := s.updateProjectStatusInternal(ctx, projectID, previousStatus); statusErr != nil {slog.ErrorContext(ctx, "UpdateProjectServices: failed to restore project status after compose pull failure", "projectID", projectID, "error", statusErr)@@ -838,24 +817,20 @@ func (s *ProjectService) UpdateProjectServices(ctx context.Context, projectID st}// 4. Stop specific services- writeProjectProgressInternal(ctx, "Stopping selected services", 45, "stop")if err := composeStopProjectServicesInternal(ctx, compProj, servicesToUpdate); err != nil {slog.WarnContext(ctx, "compose stop failed, continuing", "error", err)}// 5. Up specific services- writeProjectProgressInternal(ctx, "Starting selected services", 70, "up")if err := composeUpProjectServicesInternal(ctx, compProj, servicesToUpdate, false, true, s.composeRegistryAuthConfigsInternal(ctx)); err != nil {s.restoreProjectStatusAfterFailedDeployInternal(ctx, projectID)return errors.WrapIf(err, "failed to up services")}// 6. Finalize status- writeProjectProgressInternal(ctx, "Refreshing project status", 90, "status")if err := s.updateProjectStatusandCountsInternal(ctx, projectID, models.ProjectStatusRunning); err != nil {return err}- writeProjectProgressInternal(ctx, "Service update completed", 100, "complete")metadata := models.JSON{"action": "update_services",@@ -2165,7 +2140,7 @@ func (s *ProjectService) DeployProject(ctx context.Context, projectID string, usreturn errors.WrapIf(cerr, "resolve registry credentials")}- progressWriter, _ := ctx.Value(projects.ProgressWriterKey{}).(io.Writer)+ progressWriter, _ := ctx.Value(dockerutil.ProgressWriterKey{}).(io.Writer)if perr := s.prepareProjectImagesForDeploy(ctx, projectID, project, progressWriter, credentials, &user, resolvedPullPolicy); perr != nil {s.restoreProjectStatusAfterFailedDeployInternal(ctx, projectID)return errors.WrapIf(perr, "failed to prepare project images for deploy")@@ -2218,7 +2193,6 @@ func (s *ProjectService) DownProject(ctx context.Context, projectID string, userreturn errors.WrapIf(err, "failed to update project status to stopping")}- writeProjectProgressInternal(ctx, "Stopping project services", 45, "down")if err := projects.ComposeDown(ctx, proj, false); err != nil {_ = s.updateProjectStatusInternal(ctx, projectID, models.ProjectStatusRunning)return errors.WrapIf(err, "failed to bring down project")@@ -2231,12 +2205,7 @@ func (s *ProjectService) DownProject(ctx context.Context, projectID string, user}s.logProjectEventInternal(ctx, models.EventTypeProjectStop, projectID, projectFromDb.Name, user, metadata, "could not log project down action")- writeProjectProgressInternal(ctx, "Refreshing project status", 90, "status")- if err := s.updateProjectStatusandCountsInternal(ctx, projectID, models.ProjectStatusStopped); err != nil {- return err- }- writeProjectProgressInternal(ctx, "Project stopped", 100, "complete")- return nil+ return s.updateProjectStatusandCountsInternal(ctx, projectID, models.ProjectStatusStopped)}func (s *ProjectService) CreateProject(ctx context.Context, name, composeContent string, envContent *string, projectFiles []project.ProjectFileDraft, user models.User) (*models.Project, error) {@@ -2334,13 +2303,11 @@ func (s *ProjectService) DestroyProject(ctx context.Context, projectID string, r"projectName", proj.Name,"projectPath", proj.Path)- writeProjectProgressInternal(ctx, "Stopping project before destroy", 25, "down")- if err := s.DownProject(withProjectProgressSuppressedInternal(ctx), projectID, systemUser); err != nil {+ if err := s.DownProject(ctx, projectID, systemUser); err != nil {slog.WarnContext(ctx, "failed to bring down project", "error", err)}if removeVolumes {- writeProjectProgressInternal(ctx, "Removing project volumes", 55, "volumes")if compProj, _, lerr := s.loadComposeProjectForProjectInternal(ctx, proj, nil); lerr == nil {if derr := projects.ComposeDown(ctx, compProj, true); derr != nil {slog.WarnContext(ctx, "failed to remove volumes", "error", derr)@@ -2351,7 +2318,6 @@ func (s *ProjectService) DestroyProject(ctx context.Context, projectID string, r}if removeFiles {- writeProjectProgressInternal(ctx, "Removing project files", 75, "files")slog.DebugContext(ctx, "Removing project files", "path", proj.Path)if err := os.RemoveAll(proj.Path); err != nil {slog.ErrorContext(ctx, "Failed to remove project files", "path", proj.Path, "error", err)@@ -2377,7 +2343,6 @@ func (s *ProjectService) DestroyProject(ctx context.Context, projectID string, r}}s.invalidateComposeCacheInternal(projectID)- writeProjectProgressInternal(ctx, "Project destroyed", 100, "complete")metadata := models.JSON{"action": "destroy", "projectID": projectID, "projectName": proj.Name, "removeFiles": removeFiles, "removeVolumes": removeVolumes}s.logProjectEventInternal(ctx, models.EventTypeProjectDelete, projectID, proj.Name, user, metadata, "could not log project destroy action")@@ -2396,13 +2361,10 @@ func (s *ProjectService) RedeployProject(ctx context.Context, projectID string,return errors.New("arcane cannot redeploy itself; use the system upgrade flow (Settings -> Updates) instead")}- progressWriter, _ := ctx.Value(projects.ProgressWriterKey{}).(io.Writer)+ progressWriter, _ := ctx.Value(dockerutil.ProgressWriterKey{}).(io.Writer)if progressWriter == nil {progressWriter = io.Discard}- if _, writeErr := progressWriter.Write([]byte(`{"type":"deploy","phase":"pull","status":"pulling project images"}` + "\n")); writeErr != nil {- slog.DebugContext(ctx, "failed to write redeploy pull progress", "error", writeErr)- }credentials, cerr := s.resolveRegistryCredentialsInternal(ctx)if cerr != nil {@@ -2415,10 +2377,6 @@ func (s *ProjectService) RedeployProject(ctx context.Context, projectID string,metadata := models.JSON{"action": "redeploy", "projectID": projectID, "projectName": proj.Name}s.logProjectEventInternal(ctx, models.EventTypeProjectDeploy, projectID, proj.Name, user, metadata, "could not log project redeploy action")- if _, writeErr := progressWriter.Write([]byte(`{"type":"deploy","phase":"up","status":"starting project deployment"}` + "\n")); writeErr != nil {- slog.DebugContext(ctx, "failed to write redeploy deploy progress", "error", writeErr)- }-return s.DeployProject(ctx, projectID, user, options)}@@ -2868,7 +2826,6 @@ func (s *ProjectService) RestartProject(ctx context.Context, projectID string, sreturn errors.WrapIf(lerr, "failed to load compose project")}- writeProjectProgressInternal(ctx, "Restarting project services", 55, "restart")if err := projects.ComposeRestart(ctx, compProj, services); err != nil {_ = s.updateProjectStatusInternal(ctx, projectID, models.ProjectStatusRunning)return errors.WrapIf(err, "failed to restart project")@@ -2884,12 +2841,7 @@ func (s *ProjectService) RestartProject(ctx context.Context, projectID string, s}s.logProjectEventInternal(ctx, models.EventTypeProjectStart, projectID, proj.Name, user, metadata, "could not log project restart action")- writeProjectProgressInternal(ctx, "Refreshing project status", 90, "status")- if err := s.updateProjectStatusandCountsInternal(ctx, projectID, models.ProjectStatusRunning); err != nil {- return err- }- writeProjectProgressInternal(ctx, "Project restarted", 100, "complete")- return nil+ return s.updateProjectStatusandCountsInternal(ctx, projectID, models.ProjectStatusRunning)}func (s *ProjectService) UpdateProject(ctx context.Context, projectID string, name *string, composeContent, envContent, overrideContent *string, fileTreeRevision *string, fileChanges []project.ProjectFileChange, user models.User) (*models.Project, error) {@@ -4199,8 +4151,8 @@ func (s *ProjectService) StreamProjectLogs(ctx context.Context, projectID string// Writer goroutine: compose logs -> pipego func() {- // since/timestamps not currently supported by ComposeLogs helper; follow/tail are used.- err := projects.ComposeLogs(ctx, projects.NormalizeProjectName(proj.Name), pw, follow, tail)+ // timestamps not currently supported by ComposeLogs helper; follow/tail/since are used.+ err := projects.ComposeLogs(ctx, projects.NormalizeProjectName(proj.Name), pw, follow, tail, since)_ = pw.Close()done <- err}()diff --git a/backend/internal/services/project_service_test.go b/backend/internal/services/project_service_test.goindex 66b93d083..96283b1f2 100644--- a/backend/internal/services/project_service_test.go+++ b/backend/internal/services/project_service_test.go@@ -1,7 +1,6 @@package servicesimport (- "bytes""context""encoding/json""errors"@@ -47,17 +46,6 @@ import ("github.com/getarcaneapp/arcane/backend/v2/internal/models")-func TestWriteProjectProgressInternal_SuppressedContextSkipsProgress(t *testing.T) {- ctx := context.Background()- var buf bytes.Buffer- ctx = context.WithValue(ctx, projects.ProgressWriterKey{}, &buf)- ctx = withProjectProgressSuppressedInternal(ctx)-- writeProjectProgressInternal(ctx, "Project stopped", 100, "complete")-- require.Empty(t, buf.String())-}-type testBuildBuilder struct {err error}diff --git a/backend/internal/services/system_upgrade_service.go b/backend/internal/services/system_upgrade_service.goindex 96c7f0fc2..adedcb12a 100644--- a/backend/internal/services/system_upgrade_service.go+++ b/backend/internal/services/system_upgrade_service.go@@ -4,6 +4,7 @@ import ("context"stderrors "errors""fmt"+ "io""log/slog""net/http""os"@@ -174,7 +175,7 @@ func (s *SystemUpgradeService) TriggerUpgradeViaCLI(ctx context.Context, user moreturn errors.WrapIf(err, "pull upgrader image")}// Drain and validate the JSON stream to complete the pull.- if err := dockerutils.ConsumeJSONMessageStream(pullReader, nil); err != nil {+ if err := dockerutils.RenderJSONMessageStream(pullReader, io.Discard); err != nil {_ = pullReader.Close()return errors.WrapIf(err, "failed to complete upgrader image pull")}diff --git a/backend/internal/services/vulnerability_service.go b/backend/internal/services/vulnerability_service.goindex cb9ba3c40..cafdd87fe 100644--- a/backend/internal/services/vulnerability_service.go+++ b/backend/internal/services/vulnerability_service.go@@ -2082,7 +2082,7 @@ func (s *VulnerabilityService) ensureTrivyImageInternal(ctx context.Context) (st}return "", errors.WrapIff(err, "pull scanner image %s", trivyImage)}- if err := dockerutils.ConsumeJSONMessageStream(pullReader, nil); err != nil {+ if err := dockerutils.RenderJSONMessageStream(pullReader, io.Discard); err != nil {_ = pullReader.Close()return "", errors.WrapIf(err, "failed to complete scanner image pull")}diff --git a/backend/pkg/dockerutil/jsonstream.go b/backend/pkg/dockerutil/jsonstream.godeleted file mode 100644index 3c23f6ae6..000000000--- a/backend/pkg/dockerutil/jsonstream.go+++ /dev/null@@ -1,40 +0,0 @@-package docker--import (- "bufio"- json "encoding/json/v2"- "io"-- "github.com/moby/moby/api/types/jsonstream"-)--// ConsumeJSONMessageStream drains a Docker JSON message stream and returns any daemon-reported error.-// Optional lineHandler receives each raw line before parsing.-func ConsumeJSONMessageStream(reader io.Reader, lineHandler func([]byte) error) error {- scanner := bufio.NewScanner(reader)- scanner.Buffer(make([]byte, 0, 64*1024), 4*1024*1024)-- for scanner.Scan() {- line := scanner.Bytes()- if lineHandler != nil {- if err := lineHandler(line); err != nil {- return err- }- }-- var msg jsonstream.Message- if err := json.Unmarshal(line, &msg); err != nil {- // Keep behavior resilient to any non-JSON line noise.- continue- }- if msg.Error != nil {- return msg.Error- }- }-- if err := scanner.Err(); err != nil {- return err- }-- return nil-}diff --git a/backend/pkg/dockerutil/jsonstream_test.go b/backend/pkg/dockerutil/jsonstream_test.godeleted file mode 100644index 783a6a552..000000000--- a/backend/pkg/dockerutil/jsonstream_test.go+++ /dev/null@@ -1,33 +0,0 @@-package docker--import (- "strings"- "testing"-)--func TestConsumeJSONMessageStream(t *testing.T) {- t.Run("streams lines and succeeds without daemon error", func(t *testing.T) {- stream := strings.NewReader(`{"status":"Pulling fs layer","id":"layer1"}` + "\n")- seen := 0-- err := ConsumeJSONMessageStream(stream, func(_ []byte) error {- seen++- return nil- })- if err != nil {- t.Fatalf("expected nil error, got %v", err)- }- if seen != 1 {- t.Fatalf("expected line handler to be called once, got %d", seen)- }- })-- t.Run("returns structured errorDetail from daemon", func(t *testing.T) {- stream := strings.NewReader(`{"errorDetail":{"code":401,"message":"unauthorized"}}` + "\n")- err := ConsumeJSONMessageStream(stream, nil)- if err == nil || !strings.Contains(err.Error(), "unauthorized") {- t.Fatalf("expected unauthorized error, got %v", err)- }- })--}diff --git a/backend/pkg/dockerutil/progress.go b/backend/pkg/dockerutil/progress.gonew file mode 100644index 000000000..d26f95b5a--- /dev/null+++ b/backend/pkg/dockerutil/progress.go@@ -0,0 +1,82 @@+package docker++import (+ "bytes"+ json "encoding/json/v2"+ "io"+ "strings"+ "sync"+)++// ProgressWriterKey can be set on a context to stream operation output to the+// client. The value must be an io.Writer (typically an activity writer wrapping+// the HTTP response writer).+type ProgressWriterKey struct{}++type flusher interface{ Flush() }++// NewLogLineWriter returns a writer that splits everything written to it on+// newlines and emits each line as a {"log":"<line>"} NDJSON frame to dst,+// flushing after each frame when dst supports it. Close flushes any trailing+// partial line as a final frame. Writers such as compose's plain progress+// renderer and jsonmessage.DisplayJSONMessagesStream write raw CLI text into+// this to put docker-CLI-parity output on the wire.+func NewLogLineWriter(dst io.Writer) io.WriteCloser {+ if dst == nil || dst == io.Discard {+ return nopWriteCloser{io.Discard}+ }+ return &logLineWriter{dst: dst}+}++type nopWriteCloser struct{ io.Writer }++func (nopWriteCloser) Close() error { return nil }++type logLineWriter struct {+ dst io.Writer++ // Writers such as compose's plain progress renderer write from multiple+ // goroutines concurrently; the line buffer must be guarded.+ mu sync.Mutex+ buffer []byte+}++func (w *logLineWriter) Write(p []byte) (int, error) {+ w.mu.Lock()+ defer w.mu.Unlock()++ w.buffer = append(w.buffer, p...)+ for {+ idx := bytes.IndexByte(w.buffer, '\n')+ if idx < 0 {+ break+ }+ line := string(w.buffer[:idx])+ w.buffer = w.buffer[idx+1:]+ w.emitLine(line)+ }+ return len(p), nil+}++func (w *logLineWriter) Close() error {+ w.mu.Lock()+ defer w.mu.Unlock()++ if len(w.buffer) > 0 {+ w.emitLine(string(w.buffer))+ w.buffer = nil+ }+ return nil+}++func (w *logLineWriter) emitLine(line string) {+ line = strings.TrimSuffix(line, "\r")+ frame, err := json.Marshal(map[string]string{"log": line})+ if err != nil {+ return+ }+ _, _ = w.dst.Write(append(frame, '\n'))+ if f, ok := w.dst.(flusher); ok {+ f.Flush()+ }+}diff --git a/backend/pkg/dockerutil/render.go b/backend/pkg/dockerutil/render.gonew file mode 100644index 000000000..548c29f72--- /dev/null+++ b/backend/pkg/dockerutil/render.go@@ -0,0 +1,17 @@+package docker++import (+ "io"++ "github.com/moby/moby/client/pkg/jsonmessage"+)++// RenderJSONMessageStream renders a Docker JSON message stream (image pull,+// push, build, load) as the raw text the docker CLI prints in non-TTY mode,+// writing it to out. Any daemon-reported error is returned verbatim.+func RenderJSONMessageStream(reader io.Reader, out io.Writer) error {+ if out == nil {+ out = io.Discard+ }+ return jsonmessage.DisplayJSONMessagesStream(reader, out, 0, false, nil)+}diff --git a/backend/pkg/dockerutil/render_test.go b/backend/pkg/dockerutil/render_test.gonew file mode 100644index 000000000..9209167ad--- /dev/null+++ b/backend/pkg/dockerutil/render_test.go@@ -0,0 +1,93 @@+package docker++import (+ "strings"+ "sync"+ "testing"+)++func TestRenderJSONMessageStream(t *testing.T) {+ t.Run("renders docker CLI text for pull messages", func(t *testing.T) {+ stream := strings.NewReader(+ `{"status":"Pulling from library/nginx","id":"stable-alpine"}` + "\n" ++ `{"status":"Pull complete","id":"abc123"}` + "\n" ++ `{"status":"Status: Downloaded newer image for nginx:stable-alpine"}` + "\n")+ var out strings.Builder++ if err := RenderJSONMessageStream(stream, &out); err != nil {+ t.Fatalf("expected nil error, got %v", err)+ }+ want := "stable-alpine: Pulling from library/nginx\n" ++ "abc123: Pull complete\n" ++ "Status: Downloaded newer image for nginx:stable-alpine\n"+ if out.String() != want {+ t.Fatalf("expected CLI-parity output %q, got %q", want, out.String())+ }+ })++ t.Run("returns daemon errorDetail verbatim", func(t *testing.T) {+ stream := strings.NewReader(`{"errorDetail":{"code":401,"message":"unauthorized"}}` + "\n")+ err := RenderJSONMessageStream(stream, nil)+ if err == nil || !strings.Contains(err.Error(), "unauthorized") {+ t.Fatalf("expected unauthorized error, got %v", err)+ }+ })+}++// Compose's plain progress renderer writes from multiple goroutines; the+// writer must tolerate concurrent writes without corrupting its buffer.+func TestLogLineWriterConcurrentWrites(t *testing.T) {+ var out syncBuffer+ w := NewLogLineWriter(&out)++ var wg sync.WaitGroup+ for range 8 {+ wg.Add(1)+ go func() {+ defer wg.Done()+ for range 200 {+ _, _ = w.Write([]byte("Container test Created\n"))+ }+ }()+ }+ wg.Wait()+ _ = w.Close()++ lines := strings.Split(strings.TrimSpace(out.String()), "\n")+ if len(lines) != 8*200 {+ t.Fatalf("expected %d frames, got %d", 8*200, len(lines))+ }+}++type syncBuffer struct {+ mu sync.Mutex+ buf strings.Builder+}++func (b *syncBuffer) Write(p []byte) (int, error) {+ b.mu.Lock()+ defer b.mu.Unlock()+ return b.buf.Write(p)+}++func (b *syncBuffer) String() string {+ b.mu.Lock()+ defer b.mu.Unlock()+ return b.buf.String()+}++func TestLogLineWriter(t *testing.T) {+ var out strings.Builder+ w := NewLogLineWriter(&out)++ _, _ = w.Write([]byte("Container arcane-test Creating\nContainer arcane"))+ _, _ = w.Write([]byte("-test Created\npartial"))+ _ = w.Close()++ want := `{"log":"Container arcane-test Creating"}` + "\n" ++ `{"log":"Container arcane-test Created"}` + "\n" ++ `{"log":"partial"}` + "\n"+ if out.String() != want {+ t.Fatalf("expected framed lines %q, got %q", want, out.String())+ }+}diff --git a/backend/pkg/libarcane/activity/handler.go b/backend/pkg/libarcane/activity/handler.goindex cee520733..9c83fa075 100644--- a/backend/pkg/libarcane/activity/handler.go+++ b/backend/pkg/libarcane/activity/handler.go@@ -6,6 +6,7 @@ import ("fmt""io""log/slog"+ "net/http""strings""emperror.dev/errors"@@ -208,6 +209,19 @@ func RunHandlerActivity(ctx context.Context, activityService Service, opts Handlreturn activityID, err}+// WriteDoneLine writes the terminal success frame of an operation NDJSON+// stream. Clients resolve on this frame rather than relying on the network+// EOF, which proxies do not always propagate promptly.+func WriteDoneLine(writer io.Writer) {+ if writer == nil {+ return+ }+ _, _ = io.WriteString(writer, `{"done":true}`+"\n")+ if flusher, ok := writer.(http.Flusher); ok {+ flusher.Flush()+ }+}+func WriteStartedLine(writer io.Writer, activityID string) {if writer == nil || strings.TrimSpace(activityID) == "" {returndiff --git a/backend/pkg/libarcane/activity/writer.go b/backend/pkg/libarcane/activity/writer.goindex 9c1182acc..1930ff96d 100644--- a/backend/pkg/libarcane/activity/writer.go+++ b/backend/pkg/libarcane/activity/writer.go@@ -3,7 +3,6 @@ package activityimport ("bytes""context"- stdjson "encoding/json"json "encoding/json/v2""fmt""io"@@ -25,23 +24,15 @@ type Writer struct {mu sync.Mutexbuffer []byte- layers map[string]layerProgress}const writerAppendQueueSize = 128-type layerProgress struct {- current int64- total int64- status string-}-type writerAppendMessage struct {- level models.ActivityMessageLevel- message string- payload models.JSON- progress *int- step string+ level models.ActivityMessageLevel+ message string+ payload models.JSON+ step string}type writerQueueItem struct {@@ -66,7 +57,6 @@ func NewWriter(ctx context.Context, activityService MessageAppender, activityIDwriter: writer,defaultStep: strings.TrimSpace(defaultStep),queueCh: make(chan writerQueueItem, writerAppendQueueSize),- layers: map[string]layerProgress{},}go out.drainMessagesInternal(ctx)return out@@ -120,6 +110,9 @@ func (w *Writer) Flush() {}}+// processLineInternal records stream lines as activity messages verbatim.+// Docker operation output arrives as {"log":"<raw CLI line>"} frames; terminal+// failures as {"error":"..."} frames. Anything else passes through untouched.func (w *Writer) processLineInternal(line string) mo.Option[writerAppendMessage] {if line == "" || w.activityService == nil || w.activityID == "" {return mo.None[writerAppendMessage]()@@ -134,99 +127,33 @@ func (w *Writer) processLineInternal(line string) mo.Option[writerAppendMessage]})}- message, level, step, progress := w.describePayloadInternal(payload)- if message == "" {- return mo.None[writerAppendMessage]()- }- return mo.Some(writerAppendMessage{- level: level,- message: message,- payload: models.JSON(payload),- progress: progress,- step: step,- })-}--func (w *Writer) describePayloadInternal(payload map[string]any) (string, models.ActivityMessageLevel, string, *int) {- level := models.ActivityMessageLevelInfo- step := w.defaultStep-if errorValue, ok := payload["error"]; ok && errorValue != nil {- level = models.ActivityMessageLevelError- return valueToStringInternal(errorValue), level, step, nil- }-- if typ := strings.TrimSpace(valueToStringInternal(payload["type"])); typ != "" {- if typ == "container" {- return containerEventMessageInternal(payload), level, step, nil- }- if phase := strings.TrimSpace(valueToStringInternal(payload["phase"])); phase != "" {- step = phaseStepInternal(typ, phase, step)- progress := phaseProgressInternal(phase, payload["progressDetail"])- return phaseMessageInternal(typ, phase, payload), level, step, progress- }- }-- if stream := strings.TrimSpace(valueToStringInternal(payload["stream"])); stream != "" {- return stream, level, fallbackStepInternal(step, "Building image"), nil- }-- status := strings.TrimSpace(valueToStringInternal(payload["status"]))- id := strings.TrimSpace(valueToStringInternal(payload["id"]))- progressText := strings.TrimSpace(valueToStringInternal(payload["progress"]))- progress := w.updateLayerProgressInternal(id, status, payload["progressDetail"])-- if status != "" {- parts := []string{status}- if id != "" {- parts = append(parts, id)- }- if progressText != "" {- parts = append(parts, progressText)- }- return strings.Join(parts, " · "), level, statusStepInternal(status, step), progress- }-- return "", level, step, nil-}--func (w *Writer) updateLayerProgressInternal(id, status string, rawDetail any) *int {- if id == "" {- return nil- }-- layer := w.layers[id]- layer.status = status- if detail, ok := rawDetail.(map[string]any); ok {- layer.current = numberToInt64Internal(detail["current"])- layer.total = numberToInt64Internal(detail["total"])- }- w.layers[id] = layer-- if len(w.layers) == 0 {- return nil+ return mo.Some(writerAppendMessage{+ level: models.ActivityMessageLevelError,+ message: valueToStringInternal(errorValue),+ payload: models.JSON(payload),+ step: w.defaultStep,+ })}- var weighted float64- for _, item := range w.layers {- statusLower := strings.ToLower(item.status)- switch {- case layerCompleteInternal(statusLower):- weighted++- case strings.Contains(statusLower, "extracting"):- weighted += 0.95- case strings.Contains(statusLower, "verifying"):- weighted += 0.92- case strings.Contains(statusLower, "download complete"):- weighted += 0.85- case item.total > 0:- weighted += min((float64(item.current)/float64(item.total))*0.85, 0.85)- case strings.Contains(statusLower, "downloading") || strings.Contains(statusLower, "pulling"):- weighted += 0.05+ if logValue, ok := payload["log"]; ok {+ message := valueToStringInternal(logValue)+ if strings.TrimSpace(message) == "" {+ return mo.None[writerAppendMessage]()}+ return mo.Some(writerAppendMessage{+ level: models.ActivityMessageLevelInfo,+ message: message,+ step: w.defaultStep,+ })}- return new(max(min(int((weighted/float64(len(w.layers)))*100), 100), 0))+ return mo.Some(writerAppendMessage{+ level: models.ActivityMessageLevelInfo,+ message: line,+ payload: models.JSON(payload),+ step: w.defaultStep,+ })}func (w *Writer) enqueueMessageInternal(message writerAppendMessage) {@@ -268,11 +195,10 @@ func (w *Writer) appendMessageInternal(ctx context.Context, message writerAppendreturn}if _, err := w.activityService.AppendMessage(ctx, w.activityID, AppendMessageRequest{- Level: message.level,- Message: message.message,- Payload: message.payload,- Progress: message.progress,- Step: message.step,+ Level: message.level,+ Message: message.message,+ Payload: message.payload,+ Step: message.step,}); err != nil {return}@@ -290,140 +216,3 @@ func valueToStringInternal(value any) string {return fmt.Sprint(typed)}}--func numberToInt64Internal(value any) int64 {- switch typed := value.(type) {- case float64:- return int64(typed)- case float32:- return int64(typed)- case int64:- return typed- case int:- return int64(typed)- case stdjson.Number:- out, _ := typed.Int64()- return out- default:- return 0- }-}--func layerCompleteInternal(status string) bool {- return strings.Contains(status, "pull complete") ||- strings.Contains(status, "already exists") ||- strings.Contains(status, "downloaded newer image") ||- strings.Contains(status, "image is up to date")-}--func statusStepInternal(status, fallback string) string {- lower := strings.ToLower(status)- switch {- case strings.Contains(lower, "downloading") || strings.Contains(lower, "pulling"):- return "Downloading layers"- case strings.Contains(lower, "extracting"):- return "Extracting layers"- case strings.Contains(lower, "verifying") || strings.Contains(lower, "digest"):- return "Verifying image"- case strings.Contains(lower, "building"):- return "Building image"- }- return fallback-}--func phaseStepInternal(typ, phase, fallback string) string {- switch typ {- case "deploy":- switch phase {- case "begin":- return "Starting deployment"- case "complete":- return "Deployment complete"- default:- return "Deploying services"- }- case "build":- switch phase {- case "begin":- return "Starting build"- case "complete":- return "Build complete"- default:- return "Building image"- }- }- return fallback-}--func phaseMessageInternal(typ, phase string, payload map[string]any) string {- if status := strings.TrimSpace(valueToStringInternal(payload["status"])); status != "" {- return status- }- if service := strings.TrimSpace(valueToStringInternal(payload["service"])); service != "" {- return fmt.Sprintf("%s %s: %s", typ, phase, service)- }- return fmt.Sprintf("%s %s", typ, phase)-}--func phaseProgressInternal(phase string, rawDetail any) *int {- switch phase {- case "begin":- return new(5)- case "complete":- return new(100)- default:- return progressDetailPercentInternal(rawDetail)- }-}--func progressDetailPercentInternal(rawDetail any) *int {- detail, ok := rawDetail.(map[string]any)- if !ok {- return nil- }-- current := numberToInt64Internal(detail["current"])- total := numberToInt64Internal(detail["total"])-- var progress int64- switch {- case total > 0:- progress = (current * 100) / total- default:- progress = current- }-- if progress < 0 {- progress = 0- }- if progress > 100 {- progress = 100- }-- return new(int(progress))-}--func containerEventMessageInternal(payload map[string]any) string {- service := strings.TrimSpace(valueToStringInternal(payload["service"]))- state := strings.TrimSpace(valueToStringInternal(payload["state"]))- status := strings.TrimSpace(valueToStringInternal(payload["status"]))-- if service == "" {- service = "unknown"- }-- if status != "" {- return fmt.Sprintf("Container %s: %s", service, status)- }- if state != "" {- return fmt.Sprintf("Container %s: %s", service, state)- }- return "Container " + service-}--func fallbackStepInternal(value, fallback string) string {- if strings.TrimSpace(value) != "" {- return value- }- return fallback-}diff --git a/backend/pkg/libarcane/activity/writer_test.go b/backend/pkg/libarcane/activity/writer_test.goindex 76e76a7a8..9e5fe9bf5 100644--- a/backend/pkg/libarcane/activity/writer_test.go+++ b/backend/pkg/libarcane/activity/writer_test.go@@ -43,6 +43,23 @@ func TestWriterContinuesActivityCaptureWhenResponseWriterFailsInternal(t *testinrequire.Equal(t, models.ActivityMessageLevelInfo, appender.messages[0].Level)}+func TestWriterRecordsLogAndErrorFramesVerbatimInternal(t *testing.T) {+ appender := &recordingAppender{}+ writer := NewWriter(context.Background(), appender, "activity-1", io.Discard, "Deploying project")++ _, err := writer.Write([]byte(`{"log":"Container web-1 Created"}` + "\n" + `{"error":"Error response from daemon: conflict"}` + "\n"))+ require.NoError(t, err)++ FlushWriter(writer)+ require.Eventually(t, func() bool {+ return len(appender.messages) == 2+ }, time.Second, 10*time.Millisecond)+ require.Equal(t, "Container web-1 Created", appender.messages[0].Message)+ require.Equal(t, models.ActivityMessageLevelInfo, appender.messages[0].Level)+ require.Equal(t, "Error response from daemon: conflict", appender.messages[1].Message)+ require.Equal(t, models.ActivityMessageLevelError, appender.messages[1].Level)+}+func TestWriterReturnsWrappedWriteErrorWithoutActivityInternal(t *testing.T) {writer := NewWriter(context.Background(), nil, "", failingWriter{}, "Pulling image")diff --git a/backend/pkg/projects/cmds.go b/backend/pkg/projects/cmds.goindex 71cd3ded5..c0b1ef589 100644--- a/backend/pkg/projects/cmds.go+++ b/backend/pkg/projects/cmds.go@@ -2,9 +2,7 @@ package projectsimport ("context"- json "encoding/json/v2""io"- "strings""time""github.com/compose-spec/compose-go/v2/types"@@ -16,26 +14,6 @@ import ("github.com/getarcaneapp/arcane/backend/v2/pkg/utils")-// ProgressWriterKey can be set on a context to enable JSON-line progress updates.-// The value must be an io.Writer (typically the HTTP response writer).-type ProgressWriterKey struct{}--type flusher interface{ Flush() }--func writeJSONLine(w io.Writer, v any) {- if w == nil {- return- }- b, err := json.Marshal(v)- if err != nil {- return- }- _, _ = w.Write(append(b, '\n'))- if f, ok := w.(flusher); ok {- f.Flush()- }-}-// defaultComposeTimeout is applied to compose operations that have been// detached from the HTTP request context. It must be generous enough to// cover large image pulls + health-check waits.@@ -43,10 +21,10 @@ const defaultComposeTimeout = 30 * time.Minute// detachFromHTTPContextInternal creates a new context derived from// context.WithoutCancel(parent) that carries any values from the parent-// (such as ProgressWriterKey) but is **not** cancelled or deadline-bounded-// by the parent. This allows compose operations to survive HTTP request-// timeouts and proxy deadline cancellations. A standalone timeout is applied-// so the operation cannot run forever. See #1209.+// (such as dockerutils.ProgressWriterKey) but is **not** cancelled or+// deadline-bounded by the parent. This allows compose operations to survive+// HTTP request timeouts and proxy deadline cancellations. A standalone timeout+// is applied so the operation cannot run forever. See #1209.func detachFromHTTPContextInternal(parent context.Context) (context.Context, context.CancelFunc) {if utils.IsAppLifecycleContext(parent) {return context.WithTimeout(parent, defaultComposeTimeout)@@ -65,10 +43,7 @@ func ComposeRestart(ctx context.Context, proj *types.Project, services []string)}defer func() { _ = c.Close() }()- progressWriter, _ := ctx.Value(ProgressWriterKey{}).(io.Writer)- return runWithContainerPolling(restartCtx, c.svc, proj.Name, progressWriter, func() error {- return c.svc.Restart(restartCtx, proj.Name, api.RestartOptions{Project: proj, Services: services})- })+ return c.svc.Restart(restartCtx, proj.Name, api.RestartOptions{Project: proj, Services: services})}func ComposeStop(ctx context.Context, proj *types.Project, services []string) error {@@ -84,10 +59,7 @@ func ComposeStop(ctx context.Context, proj *types.Project, services []string) er}defer func() { _ = c.Close() }()- progressWriter, _ := ctx.Value(ProgressWriterKey{}).(io.Writer)- return runWithContainerPolling(stopCtx, c.svc, proj.Name, progressWriter, func() error {- return c.svc.Stop(stopCtx, proj.Name, api.StopOptions{Services: services})- })+ return c.svc.Stop(stopCtx, proj.Name, api.StopOptions{Services: services})}func ComposeUp(ctx context.Context, proj *types.Project, services []string, removeOrphans bool, forceRecreate bool, authConfigs map[string]registry.AuthConfig) error {@@ -102,16 +74,9 @@ func ComposeUp(ctx context.Context, proj *types.Project, services []string, remo}defer func() { _ = c.Close() }()- progressWriter, _ := ctx.Value(ProgressWriterKey{}).(io.Writer)-upOptions, startOptions := composeUpOptions(proj, services, removeOrphans, forceRecreate)- // If we don't need progress, just run compose up normally.- if progressWriter == nil {- return c.svc.Up(composeCtx, proj, api.UpOptions{Create: upOptions, Start: startOptions})- }-- return composeUpWithProgress(composeCtx, c.svc, proj, api.UpOptions{Create: upOptions, Start: startOptions}, progressWriter)+ return c.svc.Up(composeCtx, proj, api.UpOptions{Create: upOptions, Start: startOptions})}func composeUpOptions(proj *types.Project, services []string, removeOrphans bool, forceRecreate bool) (api.CreateOptions, api.StartOptions) {@@ -142,158 +107,6 @@ func composeUpOptions(proj *types.Project, services []string, removeOrphans boolreturn upOptions, startOptions}-func composeUpWithProgress(ctx context.Context, svc api.Compose, proj *types.Project, opts api.UpOptions, progressWriter io.Writer) error {- writeJSONLine(progressWriter, map[string]any{"type": "deploy", "phase": "begin"})-- // Poll in a goroutine while compose up runs on the calling goroutine.- runCtx, cancel := context.WithCancel(ctx)- defer cancel()-- pollDone := make(chan struct{})- go func() {- defer close(pollDone)- pollDeployProgress(runCtx, svc, proj.Name, progressWriter)- }()-- err := svc.Up(runCtx, proj, opts)- cancel()- <-pollDone- return err-}--func pollDeployProgress(ctx context.Context, svc api.Compose, projectName string, progressWriter io.Writer) {- ticker := time.NewTicker(800 * time.Millisecond)- defer ticker.Stop()-- // Dedupe emitted events so we don't spam the UI.- lastSig := map[string]string{}-- for {- select {- case <-ctx.Done():- return- case <-ticker.C:- containers, err := svc.Ps(ctx, projectName, api.PsOptions{All: true})- if err != nil {- // Compose may still be creating containers.- continue- }- for _, cs := range containers {- emitDeployContainerUpdate(progressWriter, lastSig, cs)- }- }- }-}--func emitDeployContainerUpdate(w io.Writer, lastSig map[string]string, cs api.ContainerSummary) {- name := strings.TrimSpace(cs.Service)- if name == "" {- name = strings.TrimSpace(cs.Name)- }- if name == "" {- return- }-- phase := deployPhaseFromSummary(cs)- status := strings.TrimSpace(cs.Status)- sig := strings.Join([]string{phase, string(cs.State), string(cs.Health), status}, "|")- if lastSig[name] == sig {- return- }- lastSig[name] = sig-- payload := map[string]any{- "type": "deploy",- "phase": phase,- "service": name,- "state": string(cs.State),- "health": string(cs.Health),- }- if status != "" {- payload["status"] = status- }- writeJSONLine(w, payload)-}--func deployPhaseFromSummary(cs api.ContainerSummary) string {- state := strings.ToLower(strings.TrimSpace(string(cs.State)))- health := strings.ToLower(strings.TrimSpace(string(cs.Health)))-- switch {- case state == "running" && health == "healthy":- return "service_healthy"- case health == "starting", health == "unhealthy":- return "service_waiting_healthy"- case state != "running" && state != "":- return "service_state"- default:- return "service_status"- }-}--func runWithContainerPolling(ctx context.Context, svc api.Compose, projectName string, progressWriter io.Writer, operation func() error) error {- if progressWriter == nil {- return operation()- }-- pollCtx, cancel := context.WithCancel(ctx)- defer cancel()-- pollDone := make(chan struct{})- go func() {- defer close(pollDone)- pollContainerStatus(pollCtx, svc, projectName, progressWriter)- }()-- err := operation()- cancel()- <-pollDone- return err-}--func pollContainerStatus(ctx context.Context, svc api.Compose, projectName string, progressWriter io.Writer) {- ticker := time.NewTicker(300 * time.Millisecond)- defer ticker.Stop()-- lastState := map[string]string{}-- for {- select {- case <-ctx.Done():- return- case <-ticker.C:- containers, err := svc.Ps(ctx, projectName, api.PsOptions{All: true})- if err != nil {- continue- }- for _, cs := range containers {- name := strings.TrimSpace(cs.Service)- if name == "" {- name = strings.TrimSpace(cs.Name)- }- if name == "" {- continue- }-- state := string(cs.State)- sig := state + "|" + string(cs.Health) + "|" + strings.TrimSpace(cs.Status)- if lastState[name] == sig {- continue- }- lastState[name] = sig-- writeJSONLine(progressWriter, map[string]any{- "type": "container",- "service": name,- "state": state,- "health": string(cs.Health),- "status": strings.TrimSpace(cs.Status),- })- }- }- }-}-func ComposePs(ctx context.Context, proj *types.Project, services []string, all bool) ([]api.ContainerSummary, error) {c, err := NewClient(ctx, nil)if err != nil {@@ -314,20 +127,17 @@ func ComposeDown(ctx context.Context, proj *types.Project, removeVolumes bool) e}defer func() { _ = c.Close() }()- progressWriter, _ := ctx.Value(ProgressWriterKey{}).(io.Writer)- return runWithContainerPolling(downCtx, c.svc, proj.Name, progressWriter, func() error {- return c.svc.Down(downCtx, proj.Name, api.DownOptions{RemoveOrphans: true, Volumes: removeVolumes})- })+ return c.svc.Down(downCtx, proj.Name, api.DownOptions{RemoveOrphans: true, Volumes: removeVolumes})}-func ComposeLogs(ctx context.Context, projectName string, out io.Writer, follow bool, tail string) error {+func ComposeLogs(ctx context.Context, projectName string, out io.Writer, follow bool, tail, since string) error {c, err := NewClient(ctx, nil)if err != nil {return err}defer func() { _ = c.Close() }()- return c.svc.Logs(ctx, projectName, writerConsumer{out: out}, api.LogOptions{Follow: follow, Tail: tail})+ return c.svc.Logs(ctx, projectName, writerConsumer{out: out}, api.LogOptions{Follow: follow, Tail: tail, Since: since})}func ListGlobalComposeContainers(ctx context.Context) ([]container.Summary, error) {diff --git a/backend/pkg/projects/compose.go b/backend/pkg/projects/compose.goindex 5500a43d6..7cecd8615 100644--- a/backend/pkg/projects/compose.go+++ b/backend/pkg/projects/compose.go@@ -9,16 +9,20 @@ import ("github.com/docker/cli/cli/command"clitypes "github.com/docker/cli/cli/config/types""github.com/docker/cli/cli/flags"+ "github.com/docker/compose/v5/cmd/display""github.com/docker/compose/v5/pkg/api""github.com/docker/compose/v5/pkg/compose""github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane""github.com/moby/moby/api/types/registry""github.com/moby/moby/client"++ dockerutils "github.com/getarcaneapp/arcane/backend/v2/pkg/dockerutil")type Client struct {svc api.ComposedockerCli command.Cli+ logWriter io.WriteCloser}func NewClient(ctx context.Context, authConfigs map[string]registry.AuthConfig) (*Client, error) {@@ -39,14 +43,32 @@ func NewClient(ctx context.Context, authConfigs map[string]registry.AuthConfig)}composeCLI := wrapDockerCLIWithInspectCompatibilityInternal(cli)- svc, err := compose.NewComposeService(composeCLI,++ serviceOptions := []compose.Option{compose.WithPrompt(compose.AlwaysOkPrompt()),- )+ }++ // When the caller streams operation output, render compose's own progress+ // events exactly as `docker compose --progress=plain` prints them.+ var logWriter io.WriteCloser+ if progressWriter, ok := ctx.Value(dockerutils.ProgressWriterKey{}).(io.Writer); ok && progressWriter != nil {+ logWriter = dockerutils.NewLogLineWriter(progressWriter)+ serviceOptions = append(serviceOptions,+ compose.WithEventProcessor(display.Plain(logWriter)),+ compose.WithOutputStream(logWriter),+ compose.WithErrorStream(logWriter),+ )+ }++ svc, err := compose.NewComposeService(composeCLI, serviceOptions...)if err != nil {+ if logWriter != nil {+ _ = logWriter.Close()+ }return nil, err}- return &Client{svc: svc, dockerCli: composeCLI}, nil+ return &Client{svc: svc, dockerCli: composeCLI, logWriter: logWriter}, nil}func buildComposeAuthConfigsInternal(authConfigs map[string]registry.AuthConfig) map[string]clitypes.AuthConfig {@@ -102,7 +124,13 @@ func wrapDockerCLIWithInspectCompatibilityInternal(cli command.Cli) command.Cli}func (c *Client) Close() error {- if c == nil || c.dockerCli == nil {+ if c == nil {+ return nil+ }+ if c.logWriter != nil {+ _ = c.logWriter.Close()+ }+ if c.dockerCli == nil {return nil}if apiClient := c.dockerCli.Client(); apiClient != nil {diff --git a/cli/pkg/projects/cmd.go b/cli/pkg/projects/cmd.goindex 88a409964..33ac24493 100644--- a/cli/pkg/projects/cmd.go+++ b/cli/pkg/projects/cmd.go@@ -1,6 +1,7 @@package projectsimport (+ "bufio""context""encoding/json""fmt"@@ -285,6 +286,8 @@ var upCmd = &cobra.Command{endpoint: types.Endpoints.ProjectUp,failureMessage: "failed to start project",successMessage: "Project %s started successfully",+ timeout: 30 * time.Minute,+ stream: true,})},}@@ -328,6 +331,7 @@ var redeployCmd = &cobra.Command{failureMessage: "failed to redeploy project",successMessage: "Project %s redeployed successfully",timeout: 30 * time.Minute,+ stream: true,})},}@@ -343,6 +347,7 @@ var pullCmd = &cobra.Command{failureMessage: "failed to pull images",successMessage: "Images pulled successfully for project %s",timeout: 30 * time.Minute,+ stream: true,})},}@@ -352,6 +357,10 @@ type projectPostActionConfig struct {failureMessage stringsuccessMessage stringtimeout time.Duration+ // stream marks endpoints that respond with an NDJSON operation stream:+ // {"log":"<raw docker CLI line>"} frames are printed as-is and a terminal+ // {"error":"..."} frame fails the command.+ stream bool}func runProjectPostAction(cmd *cobra.Command, projectRef string, cfg projectPostActionConfig) error {@@ -378,10 +387,51 @@ func runProjectPostAction(cmd *cobra.Command, projectRef string, cfg projectPostreturn errors.WrapIff(err, "%s", cfg.failureMessage)}+ if cfg.stream {+ if err := printOperationStreamInternal(resp.Body); err != nil {+ return errors.WrapIff(err, "%s", cfg.failureMessage)+ }+ }+output.Success(cfg.successMessage, resolved.Name)return nil}+// printOperationStreamInternal consumes an NDJSON operation stream, printing+// raw docker CLI log lines to stdout. A terminal error frame is returned as an+// error; unknown frames (e.g. the activity envelope) are skipped.+func printOperationStreamInternal(body io.Reader) error {+ scanner := bufio.NewScanner(body)+ scanner.Buffer(make([]byte, 0, 64*1024), 4*1024*1024)++ for scanner.Scan() {+ line := strings.TrimSpace(scanner.Text())+ if line == "" {+ continue+ }++ var frame struct {+ Log string `json:"log"`+ Error string `json:"error"`+ Done bool `json:"done"`+ }+ if err := json.Unmarshal([]byte(line), &frame); err != nil {+ continue+ }+ if frame.Error != "" {+ return errors.New(frame.Error)+ }+ if frame.Done {+ return nil+ }+ if frame.Log != "" {+ fmt.Println(frame.Log)+ }+ }++ return scanner.Err()+}+var createCmd = &cobra.Command{Use: "create",Short: "Create a new project from a Docker Compose file",diff --git a/frontend/messages/en.json b/frontend/messages/en.jsonindex 01885a036..96954cfe1 100644--- a/frontend/messages/en.json+++ b/frontend/messages/en.json@@ -125,6 +125,9 @@"common_unpause": "Unpause","common_kill": "Kill","common_up": "Up",+ "watch_output": "Watch output",+ "watch_close_confirm_title": "Stop project?",+ "watch_close_confirm_message": "You are attached to this project’s live output. Closing this window will stop the project and all of its containers.","common_down": "Down","common_retry": "Retry","common_autoscroll": "Auto-scroll",@@ -1088,6 +1091,7 @@"compose_stop_success": "Project stopped successfully.","compose_restart_failed": "Failed to restart project","compose_restart_success": "Project restarted successfully.",+ "compose_redeploy_success": "Project redeployed successfully.","compose_pull_failed": "Failed to pull project","compose_pull_success": "Project pulled successfully.","compose_pull_redeploy": "Pull & Redeploy",@@ -1894,10 +1898,8 @@"activity_type_resource_action": "Resource Action","activity_unknown_target": "Unknown target","activity_no_message": "No message yet",- "activity_progress_percent": "{progress}%","activity_empty_title": "No activity here","activity_empty_description": "Background work will appear here as it starts.",- "activity_step_unknown": "Waiting for the next step","duration": "Duration","activity_duration_ms": "{ms}ms","activity_duration_seconds": "{seconds}s",@@ -1979,7 +1981,6 @@"quick_actions_prune_system": "Prune System","progress_deploy_failed": "Deployment failed","progress_deploy_failed_to_start": "Failed to start project deployment: HTTP {status}",- "progress_layers_status": "{completed} of {total} layers","image_update_auth_credential": "Credential","image_update_auth_credential_with_user": "Credential ({username})","image_update_auth_anonymous": "Anonymous",@@ -2576,7 +2577,6 @@"build_error_log": "ERROR: {error}","build_context_required": "Select a build context from the workspace first.","starting_build": "Starting build...",- "finalizing_build": "Finalizing build...","using_context": "Using context: {context}","build_request_failed": "Build request failed","build_request_failed_http": "Build request failed: HTTP {status}",diff --git a/frontend/src/lib/components/action-buttons.svelte b/frontend/src/lib/components/action-buttons.svelteindex 0c3ae072d..de2184327 100644--- a/frontend/src/lib/components/action-buttons.svelte+++ b/frontend/src/lib/components/action-buttons.svelte@@ -6,17 +6,22 @@import { toast } from 'svelte-sonner';import { tryCatch } from '#lib/utils/api';import { handleApiResultWithCallbacks } from '#lib/utils/api';- import { ArcaneButton, type ArcaneButtonSize } from '#lib/components/arcane-button/index.js';+ import { ArcaneButton, arcaneButtonVariants, type ArcaneButtonSize } from '#lib/components/arcane-button/index.js';import DeploySplitButton from '#lib/components/deploy-split-button/deploy-split-button.svelte';+ import * as ButtonGroup from '#lib/components/ui/button-group/index.js';import * as DropdownMenu from '#lib/components/ui/dropdown-menu/index.js';+ import { cn } from '#lib/utils';import { m } from '#lib/paraglide/messages';import settingsStore from '#lib/stores/config-store';import { deployOptionsStore } from '#lib/stores/deploy-options.store.svelte';import { containerService } from '#lib/services/container-service';import { projectService, type DeployProjectOptions } from '#lib/services/project-service';+ import { activityToastOptions, activityIdFromStreamFrame, extractActivityId } from '#lib/utils/activity-toast';+ import { operationWatchStore } from '#lib/stores/operation-watch.store.svelte';+ import { attachProjectLogsToWatch } from '#lib/utils/watch-logs';import type { Project } from '#lib/types/swarm';import type { ContainerDetailsDto } from '#lib/types/docker';- import { EllipsisIcon } from '#lib/icons';+ import { ArrowDownIcon, EllipsisIcon, TerminalIcon } from '#lib/icons';import { createMutation } from '@tanstack/svelte-query';import { hasPermission } from '#lib/utils/auth';import { isDepotBuildAvailable } from '#lib/utils/build-provider';@@ -38,6 +43,7 @@let {id,+ name,type = 'container',itemState = 'stopped',desktopVariant = 'labels',@@ -146,15 +152,27 @@onSettled: () => setLoading('restart', false)}));+ // Set from the redeploy stream's started frame so the success toast can link+ // to the activity.+ let redeployActivityId = $state<string | undefined>(undefined);+const redeployMutation = createMutation(() => ({mutationKey: ['action', 'redeploy', type, id],- mutationFn: () =>+ mutationFn: ({ watch = false }: { watch?: boolean } = {}) =>tryCatch(- (type === 'container' ? containerService.redeployContainer(id) : projectService.redeployProject(id)) as Promise<- ContainerDetailsDto | Project- >+ (type === 'container'+ ? containerService.redeployContainer(id)+ : projectService.redeployProject(id, (frame) => {+ redeployActivityId = activityIdFromStreamFrame(frame) ?? redeployActivityId;+ if (watch) {+ operationWatchStore.onLine(frame);+ }+ })) as Promise<ContainerDetailsDto | Project>),- onMutate: () => setLoading('redeploy', true),+ onMutate: () => {+ redeployActivityId = undefined;+ setLoading('redeploy', true);+ },onSettled: () => setLoading('redeploy', false)}));@@ -263,7 +281,14 @@action: type === 'project' ? m.compose_destroy() : m.common_remove(),type: type}),- onSuccess: async () => {+ onSuccess: async (data) => {+ const activityId = extractActivityId(data);+ if (activityId) {+ toast.success(+ type === 'project' ? m.compose_destroy_success() : m.containers_remove_success(),+ activityToastOptions(activityId)+ );+ }await refreshAll();goto(type === 'project' ? '/projects' : '/containers');}@@ -279,31 +304,55 @@]});} else if (action === 'redeploy') {- openConfirmDialog({- title: type === 'container' ? m.container_confirm_redeploy_title() : m.common_confirm_redeploy_title(),- message: type === 'container' ? m.container_confirm_redeploy_message() : m.common_confirm_redeploy_message(),- confirm: {- label: m.common_redeploy(),- action: async () => {- const result = await redeployMutation.mutateAsync();- handleApiResultWithCallbacks({- result,- message: m.common_action_failed_with_type({ action: m.common_redeploy(), type }),- onSuccess: async (data) => {- const containerData = data as ContainerDetailsDto;- if (type === 'container' && containerData?.id) {- goto(`/containers/${containerData.id}`);- } else if (type === 'container') {- goto('/containers');- } else {- onActionComplete('running');- }- }- });+ confirmRedeploy(false);+ }+ }++ function confirmRedeploy(watch: boolean) {+ openConfirmDialog({+ title: type === 'container' ? m.container_confirm_redeploy_title() : m.common_confirm_redeploy_title(),+ message: type === 'container' ? m.container_confirm_redeploy_message() : m.common_confirm_redeploy_message(),+ confirm: {+ label: m.common_redeploy(),+ action: async () => {+ const operationStartedAt = Math.floor(Date.now() / 1000);+ if (watch) {+ operationWatchStore.start(`${m.common_redeploy()} — ${name ?? id}`);+ }+ const result = await redeployMutation.mutateAsync({ watch });+ if (watch && result.error) {+ operationWatchStore.fail(+ result.error.message || m.common_action_failed_with_type({ action: m.common_redeploy(), type })+ );+ return;+ }+ if (watch) {+ enterInteractiveWatchInternal(operationStartedAt);}+ handleApiResultWithCallbacks({+ result,+ message: m.common_action_failed_with_type({ action: m.common_redeploy(), type }),+ onSuccess: async (data) => {+ const activityId = type === 'container' ? extractActivityId(data) : redeployActivityId;+ if (activityId && !watch) {+ toast.success(+ type === 'project' ? m.compose_redeploy_success() : m.container_redeploy_success(),+ activityToastOptions(activityId)+ );+ }+ const containerData = data as ContainerDetailsDto;+ if (type === 'container' && containerData?.id) {+ goto(`/containers/${containerData.id}`);+ } else if (type === 'container') {+ goto('/containers');+ } else {+ onActionComplete('running');+ }+ }+ });}- });- }+ }+ });}async function handleStart() {@@ -318,28 +367,64 @@});}- async function handleDeploy(options?: DeployProjectOptions) {+ async function handleDeploy(options?: DeployProjectOptions, watch = false) {setLoading('start', true);+ const operationStartedAt = Math.floor(Date.now() / 1000);+ if (watch) {+ operationWatchStore.start(`${deployButtonLabel} — ${name ?? id}`);+ }+try {- await projectService.deployProject(id, () => {}, options ?? deployOptionsStore.getRequestOptions());+ await projectService.deployProject(+ id,+ watch ? (frame: unknown) => operationWatchStore.onLine(frame) : () => {},+ options ?? deployOptionsStore.getRequestOptions()+ );+ if (watch) {+ enterInteractiveWatchInternal(operationStartedAt);+ }await refreshAll();itemState = 'running';onActionComplete('running');} catch (e: any) {const message = e?.message || m.common_action_failed_with_type({ action: m.common_start(), type });- toast.error(message);+ if (watch) {+ operationWatchStore.fail(message);+ } else {+ toast.error(message);+ }} finally {setLoading('start', false);}}+ // Interactive mode: like a non-detached `docker compose up`, the deploy+ // output is followed by the containers' live logs — everything they wrote+ // since the operation began — and dismissing the dialog is the Ctrl-C:+ // the project is brought down.+ function enterInteractiveWatchInternal(operationStartedAt: number) {+ operationWatchStore.append(`Attaching to ${name ?? id}`);+ const detach = attachProjectLogsToWatch(id, operationStartedAt);+ operationWatchStore.setOnClose(() => {+ detach();+ void handleStop();+ });+ }+async function handleStop() {const result = await stopMutation.mutateAsync();await handleApiResultWithCallbacks({result,message: m.common_action_failed_with_type({ action: m.common_stop(), type }),- onSuccess: async () => {+ onSuccess: async (data) => {+ const activityId = extractActivityId(data);+ if (activityId) {+ toast.success(+ type === 'project' ? m.compose_stop_success() : m.containers_stop_success(),+ activityToastOptions(activityId)+ );+ }itemState = 'stopped';onActionComplete('stopped');}@@ -351,26 +436,41 @@await handleApiResultWithCallbacks({result,message: m.common_action_failed_with_type({ action: m.common_restart(), type }),- onSuccess: async () => {+ onSuccess: async (data) => {+ const activityId = extractActivityId(data);+ if (activityId) {+ toast.success(+ type === 'project' ? m.compose_restart_success() : m.containers_restart_success(),+ activityToastOptions(activityId)+ );+ }itemState = 'running';onActionComplete('running');}});}- async function handleProjectPull() {+ async function handleProjectPull(watch = false) {setLoading('pull', true);+ if (watch) {+ operationWatchStore.start(`${m.pull()} — ${name ?? id}`);+ }+try {projectService- .pullProjectImages(id, () => {})+ .pullProjectImages(id, watch ? (frame: unknown) => operationWatchStore.onLine(frame) : () => {}).then(async () => {await refreshAll();onActionComplete(itemState);}).catch((error: any) => {const message = error?.message || m.images_pull_failed();- toast.error(message);+ if (watch) {+ operationWatchStore.fail(message);+ } else {+ toast.error(message);+ }});} finally {setLoading('pull', false);@@ -405,12 +505,43 @@}</script>+{#snippet WatchDropdown(onWatch: () => void, disabled: boolean, size: 'default' | 'icon' = 'default')}+ <DropdownMenu.Root>+ <DropdownMenu.Trigger+ class={cn(arcaneButtonVariants({ tone: 'outline-primary', size: 'icon' }), size === 'icon' && 'size-9 rounded-md')}+ aria-label={m.common_open_menu()}+ {disabled}+ onclick={(event) => event.stopPropagation()}+ onpointerdown={(event) => event.stopPropagation()}+ >+ <ArrowDownIcon class="size-4" />+ </DropdownMenu.Trigger>+ <DropdownMenu.Content align="end">+ <DropdownMenu.Item onclick={() => onWatch()}>+ <TerminalIcon class="size-4" />+ {m.watch_output()}+ </DropdownMenu.Item>+ </DropdownMenu.Content>+ </DropdownMenu.Root>+{/snippet}+{#snippet RedeployActionButton(size: 'default' | 'icon' = 'default', showLabel = true)}{#if canRedeploy}{#if disableRedeploy}<span class="inline-flex" title={m.common_redeploy_disabled_arcane_self()}><ArcaneButton action="redeploy" {size} {showLabel} disabled /></span>+ {:else if type === 'project'}+ <ButtonGroup.Root>+ <ArcaneButton+ action="redeploy"+ {size}+ {showLabel}+ onclick={() => confirmAction('redeploy')}+ loading={uiLoading.redeploy}+ />+ {@render WatchDropdown(() => confirmRedeploy(true), !!uiLoading.redeploy, size)}+ </ButtonGroup.Root>{:else}<ArcaneButton action="redeploy" {size} {showLabel} onclick={() => confirmAction('redeploy')} loading={uiLoading.redeploy} />{/if}@@ -441,6 +572,7 @@{showLabel}customLabel={deployButtonLabel}onDeploy={() => handleDeploy()}+ onDeployWatch={() => handleDeploy(undefined, true)}loading={uiLoading.start}/>{/if}@@ -477,7 +609,10 @@{/if}{#if canPull}- <ArcaneButton action="pull" {size} {showLabel} onclick={() => handleProjectPull()} loading={uiLoading.pull} />+ <ButtonGroup.Root>+ <ArcaneButton action="pull" {size} {showLabel} onclick={() => handleProjectPull()} loading={uiLoading.pull} />+ {@render WatchDropdown(() => handleProjectPull(true), !!uiLoading.pull, size)}+ </ButtonGroup.Root>{/if}{/if}@@ -571,7 +706,7 @@</DropdownMenu.Item>{/if}{#if canPull}- <DropdownMenu.Item onclick={handleProjectPull} disabled={uiLoading.pull}>+ <DropdownMenu.Item onclick={() => handleProjectPull()} disabled={uiLoading.pull}>{m.pull()}</DropdownMenu.Item>{/if}diff --git a/frontend/src/lib/components/activity/activity-batch-item.svelte b/frontend/src/lib/components/activity/activity-batch-item.svelteindex e448fb0a6..407113e54 100644--- a/frontend/src/lib/components/activity/activity-batch-item.svelte+++ b/frontend/src/lib/components/activity/activity-batch-item.svelte@@ -78,12 +78,7 @@</div>{#if isActive}- <div class="flex items-center gap-2">- <Progress value={group.progress ?? 0} class="h-1.5 rounded-full" />- <span class="w-9 shrink-0 text-right text-[11px] text-muted-foreground tabular-nums">- {m.activity_progress_percent({ progress: group.progress ?? 0 })}- </span>- </div>+ <Progress value={100} indeterminate class="h-1.5 rounded-full" />{/if}</div>diff --git a/frontend/src/lib/components/activity/activity-detail-panel.svelte b/frontend/src/lib/components/activity/activity-detail-panel.svelteindex f88daaf8a..7253c2a5f 100644--- a/frontend/src/lib/components/activity/activity-detail-panel.svelte+++ b/frontend/src/lib/components/activity/activity-detail-panel.svelte@@ -1,29 +1,24 @@<script lang="ts">- import { Progress } from '#lib/components/ui/progress/index.js';import { Badge } from '#lib/components/ui/badge';import { CopyButton } from '#lib/components/ui/copy-button';import { activityStore } from '#lib/stores/activity.store.svelte';- import type { Activity, ActivityMessage } from '#lib/types/activity.type';+ import type { Activity } from '#lib/types/activity.type';import { ActivityIcon, CloseIcon, TerminalIcon } from '#lib/icons';import { m } from '#lib/paraglide/messages';- import { cn } from '#lib/utils';import IfPermitted from '#lib/components/if-permitted.svelte';+ import ActivityOutput from './activity-output.svelte';import { confirmCancelActivity } from './activity-cancel';import { activityStatusLabel, activityStatusVariant, activityTypeIcon, activityTypeLabel } from './activity-labels';- import { formatDateTime, formatTime } from '#lib/utils/formatting';+ import { formatDateTime } from '#lib/utils/formatting';let { activity }: { activity: Activity } = $props();- let outputContainer = $state<HTMLElement | null>(null);-// Prefer the freshest activity data from the store (messages stream may update it).const liveActivity = $derived(activityStore.getActivity(activity.id) ?? activity);const detail = $derived(activityStore.getDetail(activity.id));const messages = $derived(detail?.messages ?? []);- const outputText = $derived(messages.map(formatOutputLineInternal).join('\n'));+ const outputText = $derived(messages.map((message) => message.message).join('\n'));const IconComponent = $derived(activityTypeIcon(liveActivity.type));- const hasProgress = $derived(typeof liveActivity.progress === 'number');- const progressValue = $derived(Math.min(100, Math.max(0, Math.round(liveActivity.progress ?? 0))));const isLoading = $derived(activityStore.isDetailLoading(activity.id));const isDetailError = $derived(activityStore.isDetailError(activity.id));const activityTarget = $derived(@@ -35,17 +30,6 @@const startedByName = $derived(liveActivity.startedBy?.displayName || liveActivity.startedBy?.username);const cancelable = $derived(liveActivity.status === 'running' || liveActivity.status === 'queued');- $effect(() => {- messages.length;- outputContainer;- queueMicrotask(() => {- if (!outputContainer) {- return;- }- outputContainer.scrollTop = outputContainer.scrollHeight;- });- });-function formatDateTimeInternal(value?: string): string {if (!value) {return m.common_na();@@ -74,24 +58,6 @@const seconds = totalSeconds % 60;return m.activity_duration_minutes({ minutes, seconds });}-- function formatOutputLineInternal(message: ActivityMessage): string {- const timestamp = formatTime(message.createdAt) || message.createdAt;- return `[${timestamp}] ${message.level.toUpperCase()} ${message.message}`;- }-- function messageLevelClassInternal(level: ActivityMessage['level']): string {- switch (level) {- case 'error':- return 'text-red-300';- case 'warning':- return 'text-amber-300';- case 'success':- return 'text-emerald-300';- default:- return 'text-zinc-100';- }- }</script><div class="border-b border-border/50 bg-muted/25 px-4 py-3">@@ -127,24 +93,6 @@{/if}</div>- <div class="space-y-2">- <div class="flex items-center justify-between gap-3 text-xs">- <span class="text-muted-foreground">{liveActivity.step || m.activity_step_unknown()}</span>- <span class="text-muted-foreground tabular-nums">- {#if hasProgress}- {m.activity_progress_percent({ progress: progressValue })}- {:else}- {m.common_live()}- {/if}- </span>- </div>- <Progress- value={hasProgress ? progressValue : 100}- indeterminate={!hasProgress && (liveActivity.status === 'running' || liveActivity.status === 'queued')}- class="h-1.5"- />- </div>-<div class="flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground"><div class="flex items-center gap-1.5"><span>{m.common_started()}</span>@@ -194,10 +142,7 @@</CopyButton></div>- <div- bind:this={outputContainer}- class="max-h-80 min-h-40 overflow-auto bg-zinc-950 px-5 py-4 font-mono text-[12px] leading-relaxed text-zinc-100"- >+ <div class="bg-zinc-950 font-mono text-[12px] leading-relaxed text-zinc-100">{#if isDetailError && messages.length === 0}<div class="flex min-h-32 flex-col items-center justify-center gap-2 text-zinc-500"><span>{m.activity_output_load_failed()}</span>@@ -219,15 +164,7 @@{m.activity_output_empty()}</div>{:else}- {#each messages as message (message.id)}- <div class="grid grid-cols-[auto_auto_minmax(0,1fr)] gap-2 rounded px-1 py-0.5 hover:bg-white/4">- <span class="text-zinc-500">{formatDateTimeInternal(message.createdAt)}</span>- <span class={cn('font-bold', messageLevelClassInternal(message.level))}>- {message.level.toUpperCase()}- </span>- <span class="wrap-break-word whitespace-pre-wrap">{message.message}</span>- </div>- {/each}+ <ActivityOutput {messages} />{/if}</div></div>diff --git a/frontend/src/lib/components/activity/activity-list-item.svelte b/frontend/src/lib/components/activity/activity-list-item.svelteindex a77ae5547..c8eabf43b 100644--- a/frontend/src/lib/components/activity/activity-list-item.svelte+++ b/frontend/src/lib/components/activity/activity-list-item.svelte@@ -20,13 +20,11 @@} = $props();const IconComponent = $derived(activityTypeIcon(activity.type));- const hasProgress = $derived(typeof activity.progress === 'number');- const progressValue = $derived(Math.round(activity.progress ?? 0));const isActive = $derived(activity.status === 'running' || activity.status === 'queued');// Resource-less activities (e.g. prunes) promote the type label instead.const resourceLabel = $derived(activity.resourceName || activity.resourceId || '');const targetName = $derived(resourceLabel || activityTypeLabel(activity.type));- const subtitle = $derived(activity.latestMessage || activity.step || m.activity_no_message());+ const subtitle = $derived(activity.latestMessage || m.activity_no_message());const sourceEnvironmentName = $derived(activity.sourceEnvironmentName || activity.sourceEnvironmentId || activity.environmentId);@@ -107,16 +105,7 @@<div class="space-y-1.5"><div class="line-clamp-2 text-xs leading-relaxed text-muted-foreground">{subtitle}</div>{#if isActive && !expanded}- <div class="flex items-center gap-2">- <Progress value={hasProgress ? progressValue : 100} indeterminate={!hasProgress} class="h-1.5 rounded-full" />- <span class="w-9 shrink-0 text-right text-[11px] text-muted-foreground tabular-nums">- {#if hasProgress}- {m.activity_progress_percent({ progress: progressValue })}- {:else}- {m.common_live()}- {/if}- </span>- </div>+ <Progress value={100} indeterminate class="h-1.5 rounded-full" />{/if}</div></div>diff --git a/frontend/src/lib/components/activity/activity-output.svelte b/frontend/src/lib/components/activity/activity-output.sveltenew file mode 100644index 000000000..d0bfb3020--- /dev/null+++ b/frontend/src/lib/components/activity/activity-output.svelte@@ -0,0 +1,49 @@+<script lang="ts">+ import type { ActivityMessage } from '#lib/types/activity.type';+ import { ansiToHtml } from '#lib/utils/formatting';+ import { cn } from '#lib/utils';++ let { messages }: { messages: ActivityMessage[] } = $props();++ let container = $state<HTMLElement | null>(null);+ let pinnedToBottom = $state(true);++ function handleScroll() {+ if (!container) {+ return;+ }+ pinnedToBottom = container.scrollHeight - container.scrollTop - container.clientHeight < 24;+ }++ $effect(() => {+ messages.length;+ if (!container || !pinnedToBottom) {+ return;+ }+ queueMicrotask(() => {+ if (container && pinnedToBottom) {+ container.scrollTop = container.scrollHeight;+ }+ });+ });++ function lineClassInternal(level: ActivityMessage['level']): string {+ switch (level) {+ case 'error':+ return 'text-red-300';+ case 'warning':+ return 'text-amber-300';+ default:+ return 'text-zinc-100';+ }+ }+</script>++<div bind:this={container} onscroll={handleScroll} class="max-h-80 min-h-40 overflow-auto px-5 py-4">+ {#each messages as message (message.id)}+ <!-- eslint-disable-next-line svelte/no-at-html-tags -- ansiToHtml escapes markup before adding color spans -->+ <div class={cn('wrap-break-word whitespace-pre-wrap', lineClassInternal(message.level))}>+ {@html ansiToHtml(message.message)}+ </div>+ {/each}+</div>diff --git a/frontend/src/lib/components/arcane-table/arcane-table.svelte b/frontend/src/lib/components/arcane-table/arcane-table.svelteindex 037391c77..99101235c 100644--- a/frontend/src/lib/components/arcane-table/arcane-table.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table.svelte@@ -360,7 +360,11 @@if (rowActions) {cols.push({id: 'actions',- cell: ({ row }) => renderSnippet(rowActions, { row, item: row.original as TData })+ // The closure reads the live rowActions prop. When the caller flips it+ // to undefined (e.g. a project stops and its per-row actions go away),+ // the old column can still render once before the column set rebuilds —+ // rendering an undefined snippet would crash the page (invalid_snippet).+ cell: ({ row }) => (rowActions ? renderSnippet(rowActions, { row, item: row.original as TData }) : undefined)});}diff --git a/frontend/src/lib/components/confirm-dialog/confirm-dialog.svelte b/frontend/src/lib/components/confirm-dialog/confirm-dialog.svelteindex 699313e69..917d6cccd 100644--- a/frontend/src/lib/components/confirm-dialog/confirm-dialog.svelte+++ b/frontend/src/lib/components/confirm-dialog/confirm-dialog.svelte@@ -91,7 +91,7 @@<ArcaneButton class="min-w-[80px]" action="cancel" onclick={() => ($confirmDialogStore.open = false)} /><ArcaneButtonclass="min-w-[80px]"- action={$confirmDialogStore.confirm.destructive ? 'remove' : 'confirm'}+ action={$confirmDialogStore.confirm.button ?? ($confirmDialogStore.confirm.destructive ? 'remove' : 'confirm')}customLabel={$confirmDialogStore.confirm.label}onclick={handleConfirm}/>diff --git a/frontend/src/lib/components/confirm-dialog/store.ts b/frontend/src/lib/components/confirm-dialog/store.tsindex e0f459e27..d5376ef6f 100644--- a/frontend/src/lib/components/confirm-dialog/store.ts+++ b/frontend/src/lib/components/confirm-dialog/store.ts@@ -1,5 +1,6 @@import { writable } from 'svelte/store';import { m } from '#lib/paraglide/messages';+import type { Action } from '#lib/components/arcane-button/index.js';interface ConfirmDialogStore {open: boolean;@@ -8,6 +9,8 @@ interface ConfirmDialogStore {confirm: {label?: string;destructive?: boolean;+ /** ArcaneButton action variant for the confirm button; overrides the destructive/remove default. */+ button?: Action;action: (checkboxStates: Record<string, boolean>) => void;};checkboxes?: Array<{@@ -39,6 +42,7 @@ export function openConfirmDialog({confirm: {label?: string;destructive?: boolean;+ button?: Action;action: (checkboxStates: Record<string, boolean>) => void;};checkboxes?: Array<{@@ -54,6 +58,7 @@ export function openConfirmDialog({confirm: {label: confirm.label ?? m.common_confirm(),destructive: confirm.destructive ?? false,+ button: confirm.button,action: confirm.action},checkboxesdiff --git a/frontend/src/lib/components/deploy-split-button/deploy-split-button.svelte b/frontend/src/lib/components/deploy-split-button/deploy-split-button.svelteindex 7a2715b00..08a973f4e 100644--- a/frontend/src/lib/components/deploy-split-button/deploy-split-button.svelte+++ b/frontend/src/lib/components/deploy-split-button/deploy-split-button.svelte@@ -2,7 +2,7 @@import { ArcaneButton, arcaneButtonVariants, type ArcaneButtonSize } from '#lib/components/arcane-button/index.js';import * as ButtonGroup from '#lib/components/ui/button-group/index.js';import * as DropdownMenu from '#lib/components/ui/dropdown-menu/index.js';- import { ArrowDownIcon } from '#lib/icons';+ import { ArrowDownIcon, TerminalIcon } from '#lib/icons';import { m } from '#lib/paraglide/messages';import { deployOptionsStore, type DeployPullPolicy } from '#lib/stores/deploy-options.store.svelte';import { cn } from '#lib/utils';@@ -12,13 +12,15 @@showLabel = true,loading = false,customLabel,- onDeploy+ onDeploy,+ onDeployWatch}: {size?: ArcaneButtonSize;showLabel?: boolean;loading?: boolean;customLabel?: string;onDeploy: () => void | Promise<void>;+ onDeployWatch?: () => void | Promise<void>;} = $props();function setPullPolicy(value: string) {@@ -79,6 +81,14 @@>{m.deploy_force_recreate()}</DropdownMenu.CheckboxItem>++ {#if onDeployWatch}+ <DropdownMenu.Separator />+ <DropdownMenu.Item onclick={() => onDeployWatch?.()}>+ <TerminalIcon class="size-4" />+ {m.watch_output()}+ </DropdownMenu.Item>+ {/if}</DropdownMenu.Content></DropdownMenu.Root></ButtonGroup.Root>diff --git a/frontend/src/lib/components/operation-watch-dialog.svelte b/frontend/src/lib/components/operation-watch-dialog.sveltenew file mode 100644index 000000000..2ea319a7f--- /dev/null+++ b/frontend/src/lib/components/operation-watch-dialog.svelte@@ -0,0 +1,77 @@+<script lang="ts">+ import { ResponsiveDialog } from '#lib/components/ui/responsive-dialog/index.js';+ import { openConfirmDialog } from '#lib/components/confirm-dialog';+ import { operationWatchStore } from '#lib/stores/operation-watch.store.svelte';+ import { ansiToHtml } from '#lib/utils/formatting';+ import { m } from '#lib/paraglide/messages';++ // Dismissing an attached session stops the project (the Ctrl-C of a+ // non-detached compose up), so every close attempt confirms first.+ operationWatchStore.setCloseRequestHandler(() => {+ openConfirmDialog({+ title: m.watch_close_confirm_title(),+ message: m.watch_close_confirm_message(),+ confirm: {+ label: m.common_stop(),+ destructive: true,+ button: 'stop',+ action: () => {+ operationWatchStore.forceClose();+ }+ }+ });+ });++ let container = $state<HTMLElement | null>(null);+ let pinnedToBottom = $state(true);++ function handleScroll() {+ if (!container) {+ return;+ }+ pinnedToBottom = container.scrollHeight - container.scrollTop - container.clientHeight < 24;+ }++ $effect(() => {+ operationWatchStore.lines.length;+ if (!container || !pinnedToBottom) {+ return;+ }+ queueMicrotask(() => {+ if (container && pinnedToBottom) {+ container.scrollTop = container.scrollHeight;+ }+ });+ });+</script>++<ResponsiveDialog+ bind:open={operationWatchStore.open}+ title={operationWatchStore.title}+ contentClass="sm:max-w-[1100px]"+ class="min-h-0"+>+ <div class="space-y-3 pb-4">+ <div+ bind:this={container}+ onscroll={handleScroll}+ class="max-h-[70vh] min-h-[280px] overflow-auto rounded-lg border border-border/50 bg-zinc-950 p-4 font-mono text-[12px] leading-relaxed text-zinc-100"+ >+ {#each operationWatchStore.lines as line, idx (idx)}+ <!-- eslint-disable-next-line svelte/no-at-html-tags -- ansiToHtml escapes markup before adding color spans -->+ <div class="break-words whitespace-pre-wrap">{@html ansiToHtml(line)}</div>+ {/each}+ {#if operationWatchStore.lines.length === 0}+ <div class="flex min-h-[240px] items-center justify-center text-zinc-500">+ {m.activity_output_loading()}+ </div>+ {/if}+ </div>++ {#if operationWatchStore.error}+ <div class="rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive">+ {operationWatchStore.error}+ </div>+ {/if}+ </div>+</ResponsiveDialog>diff --git a/frontend/src/lib/services/image-service.ts b/frontend/src/lib/services/image-service.tsindex 86069848b..44442c836 100644--- a/frontend/src/lib/services/image-service.ts+++ b/frontend/src/lib/services/image-service.ts@@ -126,6 +126,8 @@ class ImageService extends BaseAPIService {const message = typeof parsed.error === 'string' ? parsed.error : parsed.error.message || m.images_pull_stream_failed();throw new Error(message);}+ // The terminal frame marks success; don't wait on the network EOF.+ return parsed?.done === true;});return { success: true, imageName };} catch (error) {diff --git a/frontend/src/lib/services/project-service.ts b/frontend/src/lib/services/project-service.tsindex 6bc558ebf..afdf455ae 100644--- a/frontend/src/lib/services/project-service.ts+++ b/frontend/src/lib/services/project-service.ts@@ -106,7 +106,7 @@ class ProjectService extends BaseAPIService {private async readProjectStream(body: ReadableStream<Uint8Array>,onLine?: (data: any) => void,- onMessage?: (data: any) => void+ onMessage?: (data: any) => boolean | void): Promise<void> {await readNdjsonStream(body, onMessage, onLine);}@@ -132,6 +132,8 @@ class ProjectService extends BaseAPIService {if (obj?.error) {throw new Error(typeof obj.error === 'string' ? obj.error : obj.error?.message || messages.streamFailed());}+ // The terminal frame marks success; don't wait on the network EOF.+ return obj?.done === true;});}@@ -226,9 +228,17 @@ class ProjectService extends BaseAPIService {await this.handleResponse(this.api.post(`/environments/${envId}/projects/${projectId}/unarchive`));}- async redeployProject(projectName: string): Promise<Project> {+ async redeployProject(projectId: string, onLine?: (data: any) => void): Promise<Project> {const envId = await environmentStore.getCurrentEnvironmentId();- return this.handleResponse(this.api.post(`/environments/${envId}/projects/${projectName}/redeploy`));+ const url = `/api/environments/${envId}/projects/${projectId}/redeploy`;++ await this.postProjectStream(url, {}, onLine, {+ startFailed: (status) => m.progress_deploy_failed_to_start({ status }),+ streamFailed: () => m.progress_deploy_failed()+ });++ // The redeploy stream doesn't return the project object; fetch fresh details.+ return this.getProject(projectId);}private async streamProjectPull(projectId: string, onLine?: (data: any) => void): Promise<void> {@@ -240,7 +250,12 @@ class ProjectService extends BaseAPIService {throw new Error(`Failed to start project image pull (${res.status})`);}- await this.readProjectStream(res.body, onLine);+ await this.readProjectStream(res.body, onLine, (obj) => {+ if (obj?.error) {+ throw new Error(typeof obj.error === 'string' ? obj.error : obj.error?.message || m.images_pull_failed());+ }+ return obj?.done === true;+ });}buildProjectImages(diff --git a/frontend/src/lib/stores/activity.store.svelte.ts b/frontend/src/lib/stores/activity.store.svelte.tsindex 91e17ed8b..597826024 100644--- a/frontend/src/lib/stores/activity.store.svelte.ts+++ b/frontend/src/lib/stores/activity.store.svelte.ts@@ -59,7 +59,6 @@ function activitySearchHaystackInternal(activity: Activity): string {activity.resourceName,activity.resourceId,activity.latestMessage,- activity.step,activity.error,activity.sourceEnvironmentName]@@ -92,8 +91,7 @@ function groupActivitiesInternal(items: Activity[]): ActivityGroup[] {total: 0,done: 0,failed: 0,- status: 'running',- progress: null+ status: 'running'};batches.set(batchId, group);groups.push(group);@@ -118,27 +116,13 @@ function finalizeBatchGroupInternal(group: ActivityBatchGroup) {group.failed = group.items.filter((item) => item.status === 'failed').length;if (group.items.some((item) => isActiveStatusInternal(item.status))) {group.status = group.items.some((item) => item.status === 'running') ? 'running' : 'queued';- const memberProgress = group.items.map((item) =>- isActiveStatusInternal(item.status) ? clampBatchProgressInternal(item.progress) : 100- );- group.progress = Math.round(memberProgress.reduce((sum, value) => sum + value, 0) / group.total);+ } else if (group.failed > 0) {+ group.status = 'failed';+ } else if (group.items.every((item) => item.status === 'cancelled')) {+ group.status = 'cancelled';} else {- if (group.failed > 0) {- group.status = 'failed';- } else if (group.items.every((item) => item.status === 'cancelled')) {- group.status = 'cancelled';- } else {- group.status = 'success';- }- group.progress = 100;- }-}--function clampBatchProgressInternal(progress: number | null | undefined): number {- if (typeof progress !== 'number' || Number.isNaN(progress)) {- return 0;+ group.status = 'success';}- return Math.min(100, Math.max(0, progress));}function groupStatusIsActiveInternal(group: ActivityGroup): boolean {diff --git a/frontend/src/lib/stores/operation-watch.store.svelte.ts b/frontend/src/lib/stores/operation-watch.store.svelte.tsnew file mode 100644index 000000000..d75aec49a--- /dev/null+++ b/frontend/src/lib/stores/operation-watch.store.svelte.ts@@ -0,0 +1,107 @@+/**+ * Backs the operation watch dialog: a terminal-style view of a single running+ * Docker operation's raw CLI output. Streamed operations feed it via their+ * NDJSON {"log":...} frames. Interactive operations (docker compose up without+ * -d) attach follow-up log streaming and register an onClose hook that stops+ * the project when the dialog is dismissed — the Ctrl-C equivalent.+ */+function createOperationWatchStore() {+ let _open = $state(false);+ let _title = $state('');+ let _lines = $state<string[]>([]);+ let _error = $state('');+ let _onClose: (() => void) | null = null;+ let _closeRequestHandler: (() => void) | null = null;++ function runCloseHookInternal() {+ const hook = _onClose;+ _onClose = null;+ hook?.();+ }++ return {+ get open() {+ return _open;+ },+ set open(value: boolean) {+ const closing = _open && !value;+ if (closing && _onClose && _closeRequestHandler) {+ // An attached session's close is the Ctrl-C that stops the project —+ // veto the dismissal (X, Escape, outside click) and ask first.+ _closeRequestHandler();+ return;+ }+ _open = value;+ if (closing) {+ runCloseHookInternal();+ }+ },+ get title() {+ return _title;+ },+ get lines() {+ return _lines;+ },+ get error() {+ return _error;+ },++ start(title: string) {+ // Replacing a previous session releases its resources first.+ runCloseHookInternal();+ _title = title;+ _lines = [];+ _error = '';+ _open = true;+ },++ append(line: string) {+ _lines = [..._lines, line];+ },++ /** onLine callback for readNdjsonStream: appends raw log frames. */+ onLine(data: unknown) {+ if (!data || typeof data !== 'object') {+ return;+ }+ const frame = data as { log?: unknown };+ if (typeof frame.log === 'string') {+ _lines = [..._lines, frame.log];+ }+ },++ fail(message: string) {+ _error = message;+ // A failed operation has nothing to stop or detach from.+ _onClose = null;+ },++ /**+ * Registers cleanup for the current session, invoked exactly once when+ * the dialog closes (or a new session replaces this one).+ */+ setOnClose(hook: () => void) {+ _onClose = hook;+ },++ /**+ * Registers the dialog's confirm-before-close prompt, invoked instead of+ * closing while a session close hook is armed.+ */+ setCloseRequestHandler(handler: () => void) {+ _closeRequestHandler = handler;+ },++ close() {+ this.open = false;+ },++ /** Closes without the confirm prompt, running the session close hook. */+ forceClose() {+ _open = false;+ runCloseHookInternal();+ }+ };+}++export const operationWatchStore = createOperationWatchStore();diff --git a/frontend/src/lib/types/activity.type.ts b/frontend/src/lib/types/activity.type.tsindex 786e5b150..4f308e54d 100644--- a/frontend/src/lib/types/activity.type.ts+++ b/frontend/src/lib/types/activity.type.ts@@ -34,8 +34,6 @@ export interface Activity {resourceType?: string;resourceId?: string;resourceName?: string;- progress?: number | null;- step?: string;latestMessage?: string;startedBy?: ActivityStartedBy;startedAt: string;@@ -75,7 +73,6 @@ export interface ActivityBatchGroup {done: number;failed: number;status: ActivityStatus;- progress: number | null;}export type ActivityGroup = { kind: 'single'; activity: Activity } | ActivityBatchGroup;diff --git a/frontend/src/lib/utils/activity-toast.ts b/frontend/src/lib/utils/activity-toast.tsindex fa685bd69..1ecb32808 100644--- a/frontend/src/lib/utils/activity-toast.ts+++ b/frontend/src/lib/utils/activity-toast.ts@@ -19,6 +19,21 @@ export function activityToastOptions(activityId?: string) {};}+/**+ * Extracts the activityId from an operation stream's started frame+ * ({"type":"activity","activityId":...}). Returns undefined for other frames.+ */+export function activityIdFromStreamFrame(data: unknown): string | undefined {+ if (!data || typeof data !== 'object') {+ return undefined;+ }+ const frame = data as { type?: unknown; activityId?: unknown };+ if (frame.type !== 'activity' || typeof frame.activityId !== 'string' || !frame.activityId.trim()) {+ return undefined;+ }+ return frame.activityId;+}+export function extractActivityId(value: unknown): string | undefined {if (!value || typeof value !== 'object') {return undefined;diff --git a/frontend/src/lib/utils/docker.ts b/frontend/src/lib/utils/docker.tsindex 674a0cab6..aa453f3c9 100644--- a/frontend/src/lib/utils/docker.ts+++ b/frontend/src/lib/utils/docker.ts@@ -176,87 +176,6 @@ export function ensureStandaloneContainerUpdatesFilter<T extends SearchPaginatio};}-// --- Image pull progress tracking -----export interface LayerProgress {- current: number;- total: number;- status: string;-}--function isLayerComplete(status: string): boolean {- const s = status.toLowerCase();- return (- s.includes('pull complete') ||- s.includes('already exists') ||- s.includes('downloaded newer image') ||- s.includes('image is up to date')- );-}--export function calculateOverallProgress(layers: Record<string, LayerProgress>): number {- const entries = Object.values(layers);- if (entries.length === 0) return 0;-- const totalLayers = entries.length;- let weightedSum = 0;-- for (const layer of entries) {- const s = (layer.status || '').toLowerCase();- if (isLayerComplete(s)) {- weightedSum += 1.0;- } else if (s.includes('extracting')) {- weightedSum += 0.95;- } else if (s.includes('verifying')) {- weightedSum += 0.92;- } else if (s.includes('download complete')) {- weightedSum += 0.85;- } else if (layer.total > 0) {- const downloadProgress = (layer.current / layer.total) * 0.85;- weightedSum += Math.min(downloadProgress, 0.85);- } else if (s.includes('downloading') || s.includes('pulling')) {- weightedSum += 0.05;- }- }-- const overallProgress = (weightedSum / totalLayers) * 100;- return Math.min(overallProgress, 100);-}--export function areAllLayersComplete(layers: Record<string, LayerProgress>): boolean {- const entries = Object.values(layers);- if (entries.length === 0) return false;-- return entries.every((l) => l.status && isLayerComplete(l.status));-}--export function getLayerStats(layers: Record<string, LayerProgress>, forceComplete = false) {- const entries = Object.entries(layers);- const total = entries.length;- const completed = entries.filter(([_, l]) => isLayerComplete(l.status || '')).length;- const effectiveCompleted = forceComplete ? total : completed;-- const downloading = entries.filter(([_, l]) => {- const s = (l.status || '').toLowerCase();- return s.includes('downloading') || s.includes('pulling');- }).length;-- const extracting = entries.filter(([_, l]) => l.status?.toLowerCase().includes('extracting')).length;-- return { total, completed: effectiveCompleted, downloading, extracting };-}--export function isIndeterminatePhase(layers: Record<string, LayerProgress>, currentProgress: number): boolean {- const stats = getLayerStats(layers);- if (stats.total === 0) return false;-- const downloadComplete = stats.downloading === 0;- const hasExtractingLayers = stats.extracting > 0;- const notAllComplete = stats.completed < stats.total;-- return downloadComplete && hasExtractingLayers && notAllComplete && currentProgress < 95;-}-export function extractErrorMessage(data: unknown, fallbackMessage: string): string {if (!data || typeof data !== 'object') return fallbackMessage;@@ -272,54 +191,6 @@ export function extractErrorMessage(data: unknown, fallbackMessage: string): strreturn fallbackMessage;}-export function updateLayerFromStreamData(layers: Record<string, LayerProgress>, data: unknown): Record<string, LayerProgress> {- if (!data || typeof data !== 'object') return layers;-- const obj = data as Record<string, unknown>;- const id = obj['id'] as string | undefined;- if (!id) return layers;-- const currentLayer = layers[id] || { current: 0, total: 0, status: '' };- const status = obj['status'] as string | undefined;-- if (status) {- currentLayer.status = status;- }-- const progressDetail = obj['progressDetail'] as Record<string, unknown> | undefined;- if (progressDetail) {- const current = progressDetail['current'] as number | undefined;- const total = progressDetail['total'] as number | undefined;- if (typeof current === 'number') currentLayer.current = current;- if (typeof total === 'number') currentLayer.total = total;- }-- return { ...layers, [id]: currentLayer };-}--export function getAggregateStatus(layers: Record<string, LayerProgress>, fallbackStatus = '', isComplete = false): string {- if (isComplete) return 'Pull complete';-- const entries = Object.values(layers);- if (entries.length === 0) return fallbackStatus;-- if (areAllLayersComplete(layers)) return 'Pull complete';-- const stats = getLayerStats(layers);-- if (stats.downloading > 0 || stats.extracting > 0) return 'Pulling';-- const hasVerifying = entries.some(- (l) => l.status?.toLowerCase().includes('verifying') || l.status?.toLowerCase().includes('digest')- );- if (hasVerifying) return 'Verifying checksum';-- const hasWaiting = entries.some((l) => l.status?.toLowerCase().includes('waiting'));- if (hasWaiting) return 'Waiting';-- return fallbackStatus || 'Preparing';-}-// --- Vulnerability scan polling ---const SCAN_IN_PROGRESS_STATUSES = new Set(['pending', 'scanning']);diff --git a/frontend/src/lib/utils/streaming.ts b/frontend/src/lib/utils/streaming.tsindex 5a50167b6..7c8b921db 100644--- a/frontend/src/lib/utils/streaming.ts+++ b/frontend/src/lib/utils/streaming.ts@@ -15,10 +15,16 @@ export function streamCacheBuster(): string {return `${Date.now()}-${Math.random().toString(36).slice(2)}`;}+/**+ * Reads an NDJSON stream, invoking the callbacks per parsed line. A callback+ * returning `true` stops reading and cancels the stream — used by operation+ * streams whose terminal {"done":true} frame marks completion, since proxies+ * do not always propagate the network EOF promptly.+ */export async function readNdjsonStream(body: ReadableStream<Uint8Array>,- onMessage?: (data: any) => void,- onLine?: (data: any) => void+ onMessage?: (data: any) => boolean | void,+ onLine?: (data: any) => boolean | void): Promise<void> {const reader = body.getReader();const decoder = new TextDecoder();@@ -43,8 +49,12 @@ export async function readNdjsonStream(continue;}- onLine?.(obj);- onMessage?.(obj);+ const stopFromLine = onLine?.(obj) === true;+ const stopFromMessage = onMessage?.(obj) === true;+ if (stopFromLine || stopFromMessage) {+ await reader.cancel().catch(() => {});+ return;+ }}}}diff --git a/frontend/src/lib/utils/watch-logs.ts b/frontend/src/lib/utils/watch-logs.tsnew file mode 100644index 000000000..f964c7904--- /dev/null+++ b/frontend/src/lib/utils/watch-logs.ts@@ -0,0 +1,59 @@+import { environmentStore } from '#lib/stores/environment.store.svelte';+import { operationWatchStore } from '#lib/stores/operation-watch.store.svelte';+import { ReconnectingWebSocket } from '#lib/utils/ws';++/**+ * Attaches the operation watch dialog to a project's live log stream, mirroring+ * the log phase of a non-detached `docker compose up`: each container line is+ * appended as `service | message`. sinceEpochSeconds scopes the backlog to the+ * operation, so the dialog shows every line the containers wrote since the+ * operation began (application startup included) without dredging up history+ * from previous runs. Returns a detach function that closes the stream.+ */+export function attachProjectLogsToWatch(projectId: string, sinceEpochSeconds: number): () => void {+ let active = true;++ const client = new ReconnectingWebSocket<string>({+ buildUrl: async () => {+ const envId = await environmentStore.getCurrentEnvironmentId();+ const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';+ return `${protocol}://${window.location.host}/api/environments/${envId}/ws/projects/${projectId}/logs?follow=true&tail=all&since=${sinceEpochSeconds}×tamps=false&format=json&batched=true`;+ },+ parseMessage: (evt) => {+ if (typeof evt.data !== 'string') return null;+ try {+ return JSON.parse(evt.data);+ } catch {+ return null;+ }+ },+ onMessage: (payload) => {+ if (!active || !payload) return;+ const entries = Array.isArray(payload) ? payload : [payload];+ for (const entry of entries) {+ appendLogEntryInternal(entry);+ }+ },+ shouldReconnect: () => active,+ maxBackoff: 10000+ });++ void client.connect();++ return () => {+ active = false;+ client.close();+ };+}++function appendLogEntryInternal(entry: unknown) {+ if (!entry || typeof entry !== 'object') {+ return;+ }+ const { service, message } = entry as { service?: unknown; message?: unknown };+ if (typeof message !== 'string' || message === '') {+ return;+ }+ const prefix = typeof service === 'string' && service !== '' ? `${service} | ` : '';+ operationWatchStore.append(`${prefix}${message}`);+}diff --git a/frontend/src/routes/(app)/+layout.svelte b/frontend/src/routes/(app)/+layout.svelteindex 1adb2d16a..da52dfd46 100644--- a/frontend/src/routes/(app)/+layout.svelte+++ b/frontend/src/routes/(app)/+layout.svelte@@ -6,6 +6,7 @@import AppSidebar from '#lib/components/sidebar/sidebar.svelte';import MobileNav from '#lib/components/mobile-nav/mobile-nav.svelte';import ActivityCenter from '#lib/components/activity/activity-center.svelte';+ import OperationWatchDialog from '#lib/components/operation-watch-dialog.svelte';import { IsMobile } from '#lib/hooks/is-mobile.svelte.js';import { IsTablet } from '#lib/hooks/is-tablet.svelte.js';import { getEffectiveNavigationSettings, navigationSettingsOverridesStore } from '#lib/utils/navigation';@@ -135,3 +136,5 @@{#if canReadActivities}<ActivityCenter />{/if}++<OperationWatchDialog />diff --git a/frontend/src/routes/(app)/images/builds/+page.svelte b/frontend/src/routes/(app)/images/builds/+page.svelteindex 884d830c6..eae5c695d 100644--- a/frontend/src/routes/(app)/images/builds/+page.svelte+++ b/frontend/src/routes/(app)/images/builds/+page.svelte@@ -13,6 +13,7 @@import { ResourceDetailLayout } from '#lib/layouts/index.js';import TabbedPageLayout from '#lib/layouts/tabbed-page-layout.svelte';import { sanitizeLogText } from '#lib/utils/formatting';+ import { formatDateTimeShort } from '#lib/utils/formatting';import IfPermitted from '#lib/components/if-permitted.svelte';import {CodeIcon,@@ -32,16 +33,7 @@import { UniversalMobileCard } from '#lib/components/arcane-table';import { Badge } from '#lib/components/ui/badge';import { ResponsiveDialog } from '#lib/components/ui/responsive-dialog/index.js';- import {- type LayerProgress,- calculateOverallProgress,- areAllLayersComplete,- updateLayerFromStreamData,- extractErrorMessage,- getLayerStats,- isIndeterminatePhase,- getAggregateStatus- } from '#lib/utils/docker';+ import { extractErrorMessage } from '#lib/utils/docker';import ResizableSplit from '#lib/components/resizable-split.svelte';import BuildControls from './components/build-controls.svelte';import BuildWorkspacePanel from './components/build-workspace-panel.svelte';@@ -53,7 +45,6 @@import type { Paginated, SearchPaginationSortRequest } from '#lib/types/shared';import { queryKeys } from '#lib/query/query-keys';import { createMutation, createQuery, useQueryClient } from '@tanstack/svelte-query';- import { formatDateTimeShort } from '#lib/utils/formatting';import { useUrlTab } from '#lib/hooks/use-url-tab.svelte';let {}: PageProps = $props();@@ -146,10 +137,8 @@let isBuilding = $state(false);let isDesktop = $state(true);- let buildProgress = $state(0);let buildStatusText = $state('');let buildError = $state('');- let layerProgress = $state<Record<string, LayerProgress>>({});let hasReachedComplete = $state(false);let logLines = $state<string[]>([]);let autoScroll = $state(true);@@ -274,12 +263,11 @@const reader = response.body.getReader();const decoder = new TextDecoder();let buffer = '';+ let streamComplete = false;- while (true) {+ while (!streamComplete) {const { done, value } = await reader.read();if (done) {- buildStatusText = m.finalizing_build();- appendLog(m.finalizing_build());break;}@@ -302,23 +290,24 @@continue;}- if (event.status) {- const idSuffix = event.id ? ` ${event.id}` : '';- appendLog(`${sanitizeLogText(String(event.status))}${idSuffix}`);- buildStatusText = sanitizeLogText(String(event.status));+ // The terminal frame marks success; don't wait on the network EOF.+ if (event.done === true) {+ streamComplete = true;+ break;}- layerProgress = updateLayerFromStreamData(layerProgress, event);- updateProgress();+ // Raw docker CLI output arrives framed as {"log":"<line>"}.+ if (typeof event.log === 'string') {+ appendLog(event.log);+ buildStatusText = sanitizeLogText(event.log);+ }} catch {appendLog(line);}}}-- updateProgress();- if (!buildError && buildProgress < 100 && areAllLayersComplete(layerProgress)) {- buildProgress = 100;+ if (streamComplete) {+ await reader.cancel().catch(() => {});}if (buildError) {@@ -326,7 +315,6 @@}hasReachedComplete = true;- buildProgress = 100;buildStatusText = m.build_completed();appendLog(m.build_completed());},@@ -335,17 +323,11 @@}}));- const layerStats = $derived(getLayerStats(layerProgress, hasReachedComplete));const aggregateStatus = $derived.by(() => {- const status = getAggregateStatus(layerProgress, buildStatusText, hasReachedComplete);- if (!isBuilding) return status;- if (!status) return m.progress_building();- const normalized = status.toLowerCase();- if (normalized === 'pulling' || normalized === 'preparing') return m.progress_building();- return status;+ if (hasReachedComplete) return m.build_completed();+ if (isBuilding) return buildStatusText || m.progress_building();+ return buildStatusText;});- const isIndeterminate = $derived(isIndeterminatePhase(layerProgress, buildProgress));- const progressValue = $derived(Math.round(hasReachedComplete ? 100 : buildProgress));const statusLabel = $derived.by(() => {if (buildError) return m.common_error();if (hasReachedComplete) return m.build_completed();@@ -364,17 +346,8 @@]);type BuildOutputEntry = {- raw: string;- isJson: boolean;- type?: string;- status?: string;- id?: string;- phase?: string;- error?: string;- progress?: {- current?: number;- total?: number;- };+ text: string;+ isError: boolean;};const buildHistoryOutputEntries = $derived.by(() => parseBuildOutput(buildHistorySelected?.output ?? ''));@@ -443,23 +416,16 @@function resetState() {isBuilding = false;- buildProgress = 0;buildStatusText = '';buildError = '';- layerProgress = {};hasReachedComplete = false;logLines = [];}function appendLog(line: string) {- const sanitized = sanitizeLogText(line);- // Some tools output standalone reset codes (which become empty after sanitizing).- if (sanitized.trim() === '') return;- logLines = [...logLines, sanitized];- }-- function updateProgress() {- buildProgress = calculateOverallProgress(layerProgress);+ // Keep ANSI sequences — the output panel renders them as colors.+ if (sanitizeLogText(line).trim() === '') return;+ logLines = [...logLines, line];}function parseTags(raw: string): string[] {@@ -570,29 +536,6 @@return `${seconds}s`;}- function formatBytes(value: number) {- if (!Number.isFinite(value) || value <= 0) return '0 B';- const units = ['B', 'KB', 'MB', 'GB', 'TB'];- let size = value;- let unitIndex = 0;- while (size >= 1024 && unitIndex < units.length - 1) {- size /= 1024;- unitIndex += 1;- }- const precision = size >= 10 || unitIndex === 0 ? 0 : 1;- return `${size.toFixed(precision)} ${units[unitIndex]}`;- }-- function getProgressPercent(current?: number, total?: number) {- if (current === undefined || total === undefined || total <= 0) return 0;- return Math.min(100, Math.max(0, Math.round((current / total) * 100)));- }-- function formatProgress(current?: number, total?: number) {- if (current === undefined || total === undefined || total <= 0) return '-';- return `${formatBytes(current)} / ${formatBytes(total)}`;- }-function formatBuildArgs(buildArgs?: Record<string, string>) {return formatKeyValueMap(buildArgs);}@@ -639,6 +582,9 @@return '/';}+ // Build history output is the raw docker CLI text of the build. Records+ // written before the raw-output change contain NDJSON progress events; pull+ // their text out so old history stays readable.function parseBuildOutput(output: string): BuildOutputEntry[] {if (!output) return [];return output@@ -648,30 +594,24 @@.map((line) => {try {const data = JSON.parse(line) as Record<string, unknown>;- if (!data || typeof data !== 'object') {- return { raw: sanitizeLogText(line), isJson: false } satisfies BuildOutputEntry;+ if (data && typeof data === 'object') {+ const error = data['error'];+ if (error) {+ const message =+ typeof error === 'object' && error !== null ? ((error as { message?: string }).message ?? line) : String(error);+ return { text: sanitizeLogText(message), isError: true } satisfies BuildOutputEntry;+ }+ const text = data['log'] ?? data['status'] ?? data['stream'];+ if (typeof text === 'string') {+ return { text: sanitizeLogText(text), isError: false } satisfies BuildOutputEntry;+ }}- const progressDetail = data['progressDetail'] as Record<string, unknown> | undefined;- const progress = progressDetail- ? {- current: typeof progressDetail['current'] === 'number' ? progressDetail['current'] : undefined,- total: typeof progressDetail['total'] === 'number' ? progressDetail['total'] : undefined- }- : undefined;- return {- raw: sanitizeLogText(line),- isJson: true,- type: typeof data['type'] === 'string' ? data['type'] : undefined,- status: data['status'] ? sanitizeLogText(String(data['status'])) : undefined,- id: data['id'] ? String(data['id']) : undefined,- phase: typeof data['phase'] === 'string' ? data['phase'] : undefined,- error: data['error'] ? sanitizeLogText(String(data['error'])) : undefined,- progress- } satisfies BuildOutputEntry;} catch {- return { raw: sanitizeLogText(line), isJson: false } satisfies BuildOutputEntry;+ // Raw text line.}- });+ return { text: sanitizeLogText(line), isError: false } satisfies BuildOutputEntry;+ })+ .filter((entry) => entry.text.trim() !== '');}function buildHistoryStatusLabel(status?: ImageBuildStatus) {@@ -1195,46 +1135,10 @@</div>{:else if buildHistorySelected?.output}{#if buildHistoryOutputEntries.length > 0}- <div class="space-y-2">- {#each buildHistoryOutputEntries as entry, entryIndex (entry.raw + entryIndex)}- <div- class={`rounded-lg border border-border/50 px-3 py-2 ${- entry.error ? 'border-destructive/40 bg-destructive/10' : 'bg-zinc-950/40'- }`}- >- <div class="flex items-start justify-between gap-3">- <div class="min-w-0">- <div- class="flex flex-wrap items-center gap-2 text-[10px] tracking-wide text-muted-foreground uppercase"- >- {#if entry.type}- <span class="rounded bg-zinc-800/60 px-1.5 py-0.5">{entry.type}</span>- {/if}- {#if entry.phase}- <span class="rounded bg-zinc-800/60 px-1.5 py-0.5">{entry.phase}</span>- {/if}- {#if entry.id}- <span class="font-mono text-[10px] break-all">{entry.id}</span>- {/if}- </div>- <div class={`mt-1 text-xs break-all ${entry.error ? 'text-destructive' : 'text-foreground'}`}>- {entry.error ?? entry.status ?? entry.raw}- </div>- </div>- {#if entry.progress?.total}- <div class="flex shrink-0 flex-col items-end gap-1">- <span class="text-[10px] text-muted-foreground tabular-nums">- {formatProgress(entry.progress.current, entry.progress.total)}- </span>- <div class="h-1 w-24 overflow-hidden rounded-full bg-zinc-800/70">- <div- class="h-full rounded-full bg-emerald-400"- style={`width: ${getProgressPercent(entry.progress.current, entry.progress.total)}%`}- ></div>- </div>- </div>- {/if}- </div>+ <div class="rounded-lg border border-border/50 bg-zinc-950/40 p-3 font-mono text-xs leading-relaxed">+ {#each buildHistoryOutputEntries as entry, entryIndex (entry.text + entryIndex)}+ <div class={`break-words whitespace-pre-wrap ${entry.isError ? 'text-destructive' : 'text-foreground'}`}>+ {entry.text}</div>{/each}</div>@@ -1313,10 +1217,7 @@<Tabs.Content value="output" class="mt-0 min-h-0 flex-1 overflow-hidden"><BuildOutputPanel{logLines}- {layerStats}{aggregateStatus}- {progressValue}- {isIndeterminate}{hasReachedComplete}{buildError}{isBuilding}@@ -1428,10 +1329,7 @@<Card.Root class="flex h-full min-h-[500px] flex-col overflow-hidden"><BuildOutputPanel{logLines}- {layerStats}{aggregateStatus}- {progressValue}- {isIndeterminate}{hasReachedComplete}{buildError}{isBuilding}diff --git a/frontend/src/routes/(app)/images/builds/components/build-output-panel.svelte b/frontend/src/routes/(app)/images/builds/components/build-output-panel.svelteindex c35c3d2c0..23b8f8f6e 100644--- a/frontend/src/routes/(app)/images/builds/components/build-output-panel.svelte+++ b/frontend/src/routes/(app)/images/builds/components/build-output-panel.svelte@@ -4,13 +4,7 @@import { ArcaneButton } from '#lib/components/arcane-button/index.js';import { TerminalIcon } from '#lib/icons';import { m } from '#lib/paraglide/messages';-- type LayerStats = {- total: number;- completed: number;- downloading: number;- extracting: number;- };+ import { ansiToHtml } from '#lib/utils/formatting';type AutoScrollParams = {enabled: boolean;@@ -19,10 +13,7 @@let {logLines,- layerStats,aggregateStatus,- progressValue,- isIndeterminate,hasReachedComplete,buildError,autoScroll = $bindable(true),@@ -30,10 +21,7 @@onReset}: {logLines: string[];- layerStats: LayerStats;aggregateStatus: string;- progressValue: number;- isIndeterminate: boolean;hasReachedComplete: boolean;buildError: string;autoScroll?: boolean;@@ -58,7 +46,7 @@</script><div class="flex h-full flex-col p-8">- <!-- Progress section with enhanced styling -->+ <!-- Status section --><div class="mb-6 shrink-0 space-y-4 rounded-2xl border border-border/50 bg-card p-5"><div class="flex items-center justify-between"><div class="flex items-center gap-3">@@ -73,34 +61,19 @@: 'bg-muted-foreground/30'}`}></div>- <span class="text-sm font-medium">+ <span class="truncate text-sm font-medium">{#if hasReachedComplete}{m.build_completed()}- {:else if layerStats.total > 0}- {aggregateStatus} · {m.progress_layers_status({ completed: layerStats.completed, total: layerStats.total })}{:else}{aggregateStatus || m.idle()}{/if}</span></div>- <div class="flex items-center gap-3">- {#if !isIndeterminate || hasReachedComplete}- <span class="text-sm font-medium text-muted-foreground">{progressValue}%</span>- {/if}- <SwitchWithLabel- id="auto-scroll"- checked={autoScroll}- label={m.auto_scroll()}- onCheckedChange={(v) => (autoScroll = v)}- />- </div>+ <SwitchWithLabel id="auto-scroll" checked={autoScroll} label={m.auto_scroll()} onCheckedChange={(v) => (autoScroll = v)} /></div>- <Progress- value={hasReachedComplete || isIndeterminate ? 100 : progressValue}- max={100}- class="h-1.5 w-full"- indeterminate={isIndeterminate && !hasReachedComplete}- />+ {#if isBuilding && !hasReachedComplete}+ <Progress value={100} max={100} class="h-1.5 w-full" indeterminate />+ {/if}</div><!-- Terminal output with refined styling -->@@ -108,9 +81,6 @@use:autoScrollToBottom={{ enabled: autoScroll, key: logLines.length }}class="group relative min-h-0 flex-1 overflow-auto rounded-2xl border border-border/50 bg-zinc-950 p-5 font-mono text-[13px] leading-[1.7] text-zinc-50 shadow-2xl shadow-black/50 dark:bg-zinc-950">- <!-- Subtle scanline effect overlay -->- <div class="pointer-events-none absolute inset-0 hidden"></div>-<div class="relative">{#if logLines.length === 0}<div class="flex min-h-[200px] items-center justify-center">@@ -121,7 +91,10 @@</div>{:else}{#each logLines as line, idx (idx)}- <div class="rounded px-1 py-0.5 break-words whitespace-pre-wrap transition-colors hover:bg-white/[0.03]">{line}</div>+ <!-- eslint-disable-next-line svelte/no-at-html-tags -- ansiToHtml escapes markup before adding color spans -->+ <div class="rounded px-1 py-0.5 break-words whitespace-pre-wrap transition-colors hover:bg-white/[0.03]">+ {@html ansiToHtml(line)}+ </div>{/each}{/if}</div>diff --git a/go.work.sum b/go.work.sumindex e6200c647..c210ab706 100644--- a/go.work.sum+++ b/go.work.sum@@ -420,6 +420,7 @@ github.com/Microsoft/cosesign1go v1.4.0/go.mod h1:1La/HcGw19rRLhPW0S6u55K6LKfti+github.com/Microsoft/didx509go v0.0.3 h1:n/owuFOXVzCEzSyzivMEolKEouBm9G0NrEDgoTekM8A=github.com/Microsoft/didx509go v0.0.3/go.mod h1:wWt+iQsLzn3011+VfESzznLIp/Owhuj7rLF7yLglYbk=github.com/Microsoft/go-winio v0.4.21/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=+github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=github.com/Microsoft/hcsshim v0.14.1/go.mod h1:VnzvPLyWUhxiPVsJ31P6XadxCcTogTguBFDy/1GR/OM=github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=@@ -499,6 +500,7 @@ github.com/aws/aws-sdk-go-v2 v1.39.6 h1:2JrPCVgWJm7bm83BDwY5z8ietmeJUbh3O2ACnn+Xgithub.com/aws/aws-sdk-go-v2 v1.39.6/go.mod h1:c9pm7VwuW0UPxAEYGyTmyurVcNrbF6Rt/wixFqDhcjE=github.com/aws/aws-sdk-go-v2 v1.41.1 h1:ABlyEARCDLN034NhxlRUSZr4l71mh+T5KAeGh6cerhU=github.com/aws/aws-sdk-go-v2 v1.41.1/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0=+github.com/aws/aws-sdk-go-v2 v1.42.0/go.mod h1:27+ACypSLljLAEKsCYOmrjKh83vuTRkuAe9Uv/3A4bg=github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 h1:6GMWV6CNpA/6fbFHnoAjrv4+LGfyTqZz2LtCHnspgDg=github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0/go.mod h1:/mXlTIVG9jbxkqDnr5UQNQxW1HRYxeGklkM9vAFeabg=github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.2 h1:t9yYsydLYNBk9cJ73rgPhPWqOh/52fcWDQB5b1JsKSY=@@ -529,6 +531,7 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.13 h1:T1brd5dR3/fzNFAQch/iBKgithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.13/go.mod h1:Peg/GBAQ6JDt+RoBf4meB1wylmAipb7Kg2ZFakZTlwk=github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.17 h1:I0GyV8wiYrP8XpA70g1HBcQO1JlQxCMTW9npl5UbDHY=github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.17/go.mod h1:tyw7BOl5bBe/oqvoIeECFJjMdzXoa/dfVz3QQ5lgHGA=+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.29/go.mod h1:QRnaRcTVGKPGRy8w78HMQtKUGRYcnMZAANATkeVA6Mo=github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10 h1:zeN9UtUlA6FTx0vFSayxSX32HDw73Yb6Hh2izDSFxXY=github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10/go.mod h1:3HKuexPDcwLWPaqpW2UR/9n8N/u/3CKcGAzSs8p8u8g=github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.12 h1:Zy6Tme1AA13kX8x3CnkHx5cqdGWGaj/anwOiWGnA0Xo=@@ -541,12 +544,14 @@ github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.13 h1:a+8/MLcWlIxo1lF9xgithub.com/aws/aws-sdk-go-v2/internal/configsources v1.4.13/go.mod h1:oGnKwIYZ4XttyU2JWxFrwvhF6YKiK/9/wmE3v3Iu9K8=github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17 h1:xOLELNKGp2vsiteLsvLPwxC+mYmO6OZ8PYgiuPJzF8U=github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17/go.mod h1:5M5CI3D12dNOtH3/mk6minaRwI2/37ifCURZISxA/IQ=+github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.29/go.mod h1:MzoLFUArKGpGD+ukmPiTPG1X5x4o6M2kq4v2dr1FiEc=github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.4 h1:j7vjtr1YIssWQOMeOWRbh3z8g2oY/xPjnZH2gLY4sGw=github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.4/go.mod h1:yDmJgqOiH4EA8Hndnv4KwAo8jCGTSnM5ASG1nBI+toA=github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.13 h1:HBSI2kDkMdWz4ZM7FjwE7e/pWDEZ+nR95x8Ztet1ooY=github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.13/go.mod h1:YE94ZoDArI7awZqJzBAZ3PDD2zSfuP7w6P2knOzIn8M=github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.17 h1:WWLqlh79iO48yLkj1v3ISRNiv+3KdQoZ6JWyfcsyQik=github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.17/go.mod h1:EhG22vHRrvF8oXSTYStZhJc1aUgKtnJe+aOiFEV90cM=+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.29/go.mod h1:71wt8W2EgswdZy9Mf9KNnzxZ3TiZlv4caKghPktDOkA=github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk=@@ -557,12 +562,14 @@ github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.4 h1:BE/MNQ86yzTINrfxPPFS86QCBNQegithub.com/aws/aws-sdk-go-v2/internal/v4a v1.4.4/go.mod h1:SPBBhkJxjcrzJBc+qY85e83MQ2q3qdra8fghhkkyrJg=github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.12 h1:itu4KHu8JK/N6NcLIISlf3LL1LccMqruLUXZ9y7yBZw=github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.12/go.mod h1:i+6vTU3xziikTY3vcox23X8pPGW5X3wVgd1VZ7ha+x8=+github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.30/go.mod h1:AS0HycUvJRFvTt613AYDOgO2jzw+00cVSMny8XB3yMY=github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 h1:6+lZi2JeGKtCraAj1rpoZfKqnQ9SptseRZioejfUOLM=github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0/go.mod h1:eb3gfbVIxIoGgJsi9pGne19dhCBpK6opTYpQqAmdy44=github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.3 h1:x2Ibm/Af8Fi+BH+Hsn9TXGdT+hKbDd5XOTZxTMxDk7o=github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.3/go.mod h1:IW1jwyrQgMdhisceG8fQLmQIydcT/jWY21rFhzgaKwo=github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 h1:0ryTNEdJbzUCEWkVXEXoqlXV72J5keC1GvILMOuD00E=github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4/go.mod h1:HQ4qwNZh32C3CBeO6iJLQlgtMzqeG17ziAA/3KDJFow=+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.12/go.mod h1:Ms4zlcVBbXbiP7EVLhl+lgjvA/a7YphqQ3Ih3174EmI=github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.4 h1:Beh9oVgtQnBgR4sKKzkUBRQpf1GnL4wt0l4s8h2VCJ0=github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.4/go.mod h1:b17At0o8inygF+c6FOD3rNyYZufPw62o9XJbSfQPgbo=github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.3 h1:NEe7FaViguRQEm8zl8Ay/kC/QRsMtWUiCGZajQIsLdc=@@ -575,6 +582,7 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.13 h1:kDqdFvMYgithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.13/go.mod h1:lmKuogqSU3HzQCwZ9ZtcqOc5XGMqtDK7OIc2+DxiUEg=github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.17 h1:RuNSMoozM8oXlgLG/n6WLaFGoea7/CddrCfIiSA+xdY=github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.17/go.mod h1:F2xxQ9TZz5gDWsclCtPQscGpP0VUOc8RqgFM3vDENmU=+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.29/go.mod h1:LfRkPCD8YHDM2E5eTkos2UpwYeZnBcVarTa8L59bJHA=github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.4 h1:HVSeukL40rHclNcUqVcBwE1YoZhOkoLeBfhUqR3tjIU=github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.4/go.mod h1:DnbBOv4FlIXHj2/xmrUQYtawRFC9L9ZmQPz+DBc6X5I=github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.12 h1:R3uW0iKl8rgNEXNjVGliW/oMEh9fO/LlUEV8RvIFr1I=@@ -598,18 +606,21 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.30.3 h1:NjShtS1t8r5LUfFVtFeI8xLAHQNTgithub.com/aws/aws-sdk-go-v2/service/sso v1.30.3/go.mod h1:fKvyjJcz63iL/ftA6RaM8sRCtN4r4zl4tjL3qw5ec7k=github.com/aws/aws-sdk-go-v2/service/sso v1.30.9 h1:v6EiMvhEYBoHABfbGB4alOYmCIrcgyPPiBE1wZAEbqk=github.com/aws/aws-sdk-go-v2/service/sso v1.30.9/go.mod h1:yifAsgBxgJWn3ggx70A3urX2AN49Y5sJTD1UQFlfqBw=+github.com/aws/aws-sdk-go-v2/service/sso v1.31.3/go.mod h1:Lk7PlmoTYryQmyBG0EXqj5BcUbj3whXdU2s3yGI3EAc=github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.0 h1:Bnr+fXrlrPEoR1MAFrHVsge3M/WoK4n23VNhRM7TPHI=github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.0/go.mod h1:eknndR9rU8UpE/OmFpqU78V1EcXPKFTTm5l/buZYgvM=github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.7 h1:gTsnx0xXNQ6SBbymoDvcoRHL+q4l/dAFsQuKfDWSaGc=github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.7/go.mod h1:klO+ejMvYsB4QATfEOIXk8WAEwN4N0aBfJpvC+5SZBo=github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.13 h1:gd84Omyu9JLriJVCbGApcLzVR3XtmC4ZDPcAI6Ftvds=github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.13/go.mod h1:sTGThjphYE4Ohw8vJiRStAcu3rbjtXRsdNB0TvZ5wwo=+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.36.6/go.mod h1:Q5N6icH+KJZDLh+ESNwzdv6cZ6vLFF/egy3IOxWhmz4=github.com/aws/aws-sdk-go-v2/service/sts v1.38.0 h1:iV1Ko4Em/lkJIsoKyGfc0nQySi+v0Udxr6Igq+y9JZc=github.com/aws/aws-sdk-go-v2/service/sts v1.38.0/go.mod h1:bEPcjW7IbolPfK67G1nilqWyoxYMSPrDiIQ3RdIdKgo=github.com/aws/aws-sdk-go-v2/service/sts v1.40.2 h1:HK5ON3KmQV2HcAunnx4sKLB9aPf3gKGwVAf7xnx0QT0=github.com/aws/aws-sdk-go-v2/service/sts v1.40.2/go.mod h1:E19xDjpzPZC7LS2knI9E6BaRFDK43Eul7vd6rSq2HWk=github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 h1:5fFjR/ToSOzB2OQ/XqWpZBmNvmP/pJ1jOWYlFDJTjRQ=github.com/aws/aws-sdk-go-v2/service/sts v1.41.6/go.mod h1:qgFDZQSD/Kys7nJnVqYlWKnh0SSdMjAi0uSwON4wgYQ=+github.com/aws/aws-sdk-go-v2/service/sts v1.43.3/go.mod h1:r8wkDOuLaaMFqFiYAb8dGY2A3gJCOujMc6CFOVC4Zhc=github.com/aws/smithy-go v1.22.5 h1:P9ATCXPMb2mPjYBgueqJNCA5S9UfktsW0tTxi+a7eqw=github.com/aws/smithy-go v1.22.5/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=github.com/aws/smithy-go v1.23.2 h1:Crv0eatJUQhaManss33hS5r40CG3ZFH+21XSkqMrIUM=@@ -617,6 +628,7 @@ github.com/aws/smithy-go v1.23.2/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pgithub.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk=github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0=github.com/aws/smithy-go v1.27.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=+github.com/aws/smithy-go v1.27.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=github.com/aymanbagabas/go-udiff v0.4.0/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w=github.com/beevik/ntp v1.5.0 h1:y+uj/JjNwlY2JahivxYvtmv4ehfi3h74fAuABB9ZSM4=github.com/beevik/ntp v1.5.0/go.mod h1:mJEhBrwT76w9D+IfOEGvuzyuudiW9E52U2BaTrMOYow=@@ -667,6 +679,7 @@ github.com/bytedance/gopkg v0.1.4 h1:oZnQwnX82KAIWb7033bEwtxvTqXcYMxDBaQxo5JJHWMgithub.com/bytedance/gopkg v0.1.4/go.mod h1:v1zWfPm21Fb+OsyXN2VAHdL6TBb2L88anLQgdyje6R4=github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE=github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k=+github.com/bytedance/sonic v1.15.1 h1:nJD5PmM0vY7J8CT6MxoqbVAAMhkSmV2HgRAUrrpLoOw=github.com/bytedance/sonic v1.15.1/go.mod h1:mT2NbXunuaEbnZ+mRIX/vYqKISmgEuHFDI4UzmKx2SA=github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE=github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=@@ -737,6 +750,7 @@ github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PYgithub.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=+github.com/cloudwego/base64x v0.1.7 h1:NppS+Fgzg5ovhn4NkUXaDT3x9jldgH5ToMCqzBSi2zI=github.com/cloudwego/base64x v0.1.7/go.mod h1:Cu1PV9zfrSf7ET2tIbWbbEy7jO7HHJ13q4X2SQ8aWYg=github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=@@ -858,9 +872,11 @@ github.com/danielgtaylor/huma/v2 v2.35.0 h1:FRg3FgVKcMogVhbNY7FjyTwk+p/orLBR3hQBgithub.com/danielgtaylor/huma/v2 v2.35.0/go.mod h1:3elp5brzdyyZsPlDVvf6w8RLnklKp3abolr+5op3fP0=github.com/danielgtaylor/mexpr v1.9.1 h1:nA9bsGRmNlJeVCPFgGf7WhrLuKag/+iWfOaJ03iKFPI=github.com/danielgtaylor/mexpr v1.9.1/go.mod h1:kAivYNRnBeE/IJinqBvVFvLrX54xX//9zFYwADo4Bc8=+github.com/danielgtaylor/mexpr v1.10.1 h1:e5wCXTcOARDhTTM5ho8lINK36VVaDcWt0o7gO5lPOag=github.com/danielgtaylor/mexpr v1.10.1/go.mod h1:kAivYNRnBeE/IJinqBvVFvLrX54xX//9zFYwADo4Bc8=github.com/danielgtaylor/shorthand/v2 v2.2.0 h1:hVsemdRq6v3JocP6YRTfu9rOoghZI9PFmkngdKqzAVQ=github.com/danielgtaylor/shorthand/v2 v2.2.0/go.mod h1:t5QfaNf7DPru9ZLIIhPQSO7Gyvajm3euw7LxB/MTUqE=+github.com/danielgtaylor/shorthand/v2 v2.4.0 h1:IeVgSkTMPXQ/CC3f+pfCiipoJXtXbBO9oVzjaPRXfEM=github.com/danielgtaylor/shorthand/v2 v2.4.0/go.mod h1:+JG16ZY99pciTkGphx18ruwefahdwHCv/jmllgUGKSM=github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ=github.com/danieljoos/wincred v1.2.3/go.mod h1:6qqX0WNrS4RzPZ1tnroDzq9kY3fu1KwE7MRLQK4X0bs=@@ -981,7 +997,6 @@ github.com/fullstorydev/grpcurl v1.9.3/go.mod h1:/b4Wxe8bG6ndAjlfSUjwseQReUDUvBJgithub.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo=github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=-github.com/fxamacker/cbor/v2 v2.9.2/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM=github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=github.com/getarcaneapp/arcane/types v0.0.0-20251219045603-8a9960a2bf04/go.mod h1:7Wj+0JnpYq4RQS+otyM6e4zkyJKDC01wxkWPyFCHwZA=@@ -1001,8 +1016,6 @@ github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=github.com/go-chi/chi/v5 v5.2.2/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=-github.com/go-chi/chi/v5 v5.3.0 h1:halUjDxhshgXHMrao5bB8eNBXo/rnzwr8m5m36glehM=-github.com/go-chi/chi/v5 v5.3.0/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=github.com/go-co-op/gocron/v2 v2.18.2/go.mod h1:Zii6he+Zfgy5W9B+JKk/KwejFOW0kZTFvHtwIpR4aBI=github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw=github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw=@@ -1067,6 +1080,7 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8Wdgithub.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=+github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=github.com/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI=github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM=github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=@@ -1100,11 +1114,13 @@ github.com/gofiber/fiber/v2 v2.52.13 h1:TOKP64iqC9b5P49VrBW5tHhUOvDyrtJ0xePEfzJbgithub.com/gofiber/fiber/v2 v2.52.13/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw=github.com/gofiber/fiber/v3 v3.2.0 h1:g9+09D320foINPpCnR3ibQ5oBEFHjAWRRfDG1te54u8=github.com/gofiber/fiber/v3 v3.2.0/go.mod h1:FHOsc2Db7HhHpsE62QAaJlXVV1pNkbZEptZ4jtti7m4=+github.com/gofiber/fiber/v3 v3.3.0 h1:QBd3sYCqdy6Qs5gJYzSw4I4SbqL204jPqpdub/ueiw8=github.com/gofiber/fiber/v3 v3.3.0/go.mod h1:YH7/TAoRaU4kF8slDCtQuFJ1NzC+3MtxUI4KfvQtaIA=github.com/gofiber/schema v1.7.1 h1:oSJBKdgP8JeIME4TQSAqlNKTU2iBB+2RNmKi8Nsc+TI=github.com/gofiber/schema v1.7.1/go.mod h1:A/X5Ffyru4p9eBdp99qu+nzviHzQiZ7odLT+TwxWhbk=github.com/gofiber/utils/v2 v2.0.4 h1:WwAxUA7L4MW2DjdEHF234lfqvBqd2vYYuBtA9TJq2ec=github.com/gofiber/utils/v2 v2.0.4/go.mod h1:GGERKU3Vhj5z6hS8YKvxL99A54DjOvTFZ0cjZnG4Lj4=+github.com/gofiber/utils/v2 v2.0.6 h1:7fXYy7nSsyqbH0GQUMtK4Kwjy4J7R5742VM7JsZxzOs=github.com/gofiber/utils/v2 v2.0.6/go.mod h1:p7mAHAk3+oUK10ZX2xTw9fZQixb4hCg8SKd4IH2xroU=github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=@@ -1177,10 +1193,12 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=github.com/google/go-containerregistry v0.20.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI=github.com/google/go-containerregistry v0.20.6/go.mod h1:T0x8MuoAoKX/873bkeSfLD2FAkwCDf9/HZgsFJ02E2Y=github.com/google/go-containerregistry v0.20.7/go.mod h1:Lx5LCZQjLH1QBaMPeGwsME9biPeo1lPx6lbGj/UmzgM=+github.com/google/go-containerregistry v0.21.6/go.mod h1:U7MMSBIJynke2MVQrQk19NP9k/uQsGz/h0amIFSHMbo=github.com/google/go-dap v0.12.0 h1:rVcjv3SyMIrpaOoTAdFDyHs99CwVOItIJGKLQFQhNeM=github.com/google/go-dap v0.12.0/go.mod h1:tNjCASCm5cqePi/RVXXWEVqtnNLV1KTWtYOqu6rZNzc=github.com/google/go-dap v0.12.1-0.20250904181021-d7a2259b058b h1:m+yLjBIoXaMKk6pwd1IJYYgM76+mwcy7J9+cuY7LqmQ=@@ -1209,6 +1227,7 @@ github.com/google/trillian v1.7.3 h1:hziW+vo4czis48tzx2GK5xRBl/ZxBA9B0/UR5avXOrogithub.com/google/trillian v1.7.3/go.mod h1:qh8iy4x/GvnVXUBd5pK4oncuT1Y9vVYfibQVsR/WpKg=github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=+github.com/google/wire v0.7.0/go.mod h1:n6YbUQD9cPKTnHXEBN2DXlOp/mVADhVErcMFb0v3J18=github.com/googleapis/cloud-bigtable-clients-test v0.0.4 h1:9f+NjgCZHLx7t2lyL+Zhyg5f9/eFNI4RryGWlbcTwqk=github.com/googleapis/cloud-bigtable-clients-test v0.0.4/go.mod h1:NNHPqSxC2OBSLmt1j/qofCRRzL0OYZxk24CsicIe8MA=github.com/googleapis/enterprise-certificate-proxy v0.3.6 h1:GW/XbdyBFQ8Qe+YAmFU9uHLo7OnF5tL52HFAgMmyrf4=@@ -1721,11 +1740,14 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPgithub.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=+github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=+github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=+github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=github.com/prometheus/otlptranslator v0.0.2 h1:+1CdeLVrRQ6Psmhnobldo0kTp96Rj80DRXRd5OSnMEQ=github.com/prometheus/otlptranslator v0.0.2/go.mod h1:P8AwMgdD7XEr6QRUJ2QWLpiAZTgTE2UYgjlu3svompI=@@ -1735,6 +1757,7 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6Rgithub.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=+github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw=@@ -1748,6 +1771,7 @@ github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=+github.com/quic-go/quic-go v0.59.1 h1:0Gmua0HW1Tv7ANR7hUYwRyD0MG5OJfgvYSZasGZzBic=github.com/quic-go/quic-go v0.59.1/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=@@ -1943,6 +1967,7 @@ github.com/valyala/fasthttp v1.69.0 h1:fNLLESD2SooWeh2cidsuFtOcrEi4uB4m1mPrkJMZygithub.com/valyala/fasthttp v1.69.0/go.mod h1:4wA4PfAraPlAsJ5jMSqCE2ug5tqUPwKXxVj8oNECGcw=github.com/valyala/fasthttp v1.70.0 h1:LAhMGcWk13QZWm85+eg8ZBNbrq5mnkWFGbHMUJHIdXA=github.com/valyala/fasthttp v1.70.0/go.mod h1:oDZEHHkJ/Buyklg6uURmYs19442zFSnCIfX3j1FY3pE=+github.com/valyala/fasthttp v1.71.0 h1:tepR7H+Guh9VUqxxcPggYi8R3lGUu2Rsdh+z7/FCY3k=github.com/valyala/fasthttp v1.71.0/go.mod h1:z1sDUvOShhXq/C9mwH/fSm1Vb71tUJwmQdgkBrBNwnA=github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=@@ -2085,6 +2110,8 @@ go.etcd.io/gofail v0.2.0 h1:p19drv16FKK345a09a1iubchlw/vmRuksmRzgBIGjcA=go.etcd.io/gofail v0.2.0/go.mod h1:nL3ILMGfkXTekKI3clMBNazKnjUZjYLKmBHzsVAnC1o=go.etcd.io/raft/v3 v3.6.0 h1:5NtvbDVYpnfZWcIHgGRk9DyzkBIXOi8j+DDp1IcnUWQ=go.etcd.io/raft/v3 v3.6.0/go.mod h1:nLvLevg6+xrVtHUmVaTcTz603gQPHfh7kUAwV6YpfGo=+go.getarcane.app/builds v0.3.0 h1:6fCgHy6PaEr3LpCtiF1iCdT4nuV3D3xvUHnV+E/0cqk=+go.getarcane.app/builds v0.3.0/go.mod h1:yZJDSh9XX/sgZlwx7lghHEucgZeQ74Gr/Fx+XdR2bdk=go.getarcane.app/updater v0.3.6 h1:+BqoycaRsHj+cLVSzcYQuqbHxUKbtmaozMNblz5bVSw=go.getarcane.app/updater v0.3.6/go.mod h1:2ENitZR/lA5MuBn60OZYR5wvU3ZCE+pAgfrebfOlRDA=go.getarcane.app/updater v0.3.7 h1:WqHsxudvt8gvCR7iSHdxdzwH0+hM0FAh64bSypBX9Mo=@@ -2095,6 +2122,7 @@ go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsgo.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=go.mongodb.org/mongo-driver/v2 v2.5.0 h1:yXUhImUjjAInNcpTcAlPHiT7bIXhshCTL3jVBkF3xaE=go.mongodb.org/mongo-driver/v2 v2.5.0/go.mod h1:yOI9kBsufol30iFsl1slpdq1I0eHPzybRWdyYUs8K/0=+go.mongodb.org/mongo-driver/v2 v2.6.0 h1:b9sJOYrkmt4l8bY43ZenFBcPlhYIjaOfYHLtbB/5qi8=go.mongodb.org/mongo-driver/v2 v2.6.0/go.mod h1:yOI9kBsufol30iFsl1slpdq1I0eHPzybRWdyYUs8K/0=go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=go.opentelemetry.io/contrib/detectors/gcp v1.38.0 h1:ZoYbqX7OaA/TAikspPl3ozPI6iY6LiIY9I8cUfm+pJs=@@ -2191,6 +2219,7 @@ go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=+go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=@@ -2207,6 +2236,7 @@ golang.org/x/arch v0.24.0 h1:qlJ3M9upxvFfwRM51tTg3Yl+8CP9vCC1E7vlFpgv99Y=golang.org/x/arch v0.24.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=golang.org/x/arch v0.25.0 h1:qnk6Ksugpi5Bz32947rkUgDt9/s5qvqDPl/gBKdMJLE=golang.org/x/arch v0.25.0/go.mod h1:0X+GdSIP+kL5wPmpK7sdkEVTt2XoYP0cSjQSbZBwOi8=+golang.org/x/arch v0.27.0 h1:0WNVcR8u9yFz8j5FvdHpgwNp3FS5U4guYdzHwEiGjoU=golang.org/x/arch v0.27.0/go.mod h1:0X+GdSIP+kL5wPmpK7sdkEVTt2XoYP0cSjQSbZBwOi8=golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=@@ -2265,7 +2295,6 @@ golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU=golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU=golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ=-golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0=golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=@@ -2313,7 +2342,6 @@ golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=-golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec=golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo=@@ -2330,6 +2358,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJgolang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=+golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=@@ -2342,7 +2371,6 @@ golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=-golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=@@ -2370,6 +2398,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBcgolang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=@@ -2400,7 +2429,7 @@ golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=-golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=+golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 h1:LvzTn0GQhWuvKH/kVRS3R3bVAsdQWI7hvfLHGgh9+lU=golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE=@@ -2443,6 +2472,7 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=+golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=@@ -2491,6 +2521,7 @@ golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlggolang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=+golang.org/x/tools v0.46.0/go.mod h1:FrD85F8l+NWL+9XWBSyVSHO6Ne4jutsfIFba7AWQ5Ys=golang.org/x/tools/go/expect v0.1.0-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM=golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=diff --git a/tests/spec/activity-center.spec.ts b/tests/spec/activity-center.spec.tsindex e5b8cc99b..886e4e16e 100644--- a/tests/spec/activity-center.spec.ts+++ b/tests/spec/activity-center.spec.ts@@ -562,7 +562,8 @@ test.describe('Activity Center', () => {// the assertions to the expanded panel.const detailPanel = activityCenter.locator('[data-collapsible-content][data-state="open"]');await expect(detailPanel.getByText('Output', { exact: true })).toBeVisible();- await expect(detailPanel.getByText('Creating network').first()).toBeVisible();+ // The output pane shows the activity's messages verbatim; step labels+ // (e.g. "Creating network") are no longer rendered in the detail panel.await expect(detailPanel.getByText('Network created successfully').first()).toBeVisible();await expect(detailPanel.getByText('Source environment')).toBeVisible();await expect(detailPanel.getByText('Started by', { exact: true })).toBeVisible();diff --git a/tests/spec/builds.spec.ts b/tests/spec/builds.spec.tsindex 11c474136..5f566bf44 100644--- a/tests/spec/builds.spec.ts+++ b/tests/spec/builds.spec.ts@@ -5,8 +5,9 @@ const ROUTES = {};const STREAM_SUCCESS =- '{"type":"build","phase":"begin","service":"manual","status":"build started"}\n' +- '{"type":"build","phase":"complete","service":"manual","status":"build complete"}\n';+ '{"log":"#1 [internal] load build definition from Dockerfile"}\n' ++ '{"log":"#8 naming to docker.io/e2e/build done"}\n' ++ '{"done":true}\n';const FIELD_LABELS = {cacheTo: 'Cache To',diff --git a/tests/spec/project.spec.ts b/tests/spec/project.spec.tsindex 1787de40d..728b23f26 100644--- a/tests/spec/project.spec.ts+++ b/tests/spec/project.spec.ts@@ -15,7 +15,9 @@ const ROUTES = {};const DEPLOY_STREAM_SUCCESS =- '{"type":"deploy","phase":"begin"}\n' + '{"type":"deploy","phase":"complete"}\n';+ '{"log":"Container test-1 Creating"}\n' ++ '{"log":"Container test-1 Started"}\n' ++ '{"done":true}\n';async function navigateToProjects(page: Page) {await page.goto(ROUTES.page);