Virgil split go-ai into standalone modules (go-agentic, go-ml, go-mlx, go-rag). This migrates all CLI imports to the new module paths and fixes API mismatches from the split. Key changes: - go-ai/agentic → go-agentic (cmd/ai, cmd/dev) - go-ai/ml → go-ml (31 files in cmd/ml) - go-ai/rag → go-rag (3 files in cmd/rag) - go-ai/mlx → go-mlx (1 file) - Fix go.work path (../core → ../go) - Add all split repos to go.work and go.mod - Simplify daemon to goroutine-based MCP (remove missing supervisor) - Wire go-agentic SQLiteRegistry into dispatch watch (--agent-id flag) - Add `core ai agent fleet` command for local registry status - Fix rag collections API (PointCount, Status string) - Fix ml live/expand-status to use available go-ml API Co-Authored-By: Charon <charon@lethean.io>
86 lines
2.3 KiB
Go
86 lines
2.3 KiB
Go
package dev
|
|
|
|
import (
|
|
"context"
|
|
|
|
"forge.lthn.ai/core/go-agentic"
|
|
"forge.lthn.ai/core/go/pkg/framework"
|
|
"forge.lthn.ai/core/go-scm/git"
|
|
)
|
|
|
|
// WorkBundle contains the Core instance for dev work operations.
|
|
type WorkBundle struct {
|
|
Core *framework.Core
|
|
}
|
|
|
|
// WorkBundleOptions configures the work bundle.
|
|
type WorkBundleOptions struct {
|
|
RegistryPath string
|
|
AllowEdit bool // Allow agentic to use Write/Edit tools
|
|
}
|
|
|
|
// NewWorkBundle creates a bundle for dev work operations.
|
|
// Includes: dev (orchestration), git, agentic services.
|
|
func NewWorkBundle(opts WorkBundleOptions) (*WorkBundle, error) {
|
|
c, err := framework.New(
|
|
framework.WithService(NewService(ServiceOptions{
|
|
RegistryPath: opts.RegistryPath,
|
|
})),
|
|
framework.WithService(git.NewService(git.ServiceOptions{})),
|
|
framework.WithService(agentic.NewService(agentic.ServiceOptions{
|
|
AllowEdit: opts.AllowEdit,
|
|
})),
|
|
framework.WithServiceLock(),
|
|
)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &WorkBundle{Core: c}, nil
|
|
}
|
|
|
|
// Start initialises the bundle services.
|
|
func (b *WorkBundle) Start(ctx context.Context) error {
|
|
return b.Core.ServiceStartup(ctx, nil)
|
|
}
|
|
|
|
// Stop shuts down the bundle services.
|
|
func (b *WorkBundle) Stop(ctx context.Context) error {
|
|
return b.Core.ServiceShutdown(ctx)
|
|
}
|
|
|
|
// StatusBundle contains the Core instance for status-only operations.
|
|
type StatusBundle struct {
|
|
Core *framework.Core
|
|
}
|
|
|
|
// StatusBundleOptions configures the status bundle.
|
|
type StatusBundleOptions struct {
|
|
RegistryPath string
|
|
}
|
|
|
|
// NewStatusBundle creates a bundle for status-only operations.
|
|
// Includes: dev (orchestration), git services. No agentic - commits not available.
|
|
func NewStatusBundle(opts StatusBundleOptions) (*StatusBundle, error) {
|
|
c, err := framework.New(
|
|
framework.WithService(NewService(ServiceOptions(opts))),
|
|
framework.WithService(git.NewService(git.ServiceOptions{})),
|
|
// No agentic service - TaskCommit will be unhandled
|
|
framework.WithServiceLock(),
|
|
)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &StatusBundle{Core: c}, nil
|
|
}
|
|
|
|
// Start initialises the bundle services.
|
|
func (b *StatusBundle) Start(ctx context.Context) error {
|
|
return b.Core.ServiceStartup(ctx, nil)
|
|
}
|
|
|
|
// Stop shuts down the bundle services.
|
|
func (b *StatusBundle) Stop(ctx context.Context) error {
|
|
return b.Core.ServiceShutdown(ctx)
|
|
}
|