Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
46 lines
1.2 KiB
Go
46 lines
1.2 KiB
Go
package eventstream
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
|
|
workbenchbiz "github.com/tutti-os/tutti/services/tuttid/biz/workbench"
|
|
)
|
|
|
|
type WorkbenchNodeLaunchPublisher struct {
|
|
Service *Service
|
|
}
|
|
|
|
func (p WorkbenchNodeLaunchPublisher) PublishWorkbenchNodeLaunchRequested(
|
|
ctx context.Context,
|
|
request workbenchbiz.NodeLaunchRequest,
|
|
) error {
|
|
if p.Service == nil {
|
|
return nil
|
|
}
|
|
request = workbenchbiz.NormalizeNodeLaunchRequest(request)
|
|
if request.WorkspaceID == "" || request.TypeID == "" || request.Source == "" {
|
|
return fmt.Errorf("workbench node launch request requires workspaceId, typeId, and source")
|
|
}
|
|
payload := workbenchNodeLaunchRequestedPayload{
|
|
WorkspaceID: request.WorkspaceID,
|
|
TypeID: request.TypeID,
|
|
Source: request.Source,
|
|
LaunchSource: request.LaunchSource,
|
|
DockEntryID: request.DockEntryID,
|
|
RequestID: request.RequestID,
|
|
Payload: request.Payload,
|
|
}
|
|
encoded, err := json.Marshal(payload)
|
|
if err != nil {
|
|
return fmt.Errorf("marshal workbench node launch requested payload: %w", err)
|
|
}
|
|
return p.Service.PublishFromServerScoped(
|
|
ctx,
|
|
TopicWorkspaceWorkbenchNodeLaunchRequested,
|
|
encoded,
|
|
EventScope{WorkspaceID: request.WorkspaceID},
|
|
)
|
|
}
|