diff --git a/cmd/workspace/cmd_agent.go b/cmd/workspace/cmd_agent.go index b1589d0..f53e134 100644 --- a/cmd/workspace/cmd_agent.go +++ b/cmd/workspace/cmd_agent.go @@ -31,7 +31,6 @@ import ( "forge.lthn.ai/core/cli/pkg/cli" coreio "forge.lthn.ai/core/go-io" - "github.com/spf13/cobra" ) var ( @@ -39,19 +38,19 @@ var ( agentName string ) -func addAgentCommands(parent *cobra.Command) { - agentCmd := &cobra.Command{ +func addAgentCommands(parent *cli.Command) { + agentCmd := &cli.Command{ Use: "agent", Short: "Manage persistent agent context within task workspaces", } - initCmd := &cobra.Command{ + initCmd := &cli.Command{ Use: "init ", Short: "Initialize an agent's context directory in the task workspace", Long: `Creates agents/{provider}/{agent-name}/ with memory.md and artifacts/ directory. The agent can read/write memory.md across invocations to build understanding over time.`, - Args: cobra.ExactArgs(1), + Args: cli.ExactArgs(1), RunE: runAgentInit, } initCmd.Flags().IntVar(&taskEpic, "epic", 0, "Epic/project number") @@ -59,7 +58,7 @@ build understanding over time.`, _ = initCmd.MarkFlagRequired("epic") _ = initCmd.MarkFlagRequired("issue") - agentListCmd := &cobra.Command{ + agentListCmd := &cli.Command{ Use: "list", Short: "List agents in a task workspace", RunE: runAgentList, @@ -69,10 +68,10 @@ build understanding over time.`, _ = agentListCmd.MarkFlagRequired("epic") _ = agentListCmd.MarkFlagRequired("issue") - pathCmd := &cobra.Command{ + pathCmd := &cli.Command{ Use: "path ", Short: "Print the agent's context directory path", - Args: cobra.ExactArgs(1), + Args: cli.ExactArgs(1), RunE: runAgentPath, } pathCmd.Flags().IntVar(&taskEpic, "epic", 0, "Epic/project number") @@ -106,7 +105,7 @@ type AgentManifest struct { LastSeen time.Time `json:"last_seen"` } -func runAgentInit(cmd *cobra.Command, args []string) error { +func runAgentInit(cmd *cli.Command, args []string) error { provider, name, err := parseAgentID(args[0]) if err != nil { return err @@ -169,7 +168,7 @@ func runAgentInit(cmd *cobra.Command, args []string) error { return nil } -func runAgentList(cmd *cobra.Command, args []string) error { +func runAgentList(cmd *cli.Command, args []string) error { root, err := FindWorkspaceRoot() if err != nil { return cli.Err("not in a workspace") @@ -241,7 +240,7 @@ func runAgentList(cmd *cobra.Command, args []string) error { return nil } -func runAgentPath(cmd *cobra.Command, args []string) error { +func runAgentPath(cmd *cli.Command, args []string) error { provider, name, err := parseAgentID(args[0]) if err != nil { return err diff --git a/cmd/workspace/cmd_task.go b/cmd/workspace/cmd_task.go index bf8482c..6cabece 100644 --- a/cmd/workspace/cmd_task.go +++ b/cmd/workspace/cmd_task.go @@ -20,7 +20,6 @@ import ( "forge.lthn.ai/core/cli/pkg/cli" coreio "forge.lthn.ai/core/go-io" "forge.lthn.ai/core/go-scm/repos" - "github.com/spf13/cobra" ) var ( @@ -31,13 +30,13 @@ var ( taskBranch string ) -func addTaskCommands(parent *cobra.Command) { - taskCmd := &cobra.Command{ +func addTaskCommands(parent *cli.Command) { + taskCmd := &cli.Command{ Use: "task", Short: "Manage isolated task workspaces for agents", } - createCmd := &cobra.Command{ + createCmd := &cli.Command{ Use: "create", Short: "Create an isolated task workspace with git worktrees", Long: `Creates a workspace at .core/workspace/p{epic}/i{issue}/ with git @@ -52,7 +51,7 @@ worktrees for each specified repo. Each worktree gets a fresh branch _ = createCmd.MarkFlagRequired("epic") _ = createCmd.MarkFlagRequired("issue") - removeCmd := &cobra.Command{ + removeCmd := &cli.Command{ Use: "remove", Short: "Remove a task workspace (with safety checks)", Long: `Removes a task workspace after checking for uncommitted changes and @@ -65,13 +64,13 @@ unpushed branches. Use --force to skip safety checks.`, _ = removeCmd.MarkFlagRequired("epic") _ = removeCmd.MarkFlagRequired("issue") - listCmd := &cobra.Command{ + listCmd := &cli.Command{ Use: "list", Short: "List all task workspaces", RunE: runTaskList, } - statusCmd := &cobra.Command{ + statusCmd := &cli.Command{ Use: "status", Short: "Show status of a task workspace", RunE: runTaskStatus, @@ -92,7 +91,7 @@ func taskWorkspacePath(root string, epic, issue int) string { return filepath.Join(root, ".core", "workspace", fmt.Sprintf("p%d", epic), fmt.Sprintf("i%d", issue)) } -func runTaskCreate(cmd *cobra.Command, args []string) error { +func runTaskCreate(cmd *cli.Command, args []string) error { ctx := context.Background() root, err := FindWorkspaceRoot() if err != nil { @@ -172,7 +171,7 @@ func runTaskCreate(cmd *cobra.Command, args []string) error { return nil } -func runTaskRemove(cmd *cobra.Command, args []string) error { +func runTaskRemove(cmd *cli.Command, args []string) error { root, err := FindWorkspaceRoot() if err != nil { return cli.Err("not in a workspace") @@ -238,7 +237,7 @@ func runTaskRemove(cmd *cobra.Command, args []string) error { return nil } -func runTaskList(cmd *cobra.Command, args []string) error { +func runTaskList(cmd *cli.Command, args []string) error { root, err := FindWorkspaceRoot() if err != nil { return cli.Err("not in a workspace") @@ -301,7 +300,7 @@ func runTaskList(cmd *cobra.Command, args []string) error { return nil } -func runTaskStatus(cmd *cobra.Command, args []string) error { +func runTaskStatus(cmd *cli.Command, args []string) error { root, err := FindWorkspaceRoot() if err != nil { return cli.Err("not in a workspace") diff --git a/cmd/workspace/cmd_workspace.go b/cmd/workspace/cmd_workspace.go index aa95db9..bd5ea11 100644 --- a/cmd/workspace/cmd_workspace.go +++ b/cmd/workspace/cmd_workspace.go @@ -4,18 +4,17 @@ import ( "strings" "forge.lthn.ai/core/cli/pkg/cli" - "github.com/spf13/cobra" ) // AddWorkspaceCommands registers workspace management commands. -func AddWorkspaceCommands(root *cobra.Command) { - wsCmd := &cobra.Command{ +func AddWorkspaceCommands(root *cli.Command) { + wsCmd := &cli.Command{ Use: "workspace", Short: "Manage workspace configuration", RunE: runWorkspaceInfo, } - wsCmd.AddCommand(&cobra.Command{ + wsCmd.AddCommand(&cli.Command{ Use: "active [package]", Short: "Show or set the active package", RunE: runWorkspaceActive, @@ -26,7 +25,7 @@ func AddWorkspaceCommands(root *cobra.Command) { root.AddCommand(wsCmd) } -func runWorkspaceInfo(cmd *cobra.Command, args []string) error { +func runWorkspaceInfo(cmd *cli.Command, args []string) error { root, err := FindWorkspaceRoot() if err != nil { return cli.Err("not in a workspace") @@ -49,7 +48,7 @@ func runWorkspaceInfo(cmd *cobra.Command, args []string) error { return nil } -func runWorkspaceActive(cmd *cobra.Command, args []string) error { +func runWorkspaceActive(cmd *cli.Command, args []string) error { root, err := FindWorkspaceRoot() if err != nil { return cli.Err("not in a workspace") diff --git a/pkg/loop/tools_mcp.go b/pkg/loop/tools_mcp.go index 99c5414..16e1dfe 100644 --- a/pkg/loop/tools_mcp.go +++ b/pkg/loop/tools_mcp.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - aimcp "forge.lthn.ai/core/go-ai/mcp" + aimcp "forge.lthn.ai/core/mcp/pkg/mcp" ) // LoadMCPTools converts all tools from a go-ai MCP Service into loop.Tool values.