This commit is contained in:
2025-05-23 09:33:05 +04:00
parent a16ac8f627
commit 79d66e4b6b
34 changed files with 603 additions and 608 deletions

View File

@@ -4,7 +4,7 @@ import (
"log"
"sync"
"github.com/freeflowuniverse/heroagent/pkg/handlerfactory/herohandler"
"github.com/freeflowuniverse/heroagent/pkg/heroscript/handlerfactory/herohandler"
)
func main() {

View File

@@ -2,8 +2,6 @@ package main
import (
"fmt"
"log"
"os"
"github.com/freeflowuniverse/heroagent/pkg/heroscript/playbook"
)
@@ -15,26 +13,26 @@ func main() {
pb := playbook.New()
// Start a simple process
startAction := pb.NewAction(1, "start", "process", 0, playbook.ActionTypeUnknown)
startAction := pb.NewAction("1", "start", "process", 0, playbook.ActionTypeUnknown)
startAction.Params.Set("name", "example_process")
startAction.Params.Set("command", "ping -c 60 localhost")
startAction.Params.Set("log", "true")
// List all processes
listAction := pb.NewAction(2, "list", "process", 0, playbook.ActionTypeUnknown)
listAction := pb.NewAction("2", "list", "process", 0, playbook.ActionTypeUnknown)
listAction.Params.Set("format", "table")
// Get status of a specific process
statusAction := pb.NewAction(3, "status", "process", 0, playbook.ActionTypeUnknown)
statusAction := pb.NewAction("3", "status", "process", 0, playbook.ActionTypeUnknown)
statusAction.Params.Set("name", "example_process")
// Get logs of a specific process
logsAction := pb.NewAction(4, "logs", "process", 0, playbook.ActionTypeUnknown)
logsAction := pb.NewAction("4", "logs", "process", 0, playbook.ActionTypeUnknown)
logsAction.Params.Set("name", "example_process")
logsAction.Params.Set("lines", "10")
// Stop a process
stopAction := pb.NewAction(5, "stop", "process", 0, playbook.ActionTypeUnknown)
stopAction := pb.NewAction("5", "stop", "process", 0, playbook.ActionTypeUnknown)
stopAction.Params.Set("name", "example_process")
// Generate the heroscript