Implemented basic shell command execution and result retrieval. Next Step: Remove completed tasks from queue
This commit is contained in:
26
agents/monarch/task.nim
Normal file
26
agents/monarch/task.nim
Normal file
@@ -0,0 +1,26 @@
|
||||
import ./types
|
||||
import ./commands/commands
|
||||
|
||||
proc handleTask*(task: Task): Task =
|
||||
|
||||
# Handle task command
|
||||
case task.command:
|
||||
of ExecuteShell:
|
||||
|
||||
let cmdResult = executeShellCommand(task.args)
|
||||
echo cmdResult
|
||||
|
||||
return Task(
|
||||
id: task.id,
|
||||
agent: task.agent,
|
||||
command: task.command,
|
||||
args: task.args,
|
||||
result: cmdResult,
|
||||
status: Completed
|
||||
)
|
||||
|
||||
else:
|
||||
echo "Not implemented"
|
||||
return nil
|
||||
|
||||
return task
|
||||
Reference in New Issue
Block a user