diff --git a/dbus.go b/dbus.go index 3069d80..8f9f2f6 100644 --- a/dbus.go +++ b/dbus.go @@ -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" ) diff --git a/elevate_notify.go b/elevate_notify.go index 223bcdd..24745d6 100644 --- a/elevate_notify.go +++ b/elevate_notify.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/godbus/dbus/v5" - "ollie/pkg/elevate" + "ollie/elevate" ) // elevateNotifier handles desktop notifications for elevation requests diff --git a/main.go b/main.go index 0f24293..ce3a0bb 100644 --- a/main.go +++ b/main.go @@ -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) { diff --git a/main_test.go b/main_test.go index bf38a1c..b8f56aa 100644 --- a/main_test.go +++ b/main_test.go @@ -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" ) diff --git a/server/elevate_tree.go b/server/elevate_tree.go index bdcd973..1712589 100644 --- a/server/elevate_tree.go +++ b/server/elevate_tree.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "ollie/pkg/elevate" + "ollie/elevate" fs "olliesrv/fs" ) diff --git a/server/server.go b/server/server.go index 032f3ff..799ec42 100644 --- a/server/server.go +++ b/server/server.go @@ -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. diff --git a/session/session.go b/session/session.go index edc0ed9..457ccfb 100644 --- a/session/session.go +++ b/session/session.go @@ -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 } diff --git a/session/sessionfile.go b/session/sessionfile.go index 40f5c28..9cbe7a5 100644 --- a/session/sessionfile.go +++ b/session/sessionfile.go @@ -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 {