display.Service now exposes a SchemeHandler interface; new scheme_handler.go implements the core:// dispatcher covering the 7 RFC routes: - settings, store, network, models → core.QUERY dispatch - agent, wallet, identity → core.ACTION dispatch Validates URL shape (rejects paths beyond the scheme host, malformed URLs), unknown routes return a named error. Good/Bad/Ugly tests + godoc example. AssetServer startup wiring deferred — no tracked Wails bootstrap (application.New / wails.Run / AssetServer config) exists in this worktree yet; handler is ready for wiring when that lands. Closes tasks.lthn.sh/view.php?id=15 Co-authored-by: Codex <noreply@openai.com> Co-Authored-By: Virgil <virgil@lethean.io>
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
// pkg/display/interfaces.go
|
|
package display
|
|
|
|
import (
|
|
"net/url"
|
|
|
|
core "dappco.re/go/core"
|
|
"github.com/wailsapp/wails/v3/pkg/application"
|
|
)
|
|
|
|
// RouteSchemeHandler dispatches a parsed route URL through Core.
|
|
//
|
|
// result := handler.Handle(parsedURL)
|
|
type RouteSchemeHandler interface {
|
|
Handle(url *url.URL) core.Result
|
|
}
|
|
|
|
// SchemeHandlerProvider exposes the active route scheme handler.
|
|
//
|
|
// handler := svc.SchemeHandler()
|
|
type SchemeHandlerProvider interface {
|
|
SchemeHandler() RouteSchemeHandler
|
|
}
|
|
|
|
// App abstracts the Wails application for the orchestrator.
|
|
// After Spec D cleanup, only Quit() and Logger() remain —
|
|
// all other Wails Manager APIs are accessed via IPC.
|
|
type App interface {
|
|
Logger() Logger
|
|
Quit()
|
|
}
|
|
|
|
// Logger wraps Wails logging.
|
|
type Logger interface {
|
|
Info(message string, args ...any)
|
|
}
|
|
|
|
// wailsApp wraps *application.App for the App interface.
|
|
type wailsApp struct {
|
|
app *application.App
|
|
}
|
|
|
|
func newWailsApp(app *application.App) App {
|
|
return &wailsApp{app: app}
|
|
}
|
|
|
|
func (w *wailsApp) Logger() Logger { return w.app.Logger }
|
|
func (w *wailsApp) Quit() { w.app.Quit() }
|