|
4 | 4 | "fmt" |
5 | 5 |
|
6 | 6 | "github.com/spf13/cobra" |
| 7 | + "maestro/internal/common" |
| 8 | + "maestro/internal/commands" |
7 | 9 | ) |
8 | 10 |
|
9 | 11 | // VDB Commands |
@@ -385,6 +387,85 @@ var metaAgentCmd = &cobra.Command{ |
385 | 387 | Example: ` maestro metaagent run TEXT_FILE.`, |
386 | 388 | } |
387 | 389 |
|
| 390 | +// Deprecated Create commands - agent/MCPtool |
| 391 | +var deprecatedCreateCmd = &cobra.Command{ |
| 392 | + Use: "create", |
| 393 | + Short: "*** Deprecated *** Create", |
| 394 | + Long: `*** Deprecated *** Create: Use agent or tool create.`, |
| 395 | + Aliases: []string{"create"}, |
| 396 | + Args: cobra.ExactArgs(1), |
| 397 | + Example: ` maestro agent/tool create yaml_file.`, |
| 398 | + RunE: func(cmd *cobra.Command, args []string) error { |
| 399 | + fmt.Println("***Deprecated Create: Use agent or tool create.***") |
| 400 | + defs, _ := common.ParseYAML(args[0]) |
| 401 | + fmt.Println(defs[0]["kind"]) |
| 402 | + if defs[0]["kind"] == "Agent" || defs[0]["kind"] == "MCPTool"{ |
| 403 | + options := commands.NewCommandOptions(cmd) |
| 404 | + return commands.DeprecatedCreateCommand(args[0], options) |
| 405 | + } |
| 406 | + return nil |
| 407 | + }, |
| 408 | +} |
| 409 | + |
| 410 | +// Deprecated CreateCr commands - agent/MCPtool |
| 411 | +var deprecatedCreateCrCmd = &cobra.Command{ |
| 412 | + Use: "create-cr", |
| 413 | + Short: "*** Deprecated *** Create-cr", |
| 414 | + Long: `*** Deprecated *** Create-cr: Use curomresource create yaml_file.`, |
| 415 | + Aliases: []string{"create"}, |
| 416 | + Args: cobra.ExactArgs(1), |
| 417 | + Example: ` maestro agent/tool create-cr yaml_file.`, |
| 418 | + RunE: func(cmd *cobra.Command, args []string) error { |
| 419 | + fmt.Println("***Deprecated Create: Use agent or tool create.***") |
| 420 | + options := commands.NewCommandOptions(cmd) |
| 421 | + return commands.DeprecatedCreateCrCommand(args[0], options) |
| 422 | + }, |
| 423 | +} |
| 424 | + |
| 425 | +// Deprecated Run commands - workflow |
| 426 | +var deprecatedRunCmd = &cobra.Command{ |
| 427 | + Use: "run", |
| 428 | + Short: "*** Deprecated *** Run", |
| 429 | + Long: `Deprecated Run: Use workflow run.`, |
| 430 | + Aliases: []string{"run"}, |
| 431 | + Example: ` maestro workflow run agentyaml_file workflowyaml_file.`, |
| 432 | + RunE: func(cmd *cobra.Command, args []string) error { |
| 433 | + fmt.Println("***Deprecated Run: Use workflow run.***") |
| 434 | + options := commands.NewCommandOptions(cmd) |
| 435 | + return commands.DeprecatedRunCommand(args, options) |
| 436 | + }, |
| 437 | +} |
| 438 | + |
| 439 | +// Deprecated Deploy commands - workflow |
| 440 | +var deprecatedDeployCmd = &cobra.Command{ |
| 441 | + Use: "deploy", |
| 442 | + Short: "*** Deprecated *** Deploy", |
| 443 | + Long: `*** Deprecated *** Deploy: Use workflow deploy.`, |
| 444 | + Aliases: []string{"deploy"}, |
| 445 | + Args: cobra.MinimumNArgs(2), |
| 446 | + Example: ` maestro deploy agentyaml_file workflowyaml_file.`, |
| 447 | + RunE: func(cmd *cobra.Command, args []string) error { |
| 448 | + fmt.Println("***Deprecated Deploy: Use workflow deploy.***") |
| 449 | + options := commands.NewCommandOptions(cmd) |
| 450 | + return commands.DeprecatedDeployCommand(args, options, cmd) |
| 451 | + }, |
| 452 | +} |
| 453 | + |
| 454 | +// Deprecated Deploy commands - workflow |
| 455 | +var deprecatedServeCmd = &cobra.Command{ |
| 456 | + Use: "serve", |
| 457 | + Short: "*** Deprecated *** Serve", |
| 458 | + Long: `*** Deprecated *** : Use workflow/agent serve.`, |
| 459 | + Aliases: []string{"serve"}, |
| 460 | + Args: cobra.ExactArgs(1), |
| 461 | + Example: ` maestro serve agentyaml_file.`, |
| 462 | + RunE: func(cmd *cobra.Command, args []string) error { |
| 463 | + fmt.Println("***Deprecated Serve: Use workflow serve.***") |
| 464 | + options := commands.NewCommandOptions(cmd) |
| 465 | + return commands.DeprecatedServeCommand(args, options, cmd) |
| 466 | + }, |
| 467 | +} |
| 468 | + |
388 | 469 | func init() { |
389 | 470 | // Add flags to collection commands |
390 | 471 | collectionListCmd.Flags().String("vdb", "", "Vector database name") |
|
0 commit comments