update imports for core/ restructure

ollie/pkg/X → ollie/X, execute.Registry → tools.Registry,
remote.Dial → execute.RemoteDial, config.Load → agent.Load
This commit is contained in:
Levi Neely 2026-07-29 18:10:32 +02:00
parent acfc4854d4
commit c96982c1ec
8 changed files with 43 additions and 45 deletions

View File

@ -13,8 +13,8 @@ import (
"github.com/godbus/dbus/v5"
"github.com/godbus/dbus/v5/introspect"
"ollie/pkg/agent"
"ollie/pkg/backend"
"ollie/agent"
"ollie/backend"
"olliesrv/session"
)

View File

@ -5,7 +5,7 @@ import (
"sync"
"github.com/godbus/dbus/v5"
"ollie/pkg/elevate"
"ollie/elevate"
)
// elevateNotifier handles desktop notifications for elevation requests

22
main.go
View File

@ -14,14 +14,14 @@ import (
"syscall"
"9fans.net/go/plan9/client"
"ollie/pkg/agent"
"ollie/pkg/backend"
"ollie/pkg/elevate"
"ollie/pkg/env"
olog "ollie/pkg/log"
"ollie/pkg/paths"
"ollie/pkg/tools/execute"
"ollie/pkg/skills"
"ollie/agent"
"ollie/backend"
"ollie/elevate"
"ollie/env"
olog "ollie/log"
"ollie/paths"
"ollie/tools"
"ollie/skills"
fs "olliesrv/fs"
"olliesrv/mount"
"olliesrv/server"
@ -161,7 +161,7 @@ func runServer(sockPath string) {
sessionsDir := paths.DataDir() + "/sessions"
// Create the tool registry
toolRegistry, regErr := execute.NewRegistry()
toolRegistry, regErr := tools.NewRegistry()
if regErr != nil {
fmt.Fprintf(os.Stderr, "warning: tool registry: %v\n", regErr)
}
@ -274,7 +274,7 @@ func runServer(sockPath string) {
RootStore: NewRootStore(toolRegistry),
ElevateBroker: elevateBroker,
InvalidateModels: modelCache.Invalidate,
ToolPrompt: execute.ToolPrompt,
ToolPrompt: tools.ToolPrompt,
})
}
@ -352,7 +352,7 @@ func runServer(sockPath string) {
// ToolIndex generates a tool index from a tree's file listing.
// NewRootStore returns a read-only FileTree for synthetic root-level files.
func NewRootStore(reg *execute.Registry) *fs.Tree {
func NewRootStore(reg *tools.Registry) *fs.Tree {
helpPath := paths.CfgDir() + "/help.md"
readEntries := map[string]func() ([]byte, error){
"backends": func() ([]byte, error) {

View File

@ -11,9 +11,9 @@ import (
"time"
"github.com/simonfxr/pubsub"
"ollie/pkg/agent"
"ollie/pkg/backend"
olog "ollie/pkg/log"
"ollie/agent"
"ollie/backend"
olog "ollie/log"
"olliesrv/fs"
"olliesrv/session"
)

View File

@ -6,7 +6,7 @@ import (
"os"
"strings"
"ollie/pkg/elevate"
"ollie/elevate"
fs "olliesrv/fs"
)

View File

@ -15,11 +15,11 @@ import (
"sync"
"time"
"ollie/pkg/backend"
"ollie/pkg/tools/execute"
"ollie/pkg/elevate"
olog "ollie/pkg/log"
"ollie/pkg/paths"
"ollie/backend"
"ollie/tools"
"ollie/elevate"
olog "ollie/log"
"ollie/paths"
"olliesrv/fs"
"olliesrv/session"
@ -74,7 +74,7 @@ type Server struct {
groups map[string]map[string]bool // group → set of members
invalidateModels func()
toolPrompt func(string) string
toolRegistry *execute.Registry
toolRegistry *tools.Registry
}
// Config holds the pre-built trees and manager for the server.
@ -86,7 +86,7 @@ type Config struct {
InvalidateModels func()
ToolPrompt func(string) string
// ToolRegistry is the shared tool registry for lazy tool promotion.
ToolRegistry *execute.Registry
ToolRegistry *tools.Registry
}
// Option configures the 9P server.

View File

@ -13,15 +13,13 @@ import (
"sync/atomic"
"time"
"ollie/pkg/agent"
"ollie/pkg/backend"
"ollie/pkg/config"
olog "ollie/pkg/log"
"ollie/pkg/paths"
"ollie/pkg/remote"
"ollie/pkg/tools"
"ollie/pkg/tools/execute"
"ollie/pkg/skills"
"ollie/agent"
"ollie/backend"
olog "ollie/log"
"ollie/paths"
"ollie/execute"
"ollie/tools"
"ollie/skills"
"olliesrv/fs"
"olliesrv/prompts"
)
@ -254,7 +252,7 @@ type ManagerConfig struct {
// ResetElevation resets the per-turn elevation rate limiter for a session.
ResetElevation func(sessionID string)
// ToolRegistry is the shared tool registry for lazy tool promotion.
ToolRegistry *execute.Registry
ToolRegistry *tools.Registry
// SkillsRegistry is the shared skills registry for skill loading.
SkillsRegistry *skills.Registry
// OnSessionCreated is called after a new session is added to the manager.
@ -855,7 +853,7 @@ func (s *Manager) restoreSession(ps *agent.PersistedSession) error {
remoteTarget := ps.Remote
if remoteTarget != "" {
rsrv, dialErr := remote.Dial(context.Background(), remote.Config{
rsrv, dialErr := execute.RemoteDial(context.Background(), execute.RemoteConfig{
SSHTarget: remoteTarget,
CWD: cwd,
})
@ -1186,7 +1184,7 @@ func (s *Manager) CreateSession(args []string) (string, error) {
// FIXME: Eager dial means session creation blocks on SSH connect.
// Eventually make this async or move host info into the prompt
// scripts themselves (running remotely via the RPC).
rsrv, dialErr := remote.Dial(context.Background(), remote.Config{
rsrv, dialErr := execute.RemoteDial(context.Background(), execute.RemoteConfig{
SSHTarget: remoteTarget,
CWD: cwd,
})
@ -1345,7 +1343,7 @@ func (s *Manager) renameSession(old, new string) error {
// LoadAgentConfig resolves and loads the config for a named agent.
// Returns nil if the config file does not exist; BuildRuntime handles nil configs.
func LoadAgentConfig(agentsDir, name string, open func(string) (*os.File, error)) *config.Config {
func LoadAgentConfig(agentsDir, name string, open func(string) (*os.File, error)) *agent.Config {
if open == nil {
open = os.Open
}
@ -1355,7 +1353,7 @@ func LoadAgentConfig(agentsDir, name string, open func(string) (*os.File, error)
return nil
}
defer f.Close()
cfg, _ := config.Load(f)
cfg, _ := agent.Load(f)
return cfg
}

View File

@ -8,10 +8,10 @@ import (
"strconv"
"strings"
"ollie/pkg/agent"
"ollie/pkg/backend"
"ollie/pkg/tools/execute"
olog "ollie/pkg/log"
"ollie/agent"
"ollie/backend"
"ollie/tools"
olog "ollie/log"
"olliesrv/fs"
)
@ -53,7 +53,7 @@ func sessionFilePerms() map[string]os.FileMode {
return fs.Perms[fs.PathSessionFile].Files
}
func NewSessionTree(sess *Session, log *olog.Logger, kill func(), rename func(newID string) error, saveTranscript func([]byte) error, invalidateModels func(), resetElevation func(), toolRegistry *execute.Registry) *fs.Tree {
func NewSessionTree(sess *Session, log *olog.Logger, kill func(), rename func(newID string) error, saveTranscript func([]byte) error, invalidateModels func(), resetElevation func(), toolRegistry *tools.Registry) *fs.Tree {
h := &sessionHelper{sess: sess, log: log, kill: kill, rename: rename, saveTranscript: saveTranscript, invalidateModels: invalidateModels, resetElevation: resetElevation, toolRegistry: toolRegistry}
perms := sessionFilePerms()
specs := make([]fs.FileSpec, len(FileList))
@ -74,7 +74,7 @@ type sessionHelper struct {
saveTranscript func([]byte) error
invalidateModels func()
resetElevation func() // called on prompt write to reset turn counter
toolRegistry *execute.Registry
toolRegistry *tools.Registry
}
func (h *sessionHelper) fileSpec(name string, mode os.FileMode) fs.FileSpec {