Rework module system. Now modules/commands are defined in a single file each, with both the function executed by teh agent and the definition for server-side argument parsing.

This commit is contained in:
Jakob Friedl
2025-07-25 16:41:29 +02:00
parent ad31b90687
commit 7bf135750c
25 changed files with 549 additions and 489 deletions

View File

@@ -94,21 +94,6 @@ type
length*: uint32 # [4 bytes ] result length
data*: seq[byte] # variable length result
# Structure for command module definitions
Argument* = object
name*: string
description*: string
argumentType*: ArgType
isRequired*: bool
Command* = object
name*: string
commandType*: CommandType
description*: string
example*: string
arguments*: seq[Argument]
dispatchMessage*: string
# Checkin binary structure
type
Heartbeat* = object
@@ -189,4 +174,21 @@ type
port*: int
sleep*: int
sessionKey*: Key
agentPublicKey*: Key
agentPublicKey*: Key
# Structure for command module definitions
type
Argument* = object
name*: string
description*: string
argumentType*: ArgType
isRequired*: bool
Command* = object
name*: string
commandType*: CommandType
description*: string
example*: string
arguments*: seq[Argument]
dispatchMessage*: string
execute*: proc(config: AgentConfig, task: Task): TaskResult {.nimcall.}