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
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package hostadapter
|
|
|
|
import (
|
|
agentruntime "github.com/tutti-os/tutti/packages/agent/daemon/runtime"
|
|
host "github.com/tutti-os/tutti/packages/agent/host"
|
|
)
|
|
|
|
func runtimeMCPServerBindings(input []host.MCPServerBinding) []agentruntime.MCPServerBinding {
|
|
if len(input) == 0 {
|
|
return nil
|
|
}
|
|
result := make([]agentruntime.MCPServerBinding, 0, len(input))
|
|
for _, binding := range input {
|
|
headers := make(map[string]string, len(binding.Headers))
|
|
for key, value := range binding.Headers {
|
|
headers[key] = value
|
|
}
|
|
result = append(result, agentruntime.MCPServerBinding{Name: binding.Name, Type: binding.Type, URL: binding.URL, Headers: headers})
|
|
}
|
|
return result
|
|
}
|
|
|
|
func hostMCPServerBindings(input []agentruntime.MCPServerBinding) []host.MCPServerBinding {
|
|
if len(input) == 0 {
|
|
return nil
|
|
}
|
|
result := make([]host.MCPServerBinding, 0, len(input))
|
|
for _, binding := range input {
|
|
headers := make(map[string]string, len(binding.Headers))
|
|
for key, value := range binding.Headers {
|
|
headers[key] = value
|
|
}
|
|
result = append(result, host.MCPServerBinding{Name: binding.Name, Type: binding.Type, URL: binding.URL, Headers: headers})
|
|
}
|
|
return result
|
|
}
|