Implements the Core IPC design with four dispatch patterns: - ACTION: fire-and-forget broadcast (existing) - QUERY: first responder returns data - QUERYALL: all responders return data - PERFORM: first responder executes task Updates git and agentic services to use Query/Task patterns. Adds dev service for workflow orchestration. Refactors dev work command to use worker bundles. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
71 lines
1.8 KiB
Go
71 lines
1.8 KiB
Go
// Package framework provides the Core DI/service framework.
|
|
// Import this package for cleaner access to the framework types.
|
|
//
|
|
// Usage:
|
|
//
|
|
// import "github.com/host-uk/core/pkg/framework"
|
|
//
|
|
// app, _ := framework.New(
|
|
// framework.WithServiceLock(),
|
|
// )
|
|
package framework
|
|
|
|
import (
|
|
"github.com/host-uk/core/pkg/framework/core"
|
|
)
|
|
|
|
// Re-export core types for cleaner imports
|
|
type (
|
|
Core = core.Core
|
|
Option = core.Option
|
|
Message = core.Message
|
|
Query = core.Query
|
|
Task = core.Task
|
|
QueryHandler = core.QueryHandler
|
|
TaskHandler = core.TaskHandler
|
|
Startable = core.Startable
|
|
Stoppable = core.Stoppable
|
|
Config = core.Config
|
|
Display = core.Display
|
|
WindowOption = core.WindowOption
|
|
Features = core.Features
|
|
Contract = core.Contract
|
|
Error = core.Error
|
|
ServiceRuntime[T any] = core.ServiceRuntime[T]
|
|
Runtime = core.Runtime
|
|
ServiceFactory = core.ServiceFactory
|
|
)
|
|
|
|
// Re-export core functions
|
|
var (
|
|
New = core.New
|
|
WithService = core.WithService
|
|
WithName = core.WithName
|
|
WithApp = core.WithApp
|
|
WithAssets = core.WithAssets
|
|
WithServiceLock = core.WithServiceLock
|
|
App = core.App
|
|
E = core.E
|
|
NewRuntime = core.NewRuntime
|
|
NewWithFactories = core.NewWithFactories
|
|
)
|
|
|
|
// NewServiceRuntime creates a new ServiceRuntime for a service.
|
|
func NewServiceRuntime[T any](c *Core, opts T) *ServiceRuntime[T] {
|
|
return core.NewServiceRuntime(c, opts)
|
|
}
|
|
|
|
// Re-export generic functions
|
|
func ServiceFor[T any](c *Core, name string) (T, error) {
|
|
return core.ServiceFor[T](c, name)
|
|
}
|
|
|
|
func MustServiceFor[T any](c *Core, name string) T {
|
|
return core.MustServiceFor[T](c, name)
|
|
}
|
|
|
|
// Action types
|
|
type (
|
|
ActionServiceStartup = core.ActionServiceStartup
|
|
ActionServiceShutdown = core.ActionServiceShutdown
|
|
)
|