gui/pkg/browser/register.go
Snider 1e0b89b94e feat(browser): add browser core.Service with Platform interface and IPC
Implements pkg/browser with three-layer pattern: IPC Bus -> Service -> Platform.
Stateless service — delegates OpenURL and OpenFile to platform adapter.
No queries or actions, tasks only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 14:35:01 +00:00

15 lines
471 B
Go

// pkg/browser/register.go
package browser
import "forge.lthn.ai/core/go/pkg/core"
// Register creates a factory closure that captures the Platform adapter.
// The returned function has the signature WithService requires: func(*Core) (any, error).
func Register(p Platform) func(*core.Core) (any, error) {
return func(c *core.Core) (any, error) {
return &Service{
ServiceRuntime: core.NewServiceRuntime[Options](c, Options{}),
platform: p,
}, nil
}
}