opfor

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

OPFOR logo

OPFOR is an independent, pure-Go runtime for the Sleep language and Aggressor Script (.cna). The same engine is available as an embeddable Go package and as the offline opfor CLI, so applications can host scripts and operators can evaluate, validate, and run them without a JVM.

OPFOR implements parsing, compilation, execution, portable Sleep built-ins, script lifecycle, events, hooks, and callbacks. Embedding applications supply host-specific data and effects through explicit Aggressor Script extension and provider APIs.

Embed OPFOR

Create a runtime and evaluate a source string:

package main

import (
	"context"
	"log"

	"github.com/sliverarmory/opfor"
)

func main() {
	ctx := context.Background()
	runtime, err := opfor.New()
	if err != nil {
		log.Fatal(err)
	}
	defer runtime.Close(ctx)

	if _, err := runtime.Eval(ctx, "hello.sl", `println("hello from OPFOR");`); err != nil {
		log.Fatal(err)
	}
}

This prints hello from OPFOR. Eval compiles and runs source in one call; use CompileString and Runtime.Execute when a program will be reused. println writes to standard output by default. Use WithStdin, WithStdout, and WithStderr to replace the process streams.

See the Aggressor Script extension and provider API reference to connect application-owned state, actions, UI, callbacks, catalogs, and custom functions.

Call between Sleep and Go

WithFunction exposes a Go function to Sleep. Keep the loaded Script to call a Sleep sub from Go with Script.Call:

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/sliverarmory/opfor"
)

func main() {
	ctx := context.Background()
	runtime, err := opfor.New(
		opfor.WithFunction("hello_from_go", func(_ context.Context, call opfor.Invocation) (opfor.Value, error) {
			name := call.Arg(0).String()
			return opfor.String("hello " + name + " from Go"), nil
		}),
	)
	if err != nil {
		log.Fatal(err)
	}
	defer runtime.Close(ctx)

	program, err := runtime.CompileString("bridge.sl", `
sub hello_from_sleep {
    return "hello " . $1 . " from Sleep";
}

println(hello_from_go("Sleep"));
`)
	if err != nil {
		log.Fatal(err)
	}

	script, err := runtime.Load(ctx, program)
	if err != nil {
		log.Fatal(err)
	}

	reply, err := script.Call(ctx, "hello_from_sleep", opfor.String("Go"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(reply.String())
}

Loading the script calls hello_from_go and prints hello Sleep from Go. The later Script.Call prints hello Go from Sleep. Runtime.Close unloads the retained script and its functions.

CLI

Install the opfor interpreter with Go 1.24 or later:

go install github.com/sliverarmory/opfor/cmd/opfor@latest

From a source checkout, install that checkout with:

go install ./cmd/opfor

Or build it in the repository root:

make

Then evaluate an expression, validate a script, or run it:

./opfor eval '2 + 2'
./opfor check examples/01-hello.sl
./opfor run examples/01-hello.sl operator
./opfor repl

The REPL displays a colored opfor > prompt and red evaluation errors in a terminal. Redirected input and output remain prompt-free for line-oriented pipelines.

See examples/ for runnable scripts that use only stock Sleep syntax and built-ins.

Running ./opfor without arguments prints the complete command help. The CLI is an offline interpreter; it does not connect or authenticate to an external Aggressor Script host.

Scope

OPFOR implements Sleep and Aggressor Script, not Java. A small pure-Go compatibility shim covers the Java-shaped string, collection, file, random, and UUID behavior needed by supported scripts. Other object behavior can be provided by the embedding application.

Java serialization is optional compatibility support for scripts that explicitly use it; it is not required for normal embedding, execution, or callbacks.

See the detailed compatibility and embedding reference for the provider catalog, lifecycle contracts, limits, conformance kit, and current compatibility coverage.

License

Apache License 2.0. See LICENSE.

Documentation

Overview

Package opfor implements an embeddable, pure-Go Sleep and Aggressor Script runtime.

Compile turns a named source unit into an immutable Program. Runtime executes programs, retains loaded declarations, dispatches events and other bindings, and exposes explicit Host and ObjectHost boundaries for behavior supplied by an embedding application. Standard output, standard error, and standard input default to their process streams and can be replaced with options to New. Arguments passed to Load, Execute, and Eval populate Sleep's @ARGV; they are not top-level @_ or positional subroutine arguments.

Host handles unresolved application functions and ObjectHost handles Java-style object syntax. Opaque values implementing Iterator or MutableIterator participate in Sleep iterator consumers and foreach removal. Importer-defined ordinary, filter, and predicate environment keywords are registered with WithEnvironment and compiled through Runtime.Compile; Binding exposes the corresponding selector, filter, predicate, and nested popup/menu composition metadata. Known Cobalt-owned function families use typed provider interfaces carrying resolved Values, guarded callbacks, and runtime/script/source provenance; WithFunction provides exact overrides and Host remains the generic fallback. These ordinary in-process boundaries do not require serialization. These extension points are not a security sandbox: portable Sleep filesystem and process functions perform local effects unless an importer overrides them or constrains the process externally.

OPFOR is an independent compatibility implementation. It does not include a Cobalt Strike client or Team Server implementation.

Example
package main

import (
	"bytes"
	"context"
	"fmt"

	"github.com/sliverarmory/opfor"
)

func main() {
	program, err := opfor.CompileString("hello.cna", `
sub greeting {
    return "hello " . $1;
}
println(greeting(@ARGV[0]));
`)
	if err != nil {
		panic(err)
	}

	var output bytes.Buffer
	runtime, err := opfor.New(opfor.WithStdout(&output))
	if err != nil {
		panic(err)
	}
	if _, err := runtime.Execute(context.Background(), program, opfor.String("operator")); err != nil {
		panic(err)
	}
	fmt.Print(output.String())
}
Output:
hello operator

Index

Examples

Constants

View Source
const (
	// AggressorArtifactPayload identifies artifact_payload.
	AggressorArtifactPayload = opforimpl.AggressorArtifactPayload
	// AggressorArtifactStageless identifies the deprecated
	// callback-based artifact_stageless function.
	AggressorArtifactStageless = opforimpl.AggressorArtifactStageless
	// AggressorBOFDefaultEntryPoint is the documented entry point used by
	// bof_extract when its optional second argument is omitted.
	AggressorBOFDefaultEntryPoint = opforimpl.AggressorBOFDefaultEntryPoint
	// AggressorBeaconActionArgumentSpoofAdd identifies bargue_add.
	AggressorBeaconActionArgumentSpoofAdd = opforimpl.AggressorBeaconActionArgumentSpoofAdd
	// AggressorBeaconActionArgumentSpoofList identifies bargue_list.
	AggressorBeaconActionArgumentSpoofList = opforimpl.AggressorBeaconActionArgumentSpoofList
	// AggressorBeaconActionArgumentSpoofRemove identifies bargue_remove.
	AggressorBeaconActionArgumentSpoofRemove = opforimpl.AggressorBeaconActionArgumentSpoofRemove
	// AggressorBeaconActionBlockDLLs identifies bblockdlls.
	AggressorBeaconActionBlockDLLs = opforimpl.AggressorBeaconActionBlockDLLs
	// AggressorBeaconActionBrowserPivot identifies bbrowserpivot.
	AggressorBeaconActionBrowserPivot = opforimpl.AggressorBeaconActionBrowserPivot
	// AggressorBeaconActionBrowserPivotStop identifies bbrowserpivot_stop.
	AggressorBeaconActionBrowserPivotStop = opforimpl.AggressorBeaconActionBrowserPivotStop
	// AggressorBeaconActionCancelDownload identifies bcancel.
	AggressorBeaconActionCancelDownload = opforimpl.AggressorBeaconActionCancelDownload
	// AggressorBeaconActionChangeDirectory identifies bcd.
	AggressorBeaconActionChangeDirectory = opforimpl.AggressorBeaconActionChangeDirectory
	// AggressorBeaconActionCheckin identifies bcheckin.
	AggressorBeaconActionCheckin = opforimpl.AggressorBeaconActionCheckin
	// AggressorBeaconActionClearTasks identifies bclear.
	AggressorBeaconActionClearTasks = opforimpl.AggressorBeaconActionClearTasks
	// AggressorBeaconActionClipboard identifies bclipboard.
	AggressorBeaconActionClipboard = opforimpl.AggressorBeaconActionClipboard
	// AggressorBeaconActionConfigure identifies bbeacon_config.
	AggressorBeaconActionConfigure = opforimpl.AggressorBeaconActionConfigure
	// AggressorBeaconActionConnect identifies bconnect.
	AggressorBeaconActionConnect = opforimpl.AggressorBeaconActionConnect
	// AggressorBeaconActionConsoleWatermark identifies beacon_console_watermark.
	AggressorBeaconActionConsoleWatermark = opforimpl.AggressorBeaconActionConsoleWatermark
	// AggressorBeaconActionConsoleWatermarkReset identifies beacon_console_watermark_reset.
	AggressorBeaconActionConsoleWatermarkReset = opforimpl.AggressorBeaconActionConsoleWatermarkReset
	// AggressorBeaconActionCopy identifies bcp(idOrArray, source, destination).
	AggressorBeaconActionCopy = opforimpl.AggressorBeaconActionCopy
	// AggressorBeaconActionCovertVPN identifies bcovertvpn.
	AggressorBeaconActionCovertVPN = opforimpl.AggressorBeaconActionCovertVPN
	// AggressorBeaconActionDCSync identifies bdcsync.
	AggressorBeaconActionDCSync = opforimpl.AggressorBeaconActionDCSync
	// AggressorBeaconActionDLLInject identifies bdllinject.
	AggressorBeaconActionDLLInject = opforimpl.AggressorBeaconActionDLLInject
	// AggressorBeaconActionDLLLoad identifies bdllload.
	AggressorBeaconActionDLLLoad = opforimpl.AggressorBeaconActionDLLLoad
	// AggressorBeaconActionDLLSpawn identifies bdllspawn.
	AggressorBeaconActionDLLSpawn = opforimpl.AggressorBeaconActionDLLSpawn
	// AggressorBeaconActionDataStoreList identifies bdata_store_list.
	AggressorBeaconActionDataStoreList = opforimpl.AggressorBeaconActionDataStoreList
	// AggressorBeaconActionDataStoreLoad identifies bdata_store_load.
	AggressorBeaconActionDataStoreLoad = opforimpl.AggressorBeaconActionDataStoreLoad
	// AggressorBeaconActionDataStoreUnload identifies bdata_store_unload.
	AggressorBeaconActionDataStoreUnload = opforimpl.AggressorBeaconActionDataStoreUnload
	// AggressorBeaconActionDesktop identifies bdesktop.
	AggressorBeaconActionDesktop = opforimpl.AggressorBeaconActionDesktop
	// AggressorBeaconActionDownload identifies bdownload.
	AggressorBeaconActionDownload = opforimpl.AggressorBeaconActionDownload
	// AggressorBeaconActionEnablePrivileges identifies bgetprivs.
	AggressorBeaconActionEnablePrivileges = opforimpl.AggressorBeaconActionEnablePrivileges
	// AggressorBeaconActionExecute identifies bexecute.
	AggressorBeaconActionExecute = opforimpl.AggressorBeaconActionExecute
	// AggressorBeaconActionExecuteAssembly identifies bexecute_assembly.
	AggressorBeaconActionExecuteAssembly = opforimpl.AggressorBeaconActionExecuteAssembly
	// AggressorBeaconActionExit identifies bexit.
	AggressorBeaconActionExit = opforimpl.AggressorBeaconActionExit
	// AggressorBeaconActionGate identifies bbeacon_gate.
	AggressorBeaconActionGate = opforimpl.AggressorBeaconActionGate
	// AggressorBeaconActionGetSystem identifies bgetsystem.
	AggressorBeaconActionGetSystem = opforimpl.AggressorBeaconActionGetSystem
	// AggressorBeaconActionGetUID identifies bgetuid.
	AggressorBeaconActionGetUID = opforimpl.AggressorBeaconActionGetUID
	// AggressorBeaconActionHashdump identifies bhashdump.
	AggressorBeaconActionHashdump = opforimpl.AggressorBeaconActionHashdump
	// AggressorBeaconActionIPConfig identifies bipconfig.
	AggressorBeaconActionIPConfig = opforimpl.AggressorBeaconActionIPConfig
	// AggressorBeaconActionInject identifies binject.
	AggressorBeaconActionInject = opforimpl.AggressorBeaconActionInject
	// AggressorBeaconActionInlineExecute identifies binline_execute.
	AggressorBeaconActionInlineExecute = opforimpl.AggressorBeaconActionInlineExecute
	// AggressorBeaconActionInlineExecutePE identifies binline_execute_pe.
	AggressorBeaconActionInlineExecutePE = opforimpl.AggressorBeaconActionInlineExecutePE
	// AggressorBeaconActionInterpreter identifies bbeacon_interpreter.
	AggressorBeaconActionInterpreter = opforimpl.AggressorBeaconActionInterpreter
	// AggressorBeaconActionInterpreterLint identifies bbeacon_interpreter_lint.
	AggressorBeaconActionInterpreterLint = opforimpl.AggressorBeaconActionInterpreterLint
	// AggressorBeaconActionJobHideOutput identifies beacon_job_hide_output.
	AggressorBeaconActionJobHideOutput = opforimpl.AggressorBeaconActionJobHideOutput
	// AggressorBeaconActionJobKill identifies bjobkill.
	AggressorBeaconActionJobKill = opforimpl.AggressorBeaconActionJobKill
	// AggressorBeaconActionJobName identifies beacon_job_name.
	AggressorBeaconActionJobName = opforimpl.AggressorBeaconActionJobName
	// AggressorBeaconActionJobSendData identifies bjob_send_data.
	AggressorBeaconActionJobSendData = opforimpl.AggressorBeaconActionJobSendData
	// AggressorBeaconActionJobs identifies bjobs.
	AggressorBeaconActionJobs = opforimpl.AggressorBeaconActionJobs
	// AggressorBeaconActionKerberosCCacheUse identifies bkerberos_ccache_use.
	AggressorBeaconActionKerberosCCacheUse = opforimpl.AggressorBeaconActionKerberosCCacheUse
	// AggressorBeaconActionKerberosTicketPurge identifies bkerberos_ticket_purge.
	AggressorBeaconActionKerberosTicketPurge = opforimpl.AggressorBeaconActionKerberosTicketPurge
	// AggressorBeaconActionKerberosTicketUse identifies bkerberos_ticket_use.
	AggressorBeaconActionKerberosTicketUse = opforimpl.AggressorBeaconActionKerberosTicketUse
	// AggressorBeaconActionKeylogger identifies bkeylogger.
	AggressorBeaconActionKeylogger = opforimpl.AggressorBeaconActionKeylogger
	// AggressorBeaconActionKill identifies bkill.
	AggressorBeaconActionKill = opforimpl.AggressorBeaconActionKill
	// AggressorBeaconActionLink identifies blink.
	AggressorBeaconActionLink = opforimpl.AggressorBeaconActionLink
	// AggressorBeaconActionListDrives identifies bdrives(idOrArray).
	AggressorBeaconActionListDrives = opforimpl.AggressorBeaconActionListDrives
	// AggressorBeaconActionListFiles identifies bls.
	AggressorBeaconActionListFiles = opforimpl.AggressorBeaconActionListFiles
	// AggressorBeaconActionListProcesses identifies bps.
	AggressorBeaconActionListProcesses = opforimpl.AggressorBeaconActionListProcesses
	// AggressorBeaconActionLoginUser identifies bloginuser.
	AggressorBeaconActionLoginUser = opforimpl.AggressorBeaconActionLoginUser
	// AggressorBeaconActionLogonPasswords identifies blogonpasswords.
	AggressorBeaconActionLogonPasswords = opforimpl.AggressorBeaconActionLogonPasswords
	// AggressorBeaconActionMakeDirectory identifies bmkdir(idOrArray, folder).
	AggressorBeaconActionMakeDirectory = opforimpl.AggressorBeaconActionMakeDirectory
	// AggressorBeaconActionMimikatz identifies bmimikatz.
	AggressorBeaconActionMimikatz = opforimpl.AggressorBeaconActionMimikatz
	// AggressorBeaconActionMimikatzSmall identifies bmimikatz_small.
	AggressorBeaconActionMimikatzSmall = opforimpl.AggressorBeaconActionMimikatzSmall
	// AggressorBeaconActionMode identifies bmode.
	AggressorBeaconActionMode = opforimpl.AggressorBeaconActionMode
	// AggressorBeaconActionMove identifies bmv(idOrArray, source, destination).
	AggressorBeaconActionMove = opforimpl.AggressorBeaconActionMove
	// AggressorBeaconActionNet identifies bnet.
	AggressorBeaconActionNet = opforimpl.AggressorBeaconActionNet
	// AggressorBeaconActionNote identifies bnote.
	AggressorBeaconActionNote = opforimpl.AggressorBeaconActionNote
	// AggressorBeaconActionPSExec identifies bpsexec.
	AggressorBeaconActionPSExec = opforimpl.AggressorBeaconActionPSExec
	// AggressorBeaconActionPSExecCommand identifies bpsexec_command.
	AggressorBeaconActionPSExecCommand = opforimpl.AggressorBeaconActionPSExecCommand
	// AggressorBeaconActionParentPID identifies bppid.
	AggressorBeaconActionParentPID = opforimpl.AggressorBeaconActionParentPID
	// AggressorBeaconActionPassTheHash identifies bpassthehash.
	AggressorBeaconActionPassTheHash = opforimpl.AggressorBeaconActionPassTheHash
	// AggressorBeaconActionPause identifies bpause.
	AggressorBeaconActionPause = opforimpl.AggressorBeaconActionPause
	// AggressorBeaconActionPortscan identifies bportscan.
	AggressorBeaconActionPortscan = opforimpl.AggressorBeaconActionPortscan
	// AggressorBeaconActionPowerPick identifies bpowerpick.
	AggressorBeaconActionPowerPick = opforimpl.AggressorBeaconActionPowerPick
	// AggressorBeaconActionPowerShell identifies bpowershell.
	AggressorBeaconActionPowerShell = opforimpl.AggressorBeaconActionPowerShell
	// AggressorBeaconActionPowerShellImport identifies bpowershell_import.
	AggressorBeaconActionPowerShellImport = opforimpl.AggressorBeaconActionPowerShellImport
	// AggressorBeaconActionPowerShellImportClear identifies bpowershell_import_clear.
	AggressorBeaconActionPowerShellImportClear = opforimpl.AggressorBeaconActionPowerShellImportClear
	// AggressorBeaconActionPowerShellInject identifies bpsinject.
	AggressorBeaconActionPowerShellInject = opforimpl.AggressorBeaconActionPowerShellInject
	// AggressorBeaconActionPrintScreen identifies bprintscreen.
	AggressorBeaconActionPrintScreen = opforimpl.AggressorBeaconActionPrintScreen
	// AggressorBeaconActionPrintWorkingDirectory identifies bpwd.
	AggressorBeaconActionPrintWorkingDirectory = opforimpl.AggressorBeaconActionPrintWorkingDirectory
	// AggressorBeaconActionReadPipe identifies bread_pipe.
	AggressorBeaconActionReadPipe = opforimpl.AggressorBeaconActionReadPipe
	// AggressorBeaconActionRegistryQueryValue identifies breg_queryv.
	AggressorBeaconActionRegistryQueryValue = opforimpl.AggressorBeaconActionRegistryQueryValue
	// AggressorBeaconActionRemove identifies brm.
	AggressorBeaconActionRemove = opforimpl.AggressorBeaconActionRemove
	// AggressorBeaconActionRemoveFromDisplay identifies beacon_remove.
	AggressorBeaconActionRemoveFromDisplay = opforimpl.AggressorBeaconActionRemoveFromDisplay
	// AggressorBeaconActionReversePortForward identifies brportfwd.
	AggressorBeaconActionReversePortForward = opforimpl.AggressorBeaconActionReversePortForward
	// AggressorBeaconActionReversePortForwardLocal identifies brportfwd_local.
	AggressorBeaconActionReversePortForwardLocal = opforimpl.AggressorBeaconActionReversePortForwardLocal
	// AggressorBeaconActionReversePortForwardStop identifies brportfwd_stop.
	AggressorBeaconActionReversePortForwardStop = opforimpl.AggressorBeaconActionReversePortForwardStop
	// AggressorBeaconActionRevertToSelf identifies brev2self.
	AggressorBeaconActionRevertToSelf = opforimpl.AggressorBeaconActionRevertToSelf
	// AggressorBeaconActionRun identifies brun.
	AggressorBeaconActionRun = opforimpl.AggressorBeaconActionRun
	// AggressorBeaconActionRunAs identifies brunas.
	AggressorBeaconActionRunAs = opforimpl.AggressorBeaconActionRunAs
	// AggressorBeaconActionRunUnder identifies brunu.
	AggressorBeaconActionRunUnder = opforimpl.AggressorBeaconActionRunUnder
	// AggressorBeaconActionSOCKS identifies bsocks.
	AggressorBeaconActionSOCKS = opforimpl.AggressorBeaconActionSOCKS
	// AggressorBeaconActionSOCKSStop identifies bsocks_stop.
	AggressorBeaconActionSOCKSStop = opforimpl.AggressorBeaconActionSOCKSStop
	// AggressorBeaconActionSSH identifies bssh.
	AggressorBeaconActionSSH = opforimpl.AggressorBeaconActionSSH
	// AggressorBeaconActionSSHKey identifies bssh_key.
	AggressorBeaconActionSSHKey = opforimpl.AggressorBeaconActionSSHKey
	// AggressorBeaconActionScreenshot identifies bscreenshot.
	AggressorBeaconActionScreenshot = opforimpl.AggressorBeaconActionScreenshot
	// AggressorBeaconActionScreenwatch identifies bscreenwatch.
	AggressorBeaconActionScreenwatch = opforimpl.AggressorBeaconActionScreenwatch
	// AggressorBeaconActionSetEnvironment identifies bsetenv.
	AggressorBeaconActionSetEnvironment = opforimpl.AggressorBeaconActionSetEnvironment
	// AggressorBeaconActionShell identifies bshell.
	AggressorBeaconActionShell = opforimpl.AggressorBeaconActionShell
	// AggressorBeaconActionShellcodeInject identifies bshinject.
	AggressorBeaconActionShellcodeInject = opforimpl.AggressorBeaconActionShellcodeInject
	// AggressorBeaconActionShellcodeSpawn identifies bshspawn.
	AggressorBeaconActionShellcodeSpawn = opforimpl.AggressorBeaconActionShellcodeSpawn
	// AggressorBeaconActionSleep identifies bsleep.
	AggressorBeaconActionSleep = opforimpl.AggressorBeaconActionSleep
	// AggressorBeaconActionSleepUnified identifies bsleepu.
	AggressorBeaconActionSleepUnified = opforimpl.AggressorBeaconActionSleepUnified
	// AggressorBeaconActionSmartLink identifies beacon_link.
	AggressorBeaconActionSmartLink = opforimpl.AggressorBeaconActionSmartLink
	// AggressorBeaconActionSpawn identifies bspawn.
	AggressorBeaconActionSpawn = opforimpl.AggressorBeaconActionSpawn
	// AggressorBeaconActionSpawnAs identifies bspawnas.
	AggressorBeaconActionSpawnAs = opforimpl.AggressorBeaconActionSpawnAs
	// AggressorBeaconActionSpawnTo identifies bspawnto.
	AggressorBeaconActionSpawnTo = opforimpl.AggressorBeaconActionSpawnTo
	// AggressorBeaconActionSpawnTunnel identifies bspunnel.
	AggressorBeaconActionSpawnTunnel = opforimpl.AggressorBeaconActionSpawnTunnel
	// AggressorBeaconActionSpawnTunnelLocal identifies bspunnel_local.
	AggressorBeaconActionSpawnTunnelLocal = opforimpl.AggressorBeaconActionSpawnTunnelLocal
	// AggressorBeaconActionSpawnUnder identifies bspawnu.
	AggressorBeaconActionSpawnUnder = opforimpl.AggressorBeaconActionSpawnUnder
	// AggressorBeaconActionStagePipe identifies beacon_stage_pipe.
	AggressorBeaconActionStagePipe = opforimpl.AggressorBeaconActionStagePipe
	// AggressorBeaconActionStageTCP identifies beacon_stage_tcp.
	AggressorBeaconActionStageTCP = opforimpl.AggressorBeaconActionStageTCP
	// AggressorBeaconActionStealToken identifies bsteal_token.
	AggressorBeaconActionStealToken = opforimpl.AggressorBeaconActionStealToken
	// AggressorBeaconActionSudo identifies bsudo.
	AggressorBeaconActionSudo = opforimpl.AggressorBeaconActionSudo
	// AggressorBeaconActionSyscallMethod identifies bsyscall_method.
	AggressorBeaconActionSyscallMethod = opforimpl.AggressorBeaconActionSyscallMethod
	// AggressorBeaconActionTimestomp identifies
	// btimestomp(idOrArray, targetFile, sourceFile).
	AggressorBeaconActionTimestomp = opforimpl.AggressorBeaconActionTimestomp
	// AggressorBeaconActionTokenStoreRemove identifies btoken_store_remove.
	AggressorBeaconActionTokenStoreRemove = opforimpl.AggressorBeaconActionTokenStoreRemove
	// AggressorBeaconActionTokenStoreRemoveAll identifies btoken_store_remove_all.
	AggressorBeaconActionTokenStoreRemoveAll = opforimpl.AggressorBeaconActionTokenStoreRemoveAll
	// AggressorBeaconActionTokenStoreShow identifies btoken_store_show.
	AggressorBeaconActionTokenStoreShow = opforimpl.AggressorBeaconActionTokenStoreShow
	// AggressorBeaconActionTokenStoreSteal identifies btoken_store_steal.
	AggressorBeaconActionTokenStoreSteal = opforimpl.AggressorBeaconActionTokenStoreSteal
	// AggressorBeaconActionTokenStoreStealAndUse identifies btoken_store_steal_and_use.
	AggressorBeaconActionTokenStoreStealAndUse = opforimpl.AggressorBeaconActionTokenStoreStealAndUse
	// AggressorBeaconActionTokenStoreUse identifies btoken_store_use.
	AggressorBeaconActionTokenStoreUse = opforimpl.AggressorBeaconActionTokenStoreUse
	// AggressorBeaconActionUnlink identifies bunlink.
	AggressorBeaconActionUnlink = opforimpl.AggressorBeaconActionUnlink
	// AggressorBeaconActionUpload identifies bupload(idOrArray, localPath).
	AggressorBeaconActionUpload = opforimpl.AggressorBeaconActionUpload
	// AggressorBeaconActionUploadRaw identifies
	// bupload_raw(idOrArray, remoteFile, rawContent[, localPath]).
	AggressorBeaconActionUploadRaw = opforimpl.AggressorBeaconActionUploadRaw
	// AggressorBeaconExecuteJob identifies beacon_execute_job.
	AggressorBeaconExecuteJob = opforimpl.AggressorBeaconExecuteJob
	// AggressorBeaconExecutePostexJob identifies beacon_execute_postex_job.
	AggressorBeaconExecutePostexJob = opforimpl.AggressorBeaconExecutePostexJob
	// AggressorBeaconHostImportedScript identifies beacon_host_imported_script.
	AggressorBeaconHostImportedScript = opforimpl.AggressorBeaconHostImportedScript
	// AggressorBeaconHostScript identifies beacon_host_script.
	AggressorBeaconHostScript = opforimpl.AggressorBeaconHostScript
	// AggressorBeaconInlineExecute identifies beacon_inline_execute.
	AggressorBeaconInlineExecute = opforimpl.AggressorBeaconInlineExecute
	// AggressorBeaconInlineExecutePE identifies beacon_inline_execute_pe.
	AggressorBeaconInlineExecutePE = opforimpl.AggressorBeaconInlineExecutePE
	// AggressorBeaconPostexKitCallbackID identifies
	// get_postex_kit_callback_id.
	AggressorBeaconPostexKitCallbackID = opforimpl.AggressorBeaconPostexKitCallbackID
	// AggressorBeaconTechniqueElevator identifies the belevate_command/runasadmin
	// elevator registry.
	AggressorBeaconTechniqueElevator = opforimpl.AggressorBeaconTechniqueElevator
	// AggressorBeaconTechniqueExploit identifies the belevate local-exploit
	// registry.
	AggressorBeaconTechniqueExploit = opforimpl.AggressorBeaconTechniqueExploit
	// AggressorBeaconTechniqueRemoteExecMethod identifies the bremote_exec
	// remote-exec-method registry.
	AggressorBeaconTechniqueRemoteExecMethod = opforimpl.AggressorBeaconTechniqueRemoteExecMethod
	// AggressorBeaconTechniqueRemoteExploit identifies the bjump remote-exploit
	// registry.
	AggressorBeaconTechniqueRemoteExploit = opforimpl.AggressorBeaconTechniqueRemoteExploit
	// AggressorBeaconTranscriptError identifies berror.
	AggressorBeaconTranscriptError = opforimpl.AggressorBeaconTranscriptError
	// AggressorBeaconTranscriptInput identifies binput.
	AggressorBeaconTranscriptInput = opforimpl.AggressorBeaconTranscriptInput
	// AggressorBeaconTranscriptJobError identifies bjoberror.
	AggressorBeaconTranscriptJobError = opforimpl.AggressorBeaconTranscriptJobError
	// AggressorBeaconTranscriptJobLog identifies bjoblog.
	AggressorBeaconTranscriptJobLog = opforimpl.AggressorBeaconTranscriptJobLog
	// AggressorBeaconTranscriptLog identifies blog.
	AggressorBeaconTranscriptLog = opforimpl.AggressorBeaconTranscriptLog
	// AggressorBeaconTranscriptLog2 identifies blog2.
	AggressorBeaconTranscriptLog2 = opforimpl.AggressorBeaconTranscriptLog2
	// AggressorBeaconTranscriptTask identifies btask.
	AggressorBeaconTranscriptTask = opforimpl.AggressorBeaconTranscriptTask
	// AggressorBeaconTranscriptTaskCompleted identifies btaskcompleted.
	AggressorBeaconTranscriptTaskCompleted = opforimpl.AggressorBeaconTranscriptTaskCompleted
	// AggressorCallbackCallable means Callback contains a retained, script-owned
	// callable capability.
	AggressorCallbackCallable = opforimpl.AggressorCallbackCallable
	// AggressorCallbackNull means the script explicitly supplied $null in the
	// optional callback position.
	AggressorCallbackNull = opforimpl.AggressorCallbackNull
	// AggressorCallbackOmitted means the function form had no callback argument.
	// It is the zero value so actions without callback support naturally use it.
	AggressorCallbackOmitted = opforimpl.AggressorCallbackOmitted
	// AggressorClientServiceAction identifies action.
	AggressorClientServiceAction = opforimpl.AggressorClientServiceAction
	// AggressorClientServiceCloseClient identifies closeClient.
	AggressorClientServiceCloseClient = opforimpl.AggressorClientServiceCloseClient
	// AggressorClientServiceCustomEvent identifies custom_event.
	AggressorClientServiceCustomEvent = opforimpl.AggressorClientServiceCustomEvent
	// AggressorClientServiceCustomEventPrivate identifies custom_event_private.
	AggressorClientServiceCustomEventPrivate = opforimpl.AggressorClientServiceCustomEventPrivate
	// AggressorClientServiceEventLog identifies elog.
	AggressorClientServiceEventLog = opforimpl.AggressorClientServiceEventLog
	// AggressorClientServiceGetAggressorClient identifies getAggressorClient.
	AggressorClientServiceGetAggressorClient = opforimpl.AggressorClientServiceGetAggressorClient
	// AggressorClientServiceGetCSVersion identifies get_cs_version.
	AggressorClientServiceGetCSVersion = opforimpl.AggressorClientServiceGetCSVersion
	// AggressorClientServiceMyNick identifies mynick.
	AggressorClientServiceMyNick = opforimpl.AggressorClientServiceMyNick
	// AggressorClientServicePrivateMessage identifies privmsg.
	AggressorClientServicePrivateMessage = opforimpl.AggressorClientServicePrivateMessage
	// AggressorClientServiceSay identifies say.
	AggressorClientServiceSay = opforimpl.AggressorClientServiceSay
	// AggressorClientServiceSyncDownload identifies sync_download.
	AggressorClientServiceSyncDownload = opforimpl.AggressorClientServiceSyncDownload
	// AggressorClientServiceUsers identifies users.
	AggressorClientServiceUsers       = opforimpl.AggressorClientServiceUsers
	AggressorClientUIAddTab           = opforimpl.AggressorClientUIAddTab
	AggressorClientUIAddToClipboard   = opforimpl.AggressorClientUIAddToClipboard
	AggressorClientUIAddVisualization = opforimpl.AggressorClientUIAddVisualization
	AggressorClientUIColorMenu        = opforimpl.AggressorClientUIColorMenu
	AggressorClientUIFileBrowser      = opforimpl.AggressorClientUIFileBrowser
	// These operations generate or insert documented client-side browser and
	// menu components. OPFOR transports opaque Values; the importer owns every
	// concrete GUI object and menu-tree mutation.
	AggressorClientUIGenerateBeaconBrowser  = opforimpl.AggressorClientUIGenerateBeaconBrowser
	AggressorClientUIGeneratePivotGraph     = opforimpl.AggressorClientUIGeneratePivotGraph
	AggressorClientUIGenerateSessionBrowser = opforimpl.AggressorClientUIGenerateSessionBrowser
	AggressorClientUIGenerateTargetBrowser  = opforimpl.AggressorClientUIGenerateTargetBrowser
	AggressorClientUIInsertColorMenu        = opforimpl.AggressorClientUIInsertColorMenu
	AggressorClientUIInsertComponent        = opforimpl.AggressorClientUIInsertComponent
	AggressorClientUIMenubar                = opforimpl.AggressorClientUIMenubar
	AggressorClientUINextTab                = opforimpl.AggressorClientUINextTab
	// The open* operations are client-owned window, dialog, tab, or browser
	// commands. Their values intentionally retain the exact documented
	// Aggressor function spelling so one provider can route them without a
	// second name translation table.
	AggressorClientUIOpenAboutDialog                     = opforimpl.AggressorClientUIOpenAboutDialog
	AggressorClientUIOpenApplicationManager              = opforimpl.AggressorClientUIOpenApplicationManager
	AggressorClientUIOpenAutoRunDialog                   = opforimpl.AggressorClientUIOpenAutoRunDialog
	AggressorClientUIOpenBeaconBrowser                   = opforimpl.AggressorClientUIOpenBeaconBrowser
	AggressorClientUIOpenBeaconConsole                   = opforimpl.AggressorClientUIOpenBeaconConsole
	AggressorClientUIOpenBrowserPivotSetup               = opforimpl.AggressorClientUIOpenBrowserPivotSetup
	AggressorClientUIOpenCloneSiteDialog                 = opforimpl.AggressorClientUIOpenCloneSiteDialog
	AggressorClientUIOpenConnectDialog                   = opforimpl.AggressorClientUIOpenConnectDialog
	AggressorClientUIOpenCovertVPNSetup                  = opforimpl.AggressorClientUIOpenCovertVPNSetup
	AggressorClientUIOpenCredentialManager               = opforimpl.AggressorClientUIOpenCredentialManager
	AggressorClientUIOpenDefaultShortcutsDialog          = opforimpl.AggressorClientUIOpenDefaultShortcutsDialog
	AggressorClientUIOpenDownloadBrowser                 = opforimpl.AggressorClientUIOpenDownloadBrowser
	AggressorClientUIOpenElevateDialog                   = opforimpl.AggressorClientUIOpenElevateDialog
	AggressorClientUIOpenEventLog                        = opforimpl.AggressorClientUIOpenEventLog
	AggressorClientUIOpenFileBrowser                     = opforimpl.AggressorClientUIOpenFileBrowser
	AggressorClientUIOpenGoldenTicketDialog              = opforimpl.AggressorClientUIOpenGoldenTicketDialog
	AggressorClientUIOpenHTMLApplicationDialog           = opforimpl.AggressorClientUIOpenHTMLApplicationDialog
	AggressorClientUIOpenHostFileDialog                  = opforimpl.AggressorClientUIOpenHostFileDialog
	AggressorClientUIOpenInterfaceManager                = opforimpl.AggressorClientUIOpenInterfaceManager
	AggressorClientUIOpenJavaSignedAppletDialog          = opforimpl.AggressorClientUIOpenJavaSignedAppletDialog
	AggressorClientUIOpenJavaSmartAppletDialog           = opforimpl.AggressorClientUIOpenJavaSmartAppletDialog
	AggressorClientUIOpenJobBrowser                      = opforimpl.AggressorClientUIOpenJobBrowser
	AggressorClientUIOpenJobConsole                      = opforimpl.AggressorClientUIOpenJobConsole
	AggressorClientUIOpenJumpDialog                      = opforimpl.AggressorClientUIOpenJumpDialog
	AggressorClientUIOpenKeystrokeBrowser                = opforimpl.AggressorClientUIOpenKeystrokeBrowser
	AggressorClientUIOpenListenerManager                 = opforimpl.AggressorClientUIOpenListenerManager
	AggressorClientUIOpenMakeTokenDialog                 = opforimpl.AggressorClientUIOpenMakeTokenDialog
	AggressorClientUIOpenMalleableProfileDialog          = opforimpl.AggressorClientUIOpenMalleableProfileDialog
	AggressorClientUIOpenNewCredentialDialog             = opforimpl.AggressorClientUIOpenNewCredentialDialog
	AggressorClientUIOpenOfficeMacroDialog               = opforimpl.AggressorClientUIOpenOfficeMacroDialog
	AggressorClientUIOpenOneLinerDialog                  = opforimpl.AggressorClientUIOpenOneLinerDialog
	AggressorClientUIOpenOrActivate                      = opforimpl.AggressorClientUIOpenOrActivate
	AggressorClientUIOpenPayloadGeneratorDialog          = opforimpl.AggressorClientUIOpenPayloadGeneratorDialog
	AggressorClientUIOpenPayloadGeneratorStageDialog     = opforimpl.AggressorClientUIOpenPayloadGeneratorStageDialog
	AggressorClientUIOpenPayloadHelper                   = opforimpl.AggressorClientUIOpenPayloadHelper
	AggressorClientUIOpenPayloadStoreManager             = opforimpl.AggressorClientUIOpenPayloadStoreManager
	AggressorClientUIOpenPivotListenerSetup              = opforimpl.AggressorClientUIOpenPivotListenerSetup
	AggressorClientUIOpenPortScanner                     = opforimpl.AggressorClientUIOpenPortScanner
	AggressorClientUIOpenPortScannerLocal                = opforimpl.AggressorClientUIOpenPortScannerLocal
	AggressorClientUIOpenPowerShellWebDialog             = opforimpl.AggressorClientUIOpenPowerShellWebDialog
	AggressorClientUIOpenPreferencesDialog               = opforimpl.AggressorClientUIOpenPreferencesDialog
	AggressorClientUIOpenProcessBrowser                  = opforimpl.AggressorClientUIOpenProcessBrowser
	AggressorClientUIOpenSOCKSBrowser                    = opforimpl.AggressorClientUIOpenSOCKSBrowser
	AggressorClientUIOpenSOCKSSetup                      = opforimpl.AggressorClientUIOpenSOCKSSetup
	AggressorClientUIOpenScreenshotBrowser               = opforimpl.AggressorClientUIOpenScreenshotBrowser
	AggressorClientUIOpenScriptConsole                   = opforimpl.AggressorClientUIOpenScriptConsole
	AggressorClientUIOpenScriptManager                   = opforimpl.AggressorClientUIOpenScriptManager
	AggressorClientUIOpenScriptedWebDialog               = opforimpl.AggressorClientUIOpenScriptedWebDialog
	AggressorClientUIOpenServiceBrowser                  = opforimpl.AggressorClientUIOpenServiceBrowser
	AggressorClientUIOpenSiteManager                     = opforimpl.AggressorClientUIOpenSiteManager
	AggressorClientUIOpenSpawnAsDialog                   = opforimpl.AggressorClientUIOpenSpawnAsDialog
	AggressorClientUIOpenSpawnDialog                     = opforimpl.AggressorClientUIOpenSpawnDialog
	AggressorClientUIOpenSpearPhishDialog                = opforimpl.AggressorClientUIOpenSpearPhishDialog
	AggressorClientUIOpenSystemInformationDialog         = opforimpl.AggressorClientUIOpenSystemInformationDialog
	AggressorClientUIOpenSystemProfilerDialog            = opforimpl.AggressorClientUIOpenSystemProfilerDialog
	AggressorClientUIOpenTargetBrowser                   = opforimpl.AggressorClientUIOpenTargetBrowser
	AggressorClientUIOpenURL                             = opforimpl.AggressorClientUIOpenURL
	AggressorClientUIOpenUserDefinedBrowser              = opforimpl.AggressorClientUIOpenUserDefinedBrowser
	AggressorClientUIOpenWebLog                          = opforimpl.AggressorClientUIOpenWebLog
	AggressorClientUIOpenWindowsExecutableDialog         = opforimpl.AggressorClientUIOpenWindowsExecutableDialog
	AggressorClientUIOpenWindowsExecutableStageAllDialog = opforimpl.AggressorClientUIOpenWindowsExecutableStageAllDialog
	AggressorClientUIOpenWindowsExecutableStageDialog    = opforimpl.AggressorClientUIOpenWindowsExecutableStageDialog
	AggressorClientUIPopupClear                          = opforimpl.AggressorClientUIPopupClear
	AggressorClientUIPreviousTab                         = opforimpl.AggressorClientUIPreviousTab
	AggressorClientUIProcessBrowser                      = opforimpl.AggressorClientUIProcessBrowser
	AggressorClientUIRemoveTab                           = opforimpl.AggressorClientUIRemoveTab
	AggressorClientUISeparator                           = opforimpl.AggressorClientUISeparator
	AggressorClientUIShowError                           = opforimpl.AggressorClientUIShowError
	AggressorClientUIShowMessage                         = opforimpl.AggressorClientUIShowMessage
	AggressorClientUIShowPopup                           = opforimpl.AggressorClientUIShowPopup
	AggressorClientUIShowVisualization                   = opforimpl.AggressorClientUIShowVisualization
	// AggressorCodeTransformEncode identifies encode.
	AggressorCodeTransformEncode = opforimpl.AggressorCodeTransformEncode
	// AggressorCodeTransformPowerShellCompress identifies powershell_compress.
	AggressorCodeTransformPowerShellCompress = opforimpl.AggressorCodeTransformPowerShellCompress
	// AggressorCodeTransformVBS identifies transform_vbs.
	AggressorCodeTransformVBS = opforimpl.AggressorCodeTransformVBS
	// AggressorCommandBeacon identifies Beacon console command help.
	AggressorCommandBeacon = opforimpl.AggressorCommandBeacon
	// AggressorCommandSSH identifies SSH console command help.
	AggressorCommandSSH = opforimpl.AggressorCommandSSH
	// AggressorContractProviderErrorsAuthoritative means OPFOR returns null and
	// the provider error without retrying through Host, because an external
	// effect may already have occurred.
	AggressorContractProviderErrorsAuthoritative = opforimpl.AggressorContractProviderErrorsAuthoritative
	// AggressorContractResultNull discards the provider's Value and returns null.
	AggressorContractResultNull = opforimpl.AggressorContractResultNull
	// AggressorContractResultPredicate coerces the provider's result to a Sleep
	// predicate value.
	AggressorContractResultPredicate = opforimpl.AggressorContractResultPredicate
	// AggressorContractResultValue transfers the provider's Value to the script.
	AggressorContractResultValue = opforimpl.AggressorContractResultValue
	// AggressorDataModelQueryKeys identifies data_keys().
	AggressorDataModelQueryKeys = opforimpl.AggressorDataModelQueryKeys
	// AggressorDataModelQueryPivots identifies pivots().
	AggressorDataModelQueryPivots = opforimpl.AggressorDataModelQueryPivots
	// AggressorDataModelQueryValue identifies data_query(key).
	AggressorDataModelQueryValue = opforimpl.AggressorDataModelQueryValue
	// AggressorDataStoreApplications identifies applications.
	AggressorDataStoreApplications = opforimpl.AggressorDataStoreApplications
	// AggressorDataStoreArchives identifies archives.
	AggressorDataStoreArchives = opforimpl.AggressorDataStoreArchives
	// AggressorDataStoreCredentialAdd identifies credential_add.
	AggressorDataStoreCredentialAdd = opforimpl.AggressorDataStoreCredentialAdd
	// AggressorDataStoreCredentials identifies credentials.
	AggressorDataStoreCredentials = opforimpl.AggressorDataStoreCredentials
	// AggressorDataStoreDownloads identifies downloads.
	AggressorDataStoreDownloads = opforimpl.AggressorDataStoreDownloads
	// AggressorDataStoreHighlight identifies highlight.
	AggressorDataStoreHighlight = opforimpl.AggressorDataStoreHighlight
	// AggressorDataStoreHostDelete identifies host_delete.
	AggressorDataStoreHostDelete = opforimpl.AggressorDataStoreHostDelete
	// AggressorDataStoreHostInfo identifies host_info.
	AggressorDataStoreHostInfo = opforimpl.AggressorDataStoreHostInfo
	// AggressorDataStoreHostUpdate identifies host_update.
	AggressorDataStoreHostUpdate = opforimpl.AggressorDataStoreHostUpdate
	// AggressorDataStoreHosts identifies hosts.
	AggressorDataStoreHosts = opforimpl.AggressorDataStoreHosts
	// AggressorDataStoreKeystrokes identifies keystrokes.
	AggressorDataStoreKeystrokes = opforimpl.AggressorDataStoreKeystrokes
	// AggressorDataStoreRedactObject identifies redactobject.
	AggressorDataStoreRedactObject = opforimpl.AggressorDataStoreRedactObject
	// AggressorDataStoreResetData identifies resetData.
	AggressorDataStoreResetData = opforimpl.AggressorDataStoreResetData
	// AggressorDataStoreScreenshots identifies screenshots.
	AggressorDataStoreScreenshots = opforimpl.AggressorDataStoreScreenshots
	// AggressorDataStoreServices identifies services.
	AggressorDataStoreServices = opforimpl.AggressorDataStoreServices
	// AggressorDataStoreTargets identifies targets.
	AggressorDataStoreTargets = opforimpl.AggressorDataStoreTargets
	// AggressorDataStoreTokenToEmail identifies tokenToEmail.
	AggressorDataStoreTokenToEmail  = opforimpl.AggressorDataStoreTokenToEmail
	AggressorDialogButtonAction     = opforimpl.AggressorDialogButtonAction
	AggressorDialogButtonHelp       = opforimpl.AggressorDialogButtonHelp
	AggressorDialogRowBeacon        = opforimpl.AggressorDialogRowBeacon
	AggressorDialogRowCheckbox      = opforimpl.AggressorDialogRowCheckbox
	AggressorDialogRowCombobox      = opforimpl.AggressorDialogRowCombobox
	AggressorDialogRowExploits      = opforimpl.AggressorDialogRowExploits
	AggressorDialogRowFile          = opforimpl.AggressorDialogRowFile
	AggressorDialogRowInterface     = opforimpl.AggressorDialogRowInterface
	AggressorDialogRowKRBTGT        = opforimpl.AggressorDialogRowKRBTGT
	AggressorDialogRowListener      = opforimpl.AggressorDialogRowListener
	AggressorDialogRowListenerStage = opforimpl.AggressorDialogRowListenerStage
	AggressorDialogRowMailServer    = opforimpl.AggressorDialogRowMailServer
	AggressorDialogRowProxyServer   = opforimpl.AggressorDialogRowProxyServer
	AggressorDialogRowSite          = opforimpl.AggressorDialogRowSite
	AggressorDialogRowText          = opforimpl.AggressorDialogRowText
	AggressorDialogRowTextBig       = opforimpl.AggressorDialogRowTextBig
	// AggressorListenerCreate identifies the deprecated listener_create.
	AggressorListenerCreate = opforimpl.AggressorListenerCreate
	// AggressorListenerCreateExtended identifies listener_create_ext.
	AggressorListenerCreateExtended = opforimpl.AggressorListenerCreateExtended
	// AggressorListenerDelete identifies listener_delete.
	AggressorListenerDelete = opforimpl.AggressorListenerDelete
	// AggressorListenerDescribe identifies listener_describe.
	AggressorListenerDescribe = opforimpl.AggressorListenerDescribe
	// AggressorListenerInfo identifies listener_info.
	AggressorListenerInfo = opforimpl.AggressorListenerInfo
	// AggressorListenerList identifies listeners.
	AggressorListenerList = opforimpl.AggressorListenerList
	// AggressorListenerListLocal identifies listeners_local.
	AggressorListenerListLocal = opforimpl.AggressorListenerListLocal
	// AggressorListenerListStageless identifies listeners_stageless.
	AggressorListenerListStageless = opforimpl.AggressorListenerListStageless
	// AggressorListenerPivotCreate identifies listener_pivot_create.
	AggressorListenerPivotCreate = opforimpl.AggressorListenerPivotCreate
	// AggressorListenerRestart identifies listener_restart.
	AggressorListenerRestart = opforimpl.AggressorListenerRestart
	// AggressorPEDump identifies pedump.
	AggressorPEDump = opforimpl.AggressorPEDump
	// AggressorPEInsertRichHeader identifies pe_insert_rich_header.
	AggressorPEInsertRichHeader = opforimpl.AggressorPEInsertRichHeader
	// AggressorPEMaskSection identifies pe_mask_section.
	AggressorPEMaskSection = opforimpl.AggressorPEMaskSection
	// AggressorPEPatchCode identifies pe_patch_code.
	AggressorPEPatchCode = opforimpl.AggressorPEPatchCode
	// AggressorPERemoveRichHeader identifies pe_remove_rich_header.
	AggressorPERemoveRichHeader = opforimpl.AggressorPERemoveRichHeader
	// AggressorPESetCompileTimeWithString identifies
	// pe_set_compile_time_with_string.
	AggressorPESetCompileTimeWithString = opforimpl.AggressorPESetCompileTimeWithString
	// AggressorPESetExportName identifies pe_set_export_name.
	AggressorPESetExportName = opforimpl.AggressorPESetExportName
	// AggressorPESetValueAt identifies pe_set_value_at.
	AggressorPESetValueAt = opforimpl.AggressorPESetValueAt
	// AggressorPayloadArtifact identifies the deprecated artifact function.
	AggressorPayloadArtifact = opforimpl.AggressorPayloadArtifact
	// AggressorPayloadArtifactGeneral identifies artifact_general.
	AggressorPayloadArtifactGeneral = opforimpl.AggressorPayloadArtifactGeneral
	// AggressorPayloadArtifactSign identifies artifact_sign.
	AggressorPayloadArtifactSign = opforimpl.AggressorPayloadArtifactSign
	// AggressorPayloadArtifactStager identifies artifact_stager.
	AggressorPayloadArtifactStager = opforimpl.AggressorPayloadArtifactStager
	// AggressorPayloadBootstrapHint identifies payload_bootstrap_hint.
	AggressorPayloadBootstrapHint = opforimpl.AggressorPayloadBootstrapHint
	// AggressorPayloadExport identifies payload.
	AggressorPayloadExport = opforimpl.AggressorPayloadExport
	// AggressorPayloadExportLocal identifies payload_local.
	AggressorPayloadExportLocal = opforimpl.AggressorPayloadExportLocal
	// AggressorPayloadGenerateAll identifies all_payloads.
	AggressorPayloadGenerateAll = opforimpl.AggressorPayloadGenerateAll
	// AggressorPayloadHasBootstrapHint identifies -hasbootstraphint.
	AggressorPayloadHasBootstrapHint = opforimpl.AggressorPayloadHasBootstrapHint
	// AggressorPayloadPowerShell identifies the deprecated powershell function.
	AggressorPayloadPowerShell = opforimpl.AggressorPayloadPowerShell
	// AggressorPayloadShellcode identifies the deprecated shellcode function.
	AggressorPayloadShellcode = opforimpl.AggressorPayloadShellcode
	// AggressorPayloadStager identifies stager.
	AggressorPayloadStager = opforimpl.AggressorPayloadStager
	// AggressorPayloadStagerBindPipe identifies stager_bind_pipe.
	AggressorPayloadStagerBindPipe = opforimpl.AggressorPayloadStagerBindPipe
	// AggressorPayloadStagerBindTCP identifies stager_bind_tcp.
	AggressorPayloadStagerBindTCP = opforimpl.AggressorPayloadStagerBindTCP
	// AggressorPayloadStoreAdd identifies payloadstore_add.
	AggressorPayloadStoreAdd = opforimpl.AggressorPayloadStoreAdd
	// AggressorPayloadStoreFetch identifies payloadstore_fetch.
	AggressorPayloadStoreFetch = opforimpl.AggressorPayloadStoreFetch
	// AggressorPayloadStoreList identifies payloadstore_list.
	AggressorPayloadStoreList = opforimpl.AggressorPayloadStoreList
	// AggressorPayloadStoreMetadata identifies payloadstore_metadata.
	AggressorPayloadStoreMetadata = opforimpl.AggressorPayloadStoreMetadata
	// AggressorPayloadStoreRemove identifies payloadstore_remove.
	AggressorPayloadStoreRemove = opforimpl.AggressorPayloadStoreRemove
	// AggressorPreferenceGet identifies pref_get.
	AggressorPreferenceGet = opforimpl.AggressorPreferenceGet
	// AggressorPreferenceGetList identifies pref_get_list.
	AggressorPreferenceGetList = opforimpl.AggressorPreferenceGetList
	// AggressorPreferenceSet identifies pref_set.
	AggressorPreferenceSet = opforimpl.AggressorPreferenceSet
	// AggressorPreferenceSetList identifies pref_set_list.
	AggressorPreferenceSetList = opforimpl.AggressorPreferenceSetList
	// AggressorProcessInjectionExplicitGet identifies pi_explicit_get.
	AggressorProcessInjectionExplicitGet = opforimpl.AggressorProcessInjectionExplicitGet
	// AggressorProcessInjectionExplicitInfo identifies pi_explicit_info.
	AggressorProcessInjectionExplicitInfo = opforimpl.AggressorProcessInjectionExplicitInfo
	// AggressorProcessInjectionExplicitSet identifies pi_explicit_set.
	AggressorProcessInjectionExplicitSet = opforimpl.AggressorProcessInjectionExplicitSet
	// AggressorProcessInjectionSpawnGet identifies pi_spawn_get.
	AggressorProcessInjectionSpawnGet = opforimpl.AggressorProcessInjectionSpawnGet
	// AggressorProcessInjectionSpawnInfo identifies pi_spawn_info.
	AggressorProcessInjectionSpawnInfo = opforimpl.AggressorProcessInjectionSpawnInfo
	// AggressorProcessInjectionSpawnSet identifies pi_spawn_set.
	AggressorProcessInjectionSpawnSet = opforimpl.AggressorProcessInjectionSpawnSet
	// AggressorProcessInjectionUserExplicitClear identifies
	// pi_user_explicit_clear.
	AggressorProcessInjectionUserExplicitClear = opforimpl.AggressorProcessInjectionUserExplicitClear
	// AggressorProcessInjectionUserExplicitGet identifies pi_user_explicit_get.
	AggressorProcessInjectionUserExplicitGet = opforimpl.AggressorProcessInjectionUserExplicitGet
	// AggressorProcessInjectionUserExplicitGetMap identifies
	// pi_user_explicit_get_map.
	AggressorProcessInjectionUserExplicitGetMap = opforimpl.AggressorProcessInjectionUserExplicitGetMap
	// AggressorProcessInjectionUserExplicitGetNames identifies
	// pi_user_explicit_get_names.
	AggressorProcessInjectionUserExplicitGetNames = opforimpl.AggressorProcessInjectionUserExplicitGetNames
	// AggressorProcessInjectionUserExplicitSet identifies pi_user_explicit_set.
	AggressorProcessInjectionUserExplicitSet = opforimpl.AggressorProcessInjectionUserExplicitSet
	// AggressorProcessInjectionUserSpawnClear identifies pi_user_spawn_clear.
	AggressorProcessInjectionUserSpawnClear = opforimpl.AggressorProcessInjectionUserSpawnClear
	// AggressorProcessInjectionUserSpawnGet identifies pi_user_spawn_get.
	AggressorProcessInjectionUserSpawnGet = opforimpl.AggressorProcessInjectionUserSpawnGet
	// AggressorProcessInjectionUserSpawnGetMap identifies pi_user_spawn_get_map.
	AggressorProcessInjectionUserSpawnGetMap = opforimpl.AggressorProcessInjectionUserSpawnGetMap
	// AggressorProcessInjectionUserSpawnGetNames identifies
	// pi_user_spawn_get_names.
	AggressorProcessInjectionUserSpawnGetNames = opforimpl.AggressorProcessInjectionUserSpawnGetNames
	// AggressorProcessInjectionUserSpawnSet identifies pi_user_spawn_set.
	AggressorProcessInjectionUserSpawnSet = opforimpl.AggressorProcessInjectionUserSpawnSet
	// AggressorProfileKillDate identifies killdate.
	AggressorProfileKillDate = opforimpl.AggressorProfileKillDate
	// AggressorProfileSetupStrings identifies setup_strings.
	AggressorProfileSetupStrings = opforimpl.AggressorProfileSetupStrings
	// AggressorProfileSetupTransformations identifies setup_transformations.
	AggressorProfileSetupTransformations = opforimpl.AggressorProfileSetupTransformations
	AggressorPromptConfirm               = opforimpl.AggressorPromptConfirm
	AggressorPromptDirectoryOpen         = opforimpl.AggressorPromptDirectoryOpen
	AggressorPromptFileOpen              = opforimpl.AggressorPromptFileOpen
	AggressorPromptFileSave              = opforimpl.AggressorPromptFileSave
	AggressorPromptText                  = opforimpl.AggressorPromptText
	// AggressorSessionQueryBeaconArchitecture identifies barch().
	AggressorSessionQueryBeaconArchitecture = opforimpl.AggressorSessionQueryBeaconArchitecture
	// AggressorSessionQueryBeaconData identifies bdata() and beacon_data().
	AggressorSessionQueryBeaconData = opforimpl.AggressorSessionQueryBeaconData
	// AggressorSessionQueryBeaconIDs identifies beacon_ids().
	AggressorSessionQueryBeaconIDs = opforimpl.AggressorSessionQueryBeaconIDs
	// AggressorSessionQueryBeaconInfo identifies binfo() and beacon_info().
	AggressorSessionQueryBeaconInfo = opforimpl.AggressorSessionQueryBeaconInfo
	// AggressorSessionQueryBeacons identifies beacons().
	AggressorSessionQueryBeacons = opforimpl.AggressorSessionQueryBeacons
	// AggressorSessionQueryIs64 identifies -is64.
	AggressorSessionQueryIs64 = opforimpl.AggressorSessionQueryIs64
	// AggressorSessionQueryIsActive identifies -isactive.
	AggressorSessionQueryIsActive = opforimpl.AggressorSessionQueryIsActive
	// AggressorSessionQueryIsAdmin identifies -isadmin.
	AggressorSessionQueryIsAdmin = opforimpl.AggressorSessionQueryIsAdmin
	// AggressorSessionQueryIsBeacon identifies -isbeacon.
	AggressorSessionQueryIsBeacon = opforimpl.AggressorSessionQueryIsBeacon
	// AggressorSessionQueryIsSSH identifies -isssh.
	AggressorSessionQueryIsSSH = opforimpl.AggressorSessionQueryIsSSH
	// AggressorSiteHost identifies site_host(...).
	AggressorSiteHost = opforimpl.AggressorSiteHost
	// AggressorSiteKill identifies site_kill(...).
	AggressorSiteKill = opforimpl.AggressorSiteKill
	// AggressorSiteList identifies sites().
	AggressorSiteList = opforimpl.AggressorSiteList
	// AggressorSiteLocalIP identifies localip().
	AggressorSiteLocalIP = opforimpl.AggressorSiteLocalIP
	// AggressorVPNInterfaceInfo identifies vpn_interface_info.
	AggressorVPNInterfaceInfo = opforimpl.AggressorVPNInterfaceInfo
	// AggressorVPNInterfaces identifies vpn_interfaces.
	AggressorVPNInterfaces = opforimpl.AggressorVPNInterfaces
	// AggressorVPNTAPCreate identifies vpn_tap_create.
	AggressorVPNTAPCreate = opforimpl.AggressorVPNTAPCreate
	// AggressorVPNTAPDelete identifies vpn_tap_delete.
	AggressorVPNTAPDelete = opforimpl.AggressorVPNTAPDelete
	// BOFPackBigEndian preserves the Cobalt-compatible bof_pack format and is
	// the default.
	BOFPackBigEndian = opforimpl.BOFPackBigEndian
	// BOFPackLittleEndian selects little-endian field lengths and numeric
	// values for importers whose BOF runner uses that convention.
	BOFPackLittleEndian = opforimpl.BOFPackLittleEndian
	// BindingAlias identifies a Beacon console alias registration.
	BindingAlias = opforimpl.BindingAlias
	// BindingCommand identifies a script-console command registration.
	BindingCommand = opforimpl.BindingCommand
	// BindingEvent identifies an on event registration.
	BindingEvent = opforimpl.BindingEvent
	// BindingHook identifies a set hook registration.
	BindingHook = opforimpl.BindingHook
	// BindingInline identifies a named inline declaration.
	BindingInline = opforimpl.BindingInline
	// BindingItem identifies a menu item registration.
	BindingItem = opforimpl.BindingItem
	// BindingKey identifies a key binding registration.
	BindingKey = opforimpl.BindingKey
	// BindingMenu identifies a menu or menubar registration.
	BindingMenu = opforimpl.BindingMenu
	// BindingOnce is atomically consumed by the first matching event dispatch.
	// Consumption happens before any callbacks selected by that dispatch run.
	BindingOnce = opforimpl.BindingOnce
	// BindingPersistent remains registered until its owning script unloads or
	// another runtime operation explicitly removes it.
	BindingPersistent = opforimpl.BindingPersistent
	// BindingPopup identifies a popup hook registration.
	BindingPopup = opforimpl.BindingPopup
	// BindingSSHAlias identifies an SSH console alias registration.
	BindingSSHAlias = opforimpl.BindingSSHAlias
	// BindingSub identifies a named sub declaration.
	BindingSub = opforimpl.BindingSub
	// EnvironmentFilter preserves an identifier and one raw, unevaluated
	// parameter for the importer.
	EnvironmentFilter = opforimpl.EnvironmentFilter
	// EnvironmentOrdinary evaluates a declaration's selector when it binds.
	EnvironmentOrdinary = opforimpl.EnvironmentOrdinary
	// EnvironmentPredicate compiles a parenthesized condition into a reusable
	// predicate evaluator.
	EnvironmentPredicate = opforimpl.EnvironmentPredicate
	// IncludeCycleAllow matches Sleep 2.1, which permits recursive includes
	// until execution is otherwise stopped (for example by an instruction
	// limit, context cancellation, or process resource exhaustion).
	IncludeCycleAllow = opforimpl.IncludeCycleAllow
	// IncludeCycleReject stops recursion with ErrIncludeCycle. This is OPFOR's
	// deterministic resource-safe default.
	IncludeCycleReject = opforimpl.IncludeCycleReject
	// KindArray identifies a mutable array reference.
	KindArray = opforimpl.KindArray
	// KindDouble identifies a double-precision number.
	KindDouble = opforimpl.KindDouble
	// KindFunction identifies a callable reference.
	KindFunction = opforimpl.KindFunction
	// KindHash identifies a mutable hash reference.
	KindHash = opforimpl.KindHash
	// KindInt identifies a signed 32-bit integer.
	KindInt = opforimpl.KindInt
	// KindLong identifies a signed 64-bit integer.
	KindLong = opforimpl.KindLong
	// KindNull identifies Sleep's $null value.
	KindNull = opforimpl.KindNull
	// KindObject identifies an opaque host object.
	KindObject = opforimpl.KindObject
	// KindString identifies a Sleep string. Sleep strings are sequences of
	// Java UTF-16 code units and may also carry byte provenance when they were
	// produced by a binary API such as pack or readb.
	KindString = opforimpl.KindString
	// LimitResourceCollectionEntries identifies the runtime-family collection
	// entry counter in LimitError.Resource.
	LimitResourceCollectionEntries = opforimpl.LimitResourceCollectionEntries
	// LimitResourceDecompressedBytes identifies the runtime-family decompressed
	// byte counter in LimitError.Resource.
	LimitResourceDecompressedBytes = opforimpl.LimitResourceDecompressedBytes
	// LimitResourceInputBytes identifies the runtime-family input byte counter
	// in LimitError.Resource.
	LimitResourceInputBytes = opforimpl.LimitResourceInputBytes
	// LimitResourceInstruction identifies the per-execution VM instruction
	// counter in LimitError.Resource.
	LimitResourceInstruction = opforimpl.LimitResourceInstruction
	// LimitResourceOutputBytes identifies the runtime-family output byte counter
	// in LimitError.Resource.
	LimitResourceOutputBytes = opforimpl.LimitResourceOutputBytes
	// LimitResourceSourceBytes identifies the runtime-family admitted source
	// byte counter in LimitError.Resource.
	LimitResourceSourceBytes = opforimpl.LimitResourceSourceBytes
	// ObjectConstruct requests construction of Class.
	ObjectConstruct = opforimpl.ObjectConstruct
	// ObjectGet requests a property or static field read.
	ObjectGet = opforimpl.ObjectGet
	// ObjectInvoke requests a method or static method invocation.
	ObjectInvoke = opforimpl.ObjectInvoke
	// ObjectSet requests a property or static field write.
	ObjectSet = opforimpl.ObjectSet
	// ObjectTypeCheck requests an isa-style type test.
	ObjectTypeCheck = opforimpl.ObjectTypeCheck
	// SeverityError identifies a fatal source diagnostic.
	SeverityError = opforimpl.SeverityError
	// SeverityInfo identifies an informational source diagnostic.
	SeverityInfo = opforimpl.SeverityInfo
	// SeverityWarning identifies a non-fatal source diagnostic.
	SeverityWarning = opforimpl.SeverityWarning
	// TaintPermeable applies Sleep's default input-to-result propagation.
	TaintPermeable = opforimpl.TaintPermeable
	// TaintSanitizer removes the successful result's top scalar marker.
	TaintSanitizer = opforimpl.TaintSanitizer
	// TaintSensitive rejects calls containing any tainted argument.
	TaintSensitive = opforimpl.TaintSensitive
	// TaintSensitiveSource combines sensitive input checking with a tainted
	// successful result.
	// TaintSensitiveSource is used for effects such as backtick execution:
	// tainted commands are rejected and successful output is tainted.
	TaintSensitiveSource = opforimpl.TaintSensitiveSource
	// TaintSource recursively marks every successful result.
	TaintSource = opforimpl.TaintSource
	// VariableContainerGlobal is the root variable container of an ordinary
	// loaded Script.
	VariableContainerGlobal = opforimpl.VariableContainerGlobal
	// VariableContainerInternal stores closure state or the globals of a forked
	// Script.
	VariableContainerInternal = opforimpl.VariableContainerInternal
	// VariableContainerLocal is the current, temporary local level of one
	// closure invocation.
	VariableContainerLocal         = opforimpl.VariableContainerLocal
	VariableProviderCreateGlobal   = opforimpl.VariableProviderCreateGlobal
	VariableProviderCreateInternal = opforimpl.VariableProviderCreateInternal
	VariableProviderCreateLocal    = opforimpl.VariableProviderCreateLocal
	VariableProviderExists         = opforimpl.VariableProviderExists
	VariableProviderGet            = opforimpl.VariableProviderGet
	VariableProviderPut            = opforimpl.VariableProviderPut
	VariableProviderRemove         = opforimpl.VariableProviderRemove
	// Version is the semantic version of this OPFOR source release.
	//
	// Pre-1.0 releases provide a usable library and CLI while the compatibility
	// matrix still records known gaps. Importers should not assume API stability
	// across pre-1.0 releases.
	Version = opforimpl.Version
)

Variables

View Source
var (
	// ErrAggressorBindingsUnavailable is returned when a method is called on the
	// zero value of AggressorBindings. A zero value carries no Runtime authority.
	ErrAggressorBindingsUnavailable = opforimpl.ErrAggressorBindingsUnavailable
	// ErrAggressorPopupStale reports that a retained popup composer no longer
	// names the complete binding generation captured by show_popup. popup_clear,
	// binding-owner unload, or creator unload makes a composer stale; it never
	// retargets to newer registrations with the same name.
	ErrAggressorPopupStale = opforimpl.ErrAggressorPopupStale
	// ErrAggressorUIClosed is returned when an Aggressor dialog or prompt
	// responder has already been consumed, dismissed, or failed. A script
	// lifecycle revocation returns ErrScriptUnloaded instead.
	ErrAggressorUIClosed = opforimpl.ErrAggressorUIClosed
	// ErrArrayChangedDuringIteration reports a structural array mutation made
	// outside the active foreach iterator.
	ErrArrayChangedDuringIteration = opforimpl.ErrArrayChangedDuringIteration
	// ErrHashChangedDuringIteration reports a structural hash mutation made
	// outside the active foreach iterator. Sleep surfaces the corresponding
	// ConcurrentModificationException as "detected unsafe data modification".
	ErrHashChangedDuringIteration = opforimpl.ErrHashChangedDuringIteration
	// ErrIncludeCycle identifies a recursive include chain stopped by OPFOR.
	ErrIncludeCycle = opforimpl.ErrIncludeCycle
	// ErrIndexOutOfRange reports an invalid array index or range.
	ErrIndexOutOfRange = opforimpl.ErrIndexOutOfRange
	// ErrInstructionLimit is returned when a configured VM instruction quota
	// is exhausted.
	ErrInstructionLimit = opforimpl.ErrInstructionLimit
	// ErrInvalidCallable is returned when a value that is not a function is
	// invoked.
	ErrInvalidCallable = opforimpl.ErrInvalidCallable
	// ErrReadCancellationUnsupported reports that shutdown revoked an
	// asynchronous read callback but could not interrupt its in-flight Read.
	// This is possible only for a borrowed reader which neither has an
	// OPFOR-owned closer nor implements the optional context-aware ReadContext
	// method documented by WithStdin.
	ErrReadCancellationUnsupported = opforimpl.ErrReadCancellationUnsupported
	// ErrReadOnlyArray reports an attempted mutation of a read-only array wrapper.
	// Sleep uses these wrappers for Java collections returned by functions such as
	// ls() and SleepUtils.getArrayWrapper().
	ErrReadOnlyArray = opforimpl.ErrReadOnlyArray
	// ErrReadOnlyHash reports a structural mutation of a read-only hash wrapper.
	// Sleep uses these wrappers for maps returned by functions such as
	// systemProperties(). Indexed writes target detached scalars and are silent
	// no-ops; remove operations surface this error.
	ErrReadOnlyHash = opforimpl.ErrReadOnlyHash
	// ErrResourceLimit is matched by every configured runtime resource quota
	// violation, including instruction limits. Use errors.As with *LimitError
	// to inspect the stable resource name and configured limit.
	ErrResourceLimit = opforimpl.ErrResourceLimit
	// ErrRuntimeClosed is returned when execution or script loading is requested
	// after Runtime.Close has begun. Closing is terminal: a Runtime is not a
	// reusable session once shutdown starts.
	ErrRuntimeClosed = opforimpl.ErrRuntimeClosed
	// ErrScriptUnloaded is returned when an importer retains and invokes a
	// callback after its owning script has been unloaded.
	ErrScriptUnloaded = opforimpl.ErrScriptUnloaded
	// ErrUnsafeArrayView reports an operation on a sublist after its backing array
	// was structurally changed through the root or another view. Sleep surfaces
	// the same condition as "parent @array changed after &sublist creation".
	ErrUnsafeArrayView = opforimpl.ErrUnsafeArrayView
)

Functions

func DefaultFunctionNames

func DefaultFunctionNames() []string

DefaultFunctionNames returns the native function names installed by New before importer overrides or additions. It derives the names from the same registration tables as New without constructing a live Runtime or consulting process state. The inventory includes native importer-boundary wrappers as well as functions that complete entirely in the portable runtime.

Types

type AggressorArgumentConstraint

type AggressorArgumentConstraint = opforimpl.AggressorArgumentConstraint

AggressorArgumentConstraint describes one source-audited positional-value constraint enforced before a typed Aggressor provider is called. Position is one-based. Kind identifies the comparison rule; the current inventory uses "enum" for exact Sleep string-coercion matches. In Values, "$null" denotes the null Value and an empty string denotes a non-null blank string.

Constraints apply only to the typed-provider route. The generic Host fallback deliberately receives the original Invocation without resolving or validating its arguments so legacy importers retain authority over it.

type AggressorArtifactKind

type AggressorArtifactKind = opforimpl.AggressorArtifactKind

AggressorArtifactKind identifies one documented stageless artifact generation function. The string values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorArtifactProvider

type AggressorArtifactProvider = opforimpl.AggressorArtifactProvider

AggressorArtifactProvider supplies Cobalt-owned stageless artifact generation. GenerateAggressorArtifact is called synchronously exactly once for each valid invocation when a provider is installed. For artifact_payload, OPFOR transfers the returned Value directly to the script. For artifact_stageless, the documented result is delivered through Callback and OPFOR discards the provider's returned Value, returning $null from the native wrapper.

A returned error rejects the invocation with a $null result and is never retried through Host. Implementations may be called concurrently and should observe ctx. A provider may retain Request Values and Callback subject to the documented capability lifetimes, but must not retain ctx after GenerateAggressorArtifact returns.

type AggressorArtifactProviderFunc

type AggressorArtifactProviderFunc = opforimpl.AggressorArtifactProviderFunc

AggressorArtifactProviderFunc adapts a function to AggressorArtifactProvider.

type AggressorArtifactRequest

type AggressorArtifactRequest = opforimpl.AggressorArtifactRequest

AggressorArtifactRequest is one resolved stageless artifact generation request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

Listener, ArtifactType, and Architecture are populated for both Kinds. Payload requests also populate ExitMethod and SystemCallMethod. Each of the four later optional positions has a Has field which distinguishes omission from an explicitly supplied $null Value. Stageless requests instead populate ProxyConfiguration and Callback. Every Value is resolved exactly once before the provider call. Scalars are immutable, while compound Values retain their ordinary reference identity; providers which retain a request also retain capabilities reachable through those Values and should snapshot or detach them when that lifetime is undesirable.

Callback is a retained, script-owned capability. A provider may invoke it asynchronously with the generated stageless content after GenerateAggressorArtifact returns. It honors the invocation context supplied by the provider and rejects calls after the creating Script generation retires, its Script unloads, or its Runtime closes.

type AggressorBOFExtractionRequest

type AggressorBOFExtractionRequest = opforimpl.AggressorBOFExtractionRequest

AggressorBOFExtractionRequest is one resolved bof_extract request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime.

Data is a detached low-byte snapshot of the first Sleep string argument, including embedded NULs. EntryPoint is the exact second string argument, or AggressorBOFDefaultEntryPoint when that argument was omitted. An extractor may retain or mutate Data without changing the source scalar.

type AggressorBOFExtractor

type AggressorBOFExtractor = opforimpl.AggressorBOFExtractor

AggressorBOFExtractor supplies Cobalt-owned bof_extract behavior. OPFOR deliberately does not guess Cobalt Strike's unpublished extracted-BOF byte envelope and never parses, links, relocates, or executes the object locally. ExtractAggressorBOF is called synchronously exactly once for each valid invocation when an extractor is configured.

Successful bytes are copied into a script-visible BinaryString. A nil or zero-length byte slice is still a successful zero-length string; this keeps the public strlen(result) failure check observable without conflating it with an extractor error. A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host. Implementations may be called concurrently, should observe ctx, and must not retain ctx after ExtractAggressorBOF returns.

type AggressorBOFExtractorFunc

type AggressorBOFExtractorFunc = opforimpl.AggressorBOFExtractorFunc

AggressorBOFExtractorFunc adapts a function to AggressorBOFExtractor.

type AggressorBeaconAction

type AggressorBeaconAction = opforimpl.AggressorBeaconAction

AggressorBeaconAction is one resolved Beacon operational request. Most actions describe remote tasking; bbeacon_interpreter_lint and the beacon_console_*, beacon_job_*, and beacon_remove forms describe Cobalt-client effects associated with a Beacon. Kind is the canonical action and Name is the exact normalized function spelling invoked by the script. RuntimeID is the nonzero process-local identity of the originating runtime; Script and Span identify the call site without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

Target is the first, action-target argument. Arguments contains the remaining ordinary arguments in source order, excluding both Target and an optional callback. Wrappers resolve every Value exactly once before the provider call and copy the Arguments slice, so no pass-by-name Cell or Invocation crosses this boundary. OPFOR deliberately does not coerce, flatten, or otherwise interpret these spec-neutral fields. Scalar Values are immutable, while arrays, hashes, functions, objects, and nested compound graphs retain their ordinary reference identity. A provider which retains the action therefore also retains any capabilities reachable through those Values; snapshot scalar coercions or detached graphs when that lifetime is undesirable.

Filesystem action arguments are task descriptions, not instructions for OPFOR's local filesystem. In particular, bupload's local path and bupload_raw's raw content and optional local path are transferred unchanged; reading local files, fan-out across an array Target, and issuing remote filesystem tasks remain importer-owned effects.

CallbackState distinguishes omission, explicit $null, and a callable value. Callback is nil for Omitted and Null. For Callable it is a retained capability tied to Script: it may be invoked after Dispatch returns, honors the invocation context supplied by the provider, and rejects calls after the owning script unloads or its Runtime closes.

type AggressorBeaconActionKind

type AggressorBeaconActionKind = opforimpl.AggressorBeaconActionKind

AggressorBeaconActionKind identifies one canonical Beacon tasking action. The string values are the exact Aggressor function names so they are stable across adapters and remain useful in logs without a second name mapping.

type AggressorBeaconActionProvider

type AggressorBeaconActionProvider = opforimpl.AggressorBeaconActionProvider

AggressorBeaconActionProvider performs Beacon tasking and associated Cobalt-client Beacon operations for the typed action wrappers. DispatchAggressorBeaconAction is called synchronously exactly once for each valid invocation when a provider is configured. A nil error means the action was accepted. Returning an error rejects the invocation; OPFOR does not retry it through Host, because doing so could duplicate a side effect.

Implementations may be called concurrently and should observe ctx. A provider may retain Action Values and Callback subject to the capability lifetimes documented on AggressorBeaconAction, but must not retain ctx after DispatchAggressorBeaconAction returns.

Example
package main

import (
	"bytes"
	"context"
	"fmt"

	"github.com/sliverarmory/opfor"
)

func main() {
	var tasks bytes.Buffer
	provider := opfor.AggressorBeaconActionProviderFunc(func(
		_ context.Context,
		action opfor.AggressorBeaconAction,
	) error {
		fmt.Fprintf(
			&tasks,
			"%s beacon=%s command=%s\n",
			action.Name,
			action.Target.String(),
			action.Arguments[0].String(),
		)
		return nil
	})

	var output bytes.Buffer
	runtime, err := opfor.New(
		opfor.WithStdout(&output),
		opfor.WithAggressorBeaconActionProvider(provider),
	)
	if err != nil {
		panic(err)
	}
	defer runtime.Close(context.Background())

	program, err := opfor.CompileString("task.cna", `
bshell("42", "whoami");
println("script continued");
`)
	if err != nil {
		panic(err)
	}
	if _, err := runtime.Execute(context.Background(), program); err != nil {
		panic(err)
	}

	fmt.Print(tasks.String())
	fmt.Print(output.String())
}
Output:
bshell beacon=42 command=whoami
script continued

type AggressorBeaconActionProviderFunc

type AggressorBeaconActionProviderFunc = opforimpl.AggressorBeaconActionProviderFunc

AggressorBeaconActionProviderFunc adapts a function to AggressorBeaconActionProvider.

type AggressorBeaconExecutionKind

type AggressorBeaconExecutionKind = opforimpl.AggressorBeaconExecutionKind

AggressorBeaconExecutionKind identifies one low-level Beacon execution or related Postex Kit operation. The values are the exact Aggressor function names so importer logs do not need a second name mapping.

type AggressorBeaconExecutionProvider

type AggressorBeaconExecutionProvider = opforimpl.AggressorBeaconExecutionProvider

AggressorBeaconExecutionProvider supplies Cobalt-owned low-level execution and Postex Kit behavior. HandleAggressorBeaconExecution is called synchronously exactly once for each valid invocation when a provider is configured. The four tasking operations are side-effect-only: OPFOR discards the returned Value and returns $null. For beacon_host_imported_script, beacon_host_script, and get_postex_kit_callback_id, the returned Value is transferred directly to the script.

A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host because the provider may already have issued a Beacon task. Implementations may be called concurrently and should observe ctx. They may retain request Values and Callback subject to the documented capability lifetimes, but must not retain ctx after this method returns.

type AggressorBeaconExecutionProviderFunc

type AggressorBeaconExecutionProviderFunc = opforimpl.AggressorBeaconExecutionProviderFunc

AggressorBeaconExecutionProviderFunc adapts a function to AggressorBeaconExecutionProvider.

type AggressorBeaconExecutionRequest

type AggressorBeaconExecutionRequest = opforimpl.AggressorBeaconExecutionRequest

AggressorBeaconExecutionRequest is one resolved low-level Beacon execution request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify its call site without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

Fields have these documented shapes:

  • beacon_execute_job: BeaconID, Command, CommandArguments, and Flags.
  • beacon_execute_postex_job: BeaconID, PID, Content, and optional PackedArguments, Callback, and MessageID.
  • beacon_inline_execute and beacon_inline_execute_pe: BeaconID, Content, EntryPoint, PackedArguments, and an optional Callback. For beacon_inline_execute, Content is the BOF byte string after OPFOR applies the active BEACON_INLINE_EXECUTE hook.
  • beacon_host_imported_script: BeaconID. The provider result is the hosted PowerShell download cradle.
  • beacon_host_script: BeaconID and Content containing the PowerShell script to host. The provider result is the hosted-script download cradle.
  • get_postex_kit_callback_id: no argument fields.

HasPackedArguments and HasMessageID distinguish omission from an explicitly supplied $null Value. CallbackState likewise distinguishes omission, explicit $null, and a retained callable. Every source argument is resolved exactly once before a configured provider is called. Compound Values retain their ordinary identity and binary provenance; providers that retain a request also retain any capabilities reachable through those Values.

Results from the two beacon_host functions retain their exact Value shape; OPFOR does not coerce them to strings. A non-nil Callback is a script-owned multi-shot capability. It honors the invocation context supplied by the provider and rejects calls after the creating Script generation retires, its Script unloads, or its Runtime closes. The documented callback ABI is (Beacon ID, result, information map); OPFOR deliberately leaves the provider responsible for supplying those exact Values.

type AggressorBeaconTechniqueCatalog

type AggressorBeaconTechniqueCatalog = opforimpl.AggressorBeaconTechniqueCatalog

AggressorBeaconTechniqueCatalog is a static or effective technique catalog. Technique order is deterministic first-insertion order. The zero value is an empty catalog.

type AggressorBeaconTechniqueKind

type AggressorBeaconTechniqueKind = opforimpl.AggressorBeaconTechniqueKind

AggressorBeaconTechniqueKind selects one of Cobalt Strike's independent Beacon technique registries.

type AggressorBeaconTechniqueMetadata

type AggressorBeaconTechniqueMetadata = opforimpl.AggressorBeaconTechniqueMetadata

AggressorBeaconTechniqueMetadata describes one registered Beacon technique. Architecture is required for remote exploits and must be "x86" or "x64"; it must be empty for every other kind.

Callbacks are deliberately absent. A catalog is safe to expose to importers, while executable callbacks remain private, script-owned capabilities.

type AggressorBeaconTranscriptKind

type AggressorBeaconTranscriptKind = opforimpl.AggressorBeaconTranscriptKind

AggressorBeaconTranscriptKind identifies one of Aggressor's Beacon transcript, task-description, or job-log calls. The string values are the corresponding Aggressor function names.

type AggressorBeaconTranscriptRecord

type AggressorBeaconTranscriptRecord = opforimpl.AggressorBeaconTranscriptRecord

AggressorBeaconTranscriptRecord is one resolved Aggressor Beacon transcript call. Kind determines which optional fields are populated: the four simple transcript kinds populate Text, Task populates Text and optionally RawMITREIDs, TaskCompleted populates TaskID, and the two job kinds populate JobID and Text. BeaconID is populated for every kind.

RuntimeID is the nonzero process-local identity of the originating runtime; that field disambiguates runtime-local Script IDs when one sink is shared with ScriptLoader children without exposing or retaining a *Runtime. Script and Span are immutable call-site provenance. Value fields are copied after resolving all pass-by-name arguments, so they expose no Invocation or mutable argument cells. Scalar values are immutable; compound Values retain their original array, hash, function, or object identity by design. Retaining capability-bearing Value graphs can therefore retain their owning Script or Runtime independently of the RuntimeID field. HasMITREIDs distinguishes btask's two-argument form from a supplied empty or null third argument. RawMITREIDs is the third argument's exact Sleep string coercion and is never parsed or expanded by OPFOR.

type AggressorBeaconTranscriptSink

type AggressorBeaconTranscriptSink = opforimpl.AggressorBeaconTranscriptSink

AggressorBeaconTranscriptSink receives resolved Beacon transcript records. PublishAggressorBeaconTranscript is called synchronously exactly once for each successful wrapper invocation. Returning an error rejects that call. Calls may occur concurrently for independent script executions. Implementations should observe ctx, must not retain it after returning, and must synchronize retained compound Values according to their own access policy. Record fields may be retained subject to their documented Value capability ownership.

type AggressorBeaconTranscriptSinkFunc

type AggressorBeaconTranscriptSinkFunc = opforimpl.AggressorBeaconTranscriptSinkFunc

AggressorBeaconTranscriptSinkFunc adapts a function to AggressorBeaconTranscriptSink.

type AggressorBindings

type AggressorBindings = opforimpl.AggressorBindings

AggressorBindings is an opaque capability for invoking the event, hook, and popup registrations owned by the Runtime which produced a typed Aggressor provider request. Script-originated capabilities are also bound to the exact generation which created the request. It deliberately does not expose the Runtime, evaluator, binding registry, script scopes, or generation token.

A capability may be retained after the provider call. Retaining it also retains its Runtime. Calls acquire an ordinary Runtime execution lease and, when the request originated in a script, a lease for that exact script generation. They honor cancellation and instruction limits, reject execution after explicit unload or Runtime.Close, and never become valid again if the same Script is run in a later generation.

The zero value is invalid. Use Valid before optional use, RuntimeID for provenance, and Same to compare two capabilities without exposing their underlying Runtime pointers.

type AggressorBreakpointProvider

type AggressorBreakpointProvider = opforimpl.AggressorBreakpointProvider

AggressorBreakpointProvider presents an already-built brk() snapshot to an importer UI. OPFOR calls HandleAggressorBreakpoint synchronously exactly once for each valid brk() call when a provider is installed. The method may block until an operator chooses Continue; it should observe ctx so script unload, Runtime.Close, and caller cancellation can end that wait.

A provider error is authoritative: brk() returns $null with that error and OPFOR neither prints the headless default nor retries through Host. Provider implementations may be called concurrently by independent script executions and must provide any synchronization they require. They may retain the detached snapshot, but must not retain ctx after the method returns.

type AggressorBreakpointProviderFunc

type AggressorBreakpointProviderFunc = opforimpl.AggressorBreakpointProviderFunc

AggressorBreakpointProviderFunc adapts a function to AggressorBreakpointProvider.

type AggressorBreakpointSnapshot

type AggressorBreakpointSnapshot = opforimpl.AggressorBreakpointSnapshot

AggressorBreakpointSnapshot is the interpreter-built state captured by one brk() call. Timestamp comes from the Runtime Clock. SourceLocation is the exact brk call span, while ScriptName and the script-facing location string use Sleep's basename-oriented display policy.

LocalVariables describes the active local level. GlobalVariables describes the script root. ClosureVariables flattens the current closure state and its captured lexical scopes from nearest to farthest, excluding the active local level and globals. StackFrames and CallStack are ordered innermost-first.

Every map, slice, array, and hash graph is detached from live evaluator storage, including cycles and shared compound identity. Functions and opaque objects remain ordinary Values and may retain capabilities. Snapshot values may be safely retained after the provider returns, but callers must synchronize their own concurrent mutations of retained compound Values.

type AggressorBreakpointStackFrame

type AggressorBreakpointStackFrame = opforimpl.AggressorBreakpointStackFrame

AggressorBreakpointStackFrame is one active Sleep execution frame, ordered from the frame containing brk() toward the script entry point. Function is the user-facing function name, SourceLocation is the instruction active in that frame, and LocalVariables is a detached snapshot of its current local level.

Maps and compound Values belong to the snapshot. A retained frame does not expose interpreter scopes or variable Cells. Function and opaque object Values necessarily retain their ordinary capability identity.

type AggressorCallbackContract

type AggressorCallbackContract = opforimpl.AggressorCallbackContract

AggressorCallbackContract describes one callback-shaped source argument. Position is one-based so it matches Aggressor documentation and diagnostics. Arguments is meaningful only when ArgumentsKnown is true.

type AggressorCallbackState

type AggressorCallbackState = opforimpl.AggressorCallbackState

AggressorCallbackState preserves the three observable shapes of an optional callback argument. Callback alone cannot distinguish an omitted argument from an explicitly supplied $null value because both have no Callable.

type AggressorClientServiceOperation

type AggressorClientServiceOperation = opforimpl.AggressorClientServiceOperation

AggressorClientServiceOperation identifies one operation owned by the connected Cobalt Strike client or Team Server. String values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorClientServiceProvider

type AggressorClientServiceProvider = opforimpl.AggressorClientServiceProvider

AggressorClientServiceProvider supplies client identity, connected-user, event-log, chat, custom-event, and connection-lifecycle behavior. OPFOR calls HandleAggressorClientService synchronously exactly once for each valid invocation when a provider is configured. A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host because a client or Team Server effect may already have occurred.

getAggressorClient, get_cs_version, mynick, and users transfer the returned Value directly to script code without coercion, validation, or cloning. In particular, getAggressorClient may return an opaque Object Value which stays usable through ObjectHost. The remaining operations, including sync_download, are documented only for their side effects; OPFOR discards the provider result and returns $null.

Implementations may be called concurrently and should observe ctx. A provider may retain request Values and Callback subject to the capability lifetimes above, but must not retain ctx after HandleAggressorClientService returns.

type AggressorClientServiceProviderFunc

type AggressorClientServiceProviderFunc = opforimpl.AggressorClientServiceProviderFunc

AggressorClientServiceProviderFunc adapts a function to AggressorClientServiceProvider.

type AggressorClientServiceRequest

type AggressorClientServiceRequest = opforimpl.AggressorClientServiceRequest

AggressorClientServiceRequest is one resolved client-service request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

Arguments is a detached top-level positional snapshot. Every source argument is resolved exactly once before the provider call. Scalar Values are immutable, while compound, binary, function, and object Values retain their ordinary identity and provenance. A provider which retains a request therefore also retains capabilities reachable through those Values and should snapshot or detach them when that lifetime is undesirable.

Arguments has these exact documented shapes:

  • action, elog, and say: message
  • privmsg: recipient and message
  • custom_event: topic and data
  • custom_event_private: recipient, topic, and data
  • sync_download: remote path and local destination; its optional third callback argument is represented by CallbackState and Callback
  • getAggressorClient, get_cs_version, mynick, users, and closeClient: no positions

Callback is non-nil only when sync_download's third position was callable. It is a retained, script-owned, multi-shot capability. The importer invokes it with the synced local path as its first positional argument. CallbackState distinguishes omission, explicit $null, and a callable. Invocation honors the supplied context and is rejected after generation retirement, Script unload, or Runtime close.

type AggressorClientUIOperation

type AggressorClientUIOperation = opforimpl.AggressorClientUIOperation

AggressorClientUIOperation identifies one client-owned UI operation. String values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorClientUIProvider

type AggressorClientUIProvider = opforimpl.AggressorClientUIProvider

AggressorClientUIProvider supplies embedding-client UI effects. It is called synchronously exactly once for every valid invocation when configured. OPFOR transfers a successful returned Value directly to the script without coercion, validation, or cloning for value-producing operations. This is also the open* result policy: an adapter may return its client object where Cobalt exposes one (for example a dockable log tab), and returns Null for an effect-only dialog. The documented effect-only popup_clear, file_browser, process_browser, insert_color_menu, and insert_component operations always return $null on the typed route; any provider result is discarded. openPayloadHelper likewise returns $null after provider success because its documented output is delivered through Callback, not through a synchronous return value. Provider errors are authoritative and are never retried through Host because a UI effect may already have occurred.

Implementations may be called concurrently and should observe ctx. The provider may retain request Values, Callback, and Popup subject to their documented capability lifetimes, but must not retain ctx after this method returns.

type AggressorClientUIProviderFunc

type AggressorClientUIProviderFunc = opforimpl.AggressorClientUIProviderFunc

AggressorClientUIProviderFunc adapts a function to AggressorClientUIProvider.

type AggressorClientUIRequest

type AggressorClientUIRequest = opforimpl.AggressorClientUIRequest

AggressorClientUIRequest is one resolved client UI request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

Arguments is a detached top-level positional snapshot. Every argument is resolved exactly once before the provider call. Scalar Values are immutable while compound, object, and binary Values retain their ordinary identity and provenance. The sole openPayloadHelper function argument is not duplicated in Arguments: Callback contains its retained, lifecycle-bound capability. Providers that retain a request also retain any capabilities reachable through its Values and should snapshot or detach them when that lifetime is undesirable.

Popup is non-nil for show_popup or menubar when a matching popup registration was active at request time. For show_popup, the original event, popup name, and component remain available in Arguments at positions zero through two. For menubar, the description and popup name remain at positions zero and one. Composition is a detached snapshot of the active popup/menu composition for separator, insert_color_menu, and insert_component; it lets an importer place the supplied component in the correct menu tree without embedding interpreter state in that snapshot. It is nil when one of those functions is invoked outside a registered popup/menu callback.

Callback is non-nil only for openPayloadHelper. It is a retained, script-owned, multi-shot capability whose Invoke arguments become the chooser callback's positional arguments. In particular, a provider passes the selected listener as its first argument. Invocation honors the supplied context and is rejected after the creating Script generation retires, its Script unloads, or Runtime closes.

type AggressorCodeTransformOperation

type AggressorCodeTransformOperation = opforimpl.AggressorCodeTransformOperation

AggressorCodeTransformOperation identifies one documented Cobalt-owned code or script transformation. String values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorCodeTransformProvider

type AggressorCodeTransformProvider = opforimpl.AggressorCodeTransformProvider

AggressorCodeTransformProvider supplies Cobalt-owned position-independent code encoding, PowerShell compression, and VBS shellcode transformation. OPFOR calls HandleAggressorCodeTransform synchronously exactly once for each valid invocation when a provider is configured and no applicable script hook handled the request. OPFOR validates only documented arity and does not reproduce or infer the unpublished output algorithms.

A successful returned Value is transferred directly to script code without coercion, validation, cloning, or serialization. A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host after a provider may have done work. Implementations may be called concurrently and should observe ctx. They may retain request Values subject to the capability lifetime above, but must not retain ctx after this method returns.

type AggressorCodeTransformProviderFunc

type AggressorCodeTransformProviderFunc = opforimpl.AggressorCodeTransformProviderFunc

AggressorCodeTransformProviderFunc adapts a function to AggressorCodeTransformProvider.

type AggressorCodeTransformRequest

type AggressorCodeTransformRequest = opforimpl.AggressorCodeTransformRequest

AggressorCodeTransformRequest is one resolved Cobalt-owned transformation request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime.

Arguments is an exact positional snapshot resolved once before provider dispatch. Its documented shapes are:

  • encode: position-independent code, encoder name, architecture
  • powershell_compress: PowerShell script
  • transform_vbs: shellcode, maximum plaintext-run length

The slice is detached from Invocation, while its Values retain ordinary binary, compound, function, and object identity and provenance. Providers which retain a request therefore retain any capabilities reachable through those Values and should snapshot or detach them when appropriate.

type AggressorCommandCatalog

type AggressorCommandCatalog = opforimpl.AggressorCommandCatalog

AggressorCommandCatalog is a static or effective command-help catalog. Command slice order is preserved and is the order returned by the corresponding commands function. An effective snapshot includes only groups referenced by an active command. The zero value is an empty catalog.

type AggressorCommandGroup

type AggressorCommandGroup = opforimpl.AggressorCommandGroup

AggressorCommandGroup describes one Beacon or SSH help group.

type AggressorCommandKind

type AggressorCommandKind = opforimpl.AggressorCommandKind

AggressorCommandKind selects one of Cobalt Strike's independent console help catalogs.

type AggressorCommandMetadata

type AggressorCommandMetadata = opforimpl.AggressorCommandMetadata

AggressorCommandMetadata describes one command in a Beacon or SSH help catalog. GroupID is empty when the command is not assigned to a help group.

type AggressorContractProviderErrors

type AggressorContractProviderErrors = opforimpl.AggressorContractProviderErrors

AggressorContractProviderErrors describes what a typed provider error means at the native wrapper boundary.

type AggressorContractResult

type AggressorContractResult = opforimpl.AggressorContractResult

AggressorContractResult describes the result visible to script code after a successful call through a typed Aggressor provider. Generic Host fallback is deliberately outside this contract because importers may preserve legacy result conventions there.

type AggressorDataModelQuery

type AggressorDataModelQuery = opforimpl.AggressorDataModelQuery

AggressorDataModelQuery is one resolved, read-only request for Cobalt's data model. RuntimeID is the nonzero process-local identity of the originating runtime; Script and Span identify the call site. Key is $null for data_keys and pivots, and is the data_query argument resolved exactly once otherwise.

Scalar Values are immutable. A compound Key deliberately retains its mutable reference identity because the public contract calls for a key but does not define coercion. A provider retaining the whole request therefore also retains any object, callable, or nested compound capabilities carried by Key; snapshot a scalar coercion instead when that lifetime is undesirable.

type AggressorDataModelQueryKind

type AggressorDataModelQueryKind = opforimpl.AggressorDataModelQueryKind

AggressorDataModelQueryKind identifies one canonical Cobalt data-model operation. Name on AggressorDataModelQuery retains the exact function spelling used by the script.

type AggressorDataModelQueryProvider

type AggressorDataModelQueryProvider = opforimpl.AggressorDataModelQueryProvider

AggressorDataModelQueryProvider supplies the Cobalt-owned data behind data_keys, data_query, and pivots. QueryAggressorDataModel is called exactly once for each valid invocation when a provider is installed. Returning an error rejects the invocation with a $null result; OPFOR never retries through Host.

OPFOR transfers the returned Value directly to the script without sorting, coercion, validation, or cloning. Providers must therefore return a fresh, detached array or hash graph whenever script mutation must not affect their backing data. Implementations may be called concurrently and should observe ctx. Unknown keys, key ordering, result freshness, and missing-data behavior remain provider-owned because the public Aggressor reference does not define them.

type AggressorDataModelQueryProviderFunc

type AggressorDataModelQueryProviderFunc = opforimpl.AggressorDataModelQueryProviderFunc

AggressorDataModelQueryProviderFunc adapts a function to AggressorDataModelQueryProvider.

type AggressorDataStoreOperation

type AggressorDataStoreOperation = opforimpl.AggressorDataStoreOperation

AggressorDataStoreOperation identifies one documented Cobalt data-store query or mutation. The string values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorDataStoreProvider

type AggressorDataStoreProvider = opforimpl.AggressorDataStoreProvider

AggressorDataStoreProvider supplies the Cobalt-owned records behind the documented data-store queries and mutations. HandleAggressorDataStore is called synchronously exactly once for every valid invocation when a provider is installed. A returned error rejects the invocation with a $null result and is authoritative: OPFOR never retries through Host because a mutation may already have taken effect.

OPFOR transfers successful provider Values directly to the script without coercion, validation, cloning, or serialization, except for RedactObject. The documented query results are arrays of model dictionaries, except tokenToEmail (an email string or the literal "unknown") and host_info (a host dictionary or one selected value). The current redactobject entry documents a removal effect and no Returns section, so the typed route discards its successful provider Value and returns $null. The public reference does not fully specify record schemas, ordering, freshness, missing-record behavior, or other mutation return values; those remain provider-owned. Providers should return detached graphs when script mutation must not affect backing state.

Implementations may be called concurrently and should observe ctx. They may retain request Values subject to the capability lifetime above, but must not retain ctx after HandleAggressorDataStore returns.

type AggressorDataStoreProviderFunc

type AggressorDataStoreProviderFunc = opforimpl.AggressorDataStoreProviderFunc

AggressorDataStoreProviderFunc adapts a function to AggressorDataStoreProvider.

type AggressorDataStoreRequest

type AggressorDataStoreRequest = opforimpl.AggressorDataStoreRequest

AggressorDataStoreRequest is one resolved request for Cobalt's application data stores. Name is the exact normalized Aggressor function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime.

Arguments contains an exact positional snapshot, resolved once before the provider call. Its documented shapes are:

  • credential_add: username, secret, then optional realm, source, host, secret type, and notes (two through seven positions)
  • tokenToEmail: token
  • highlight: model, rows array, and accent
  • host_info: host and an optional key
  • host_update: host, DNS name, OS, version, and an optional note
  • host_delete: one host or array of hosts
  • redactobject: one post-exploitation object ID
  • credentials, applications, archives, downloads, keystrokes, screenshots, services, targets, hosts, and resetData: no positions

The length of Arguments distinguishes omission from an explicitly supplied $null. The slice itself is detached from Invocation, but each Value is transferred without coercion or cloning. Compound and object Values retain their ordinary identity, so a provider retaining this request also retains any capabilities reachable through those Values.

type AggressorDialogButton

type AggressorDialogButton = opforimpl.AggressorDialogButton

AggressorDialogButton is one ordered dialog button. Action buttons carry a Label and are submitted through AggressorDialogResponder.Activate. Help buttons carry a URL; opening it is a provider-owned UI effect and must not invoke the dialog's action callback.

type AggressorDialogButtonID

type AggressorDialogButtonID = opforimpl.AggressorDialogButtonID

AggressorDialogButtonID identifies one button within an Aggressor dialog.

type AggressorDialogButtonKind

type AggressorDialogButtonKind = opforimpl.AggressorDialogButtonKind

AggressorDialogButtonKind distinguishes callback-bearing action buttons from provider-owned Help buttons.

type AggressorDialogDefault

type AggressorDialogDefault = opforimpl.AggressorDialogDefault

AggressorDialogDefault is one top-level entry from the dictionary passed to dialog. Entries retain the source dictionary's observable iteration order.

type AggressorDialogID

type AggressorDialogID = opforimpl.AggressorDialogID

AggressorDialogID identifies one dialog within its originating Runtime. Combine it with RuntimeID when a provider serves more than one Runtime.

type AggressorDialogPresentation

type AggressorDialogPresentation = opforimpl.AggressorDialogPresentation

AggressorDialogPresentation is a detached top-level snapshot passed to a dialog provider. Slices are copied for the provider call. Values within Defaults, Rows, and Options retain normal OPFOR Value identity, so providers must snapshot or coerce capability-bearing compound/object Values before retaining them when that lifetime is undesirable.

CreatorScript/CreationSpan identify dialog(...), while PresenterScript and PresentationSpan identify dialog_show(...). A valid ID is unique within its RuntimeID.

type AggressorDialogProvider

type AggressorDialogProvider = opforimpl.AggressorDialogProvider

AggressorDialogProvider presents runtime-owned dialogs. It may activate or dismiss synchronously, retain responder for asynchronous UI work, or return an error. A returned error is authoritative for dialog_show and never retries through Host; it cannot roll back a responder operation which the provider already completed, so providers should normally return nil after a successful Activate or Dismiss. Implementations may be called concurrently and should observe ctx. They may retain responder and presentation, but must not retain ctx after this method returns.

type AggressorDialogProviderFunc

type AggressorDialogProviderFunc = opforimpl.AggressorDialogProviderFunc

AggressorDialogProviderFunc adapts a function to AggressorDialogProvider.

type AggressorDialogResponder

type AggressorDialogResponder = opforimpl.AggressorDialogResponder

AggressorDialogResponder is the one-shot capability paired with a dialog presentation. Activate accepts only an action button, closes the responder, and calls the owning script with the exact dialog object, stored button label, and a fresh row-name/value dictionary. Dismiss closes without calling script code. The first validated Activate or Dismiss consumes the one-shot; a callback error does not reopen it. Later operations after completion, dismissal, or provider failure match ErrAggressorUIClosed. Done closes when activation is admitted (before its callback returns), on dismissal, provider failure, script unload, or Runtime.Close.

Activate may be called after PresentAggressorDialog returns. Callback admission remains tied to the creating script. If lifecycle revocation wins while the responder is open, a later call with a live caller context returns ErrScriptUnloaded; an earlier completion/dismissal remains ErrAggressorUIClosed. A caller context error is checked first. The returned Value is the callback result for importer observability; it is not used as the result of dialog_show. An activation begun while PresentAggressorDialog is still active is drained at that boundary and shares the presenting execution's instruction budget. A later retained activation is a detached UI event with a fresh top-level budget. Neither path exposes the presenter's raw evaluator/lifecycle state.

type AggressorDialogRow

type AggressorDialogRow = opforimpl.AggressorDialogRow

AggressorDialogRow is one ordered row in a dialog presentation. Function is the exact drow_* spelling used by the script; Kind is its canonical UI kind. drow_listener_smb therefore has Kind AggressorDialogRowListenerStage while retaining Function "drow_listener_smb" and Deprecated true.

Default and Options Values are transferred without scalar coercion. Options is a detached top-level slice, but a nested compound or object Value keeps its ordinary reference identity. Checkbox result encoding and every client-owned selector result remain provider responsibilities.

type AggressorDialogRowID

type AggressorDialogRowID = opforimpl.AggressorDialogRowID

AggressorDialogRowID identifies one row within an Aggressor dialog.

type AggressorDialogRowKind

type AggressorDialogRowKind = opforimpl.AggressorDialogRowKind

AggressorDialogRowKind identifies the UI contract of one drow_* call.

type AggressorDialogRowValue

type AggressorDialogRowValue = opforimpl.AggressorDialogRowValue

AggressorDialogRowValue supplies one provider-produced value for a row. Activate rejects unknown or repeated RowIDs. Rows omitted from a response receive their captured default, or $null when no default was supplied.

type AggressorEventDispatcher

type AggressorEventDispatcher = opforimpl.AggressorEventDispatcher

AggressorEventDispatcher schedules the callback supplied to dispatch_event. A UI embedder can marshal it onto its event thread; the stock offline runtime invokes it synchronously. The callback is already retained under its owning Script and rejects invocation after unload.

type AggressorEventDispatcherFunc

type AggressorEventDispatcherFunc = opforimpl.AggressorEventDispatcherFunc

AggressorEventDispatcherFunc adapts a function to AggressorEventDispatcher.

type AggressorFunctionContract

type AggressorFunctionContract = opforimpl.AggressorFunctionContract

AggressorFunctionContract is the runtime-enforced portion of a native Aggressor function boundary. MinimumArguments and MaximumArguments are inclusive. Provider identifies the public typed provider interface; a valid call falls back to Host when that provider is not configured.

The inventory intentionally contains only function-specific contracts enforced by OPFOR. Its absence does not mean a name is unavailable: generic Host functions and portable Sleep functions are cataloged separately by the aggressor package.

func DefaultAggressorFunctionContracts

func DefaultAggressorFunctionContracts() []AggressorFunctionContract

DefaultAggressorFunctionContracts returns a sorted, detached inventory of native Aggressor contracts enforced by New's typed-provider wrappers.

type AggressorListenerOperation

type AggressorListenerOperation = opforimpl.AggressorListenerOperation

AggressorListenerOperation identifies one documented listener query or mutation. String values are the exact Aggressor function names.

type AggressorListenerProvider

type AggressorListenerProvider = opforimpl.AggressorListenerProvider

AggressorListenerProvider supplies Cobalt-owned listener state. It is called synchronously exactly once for every valid invocation when installed. Errors are authoritative and never fall back to Host because a mutation may already have taken effect.

listener_describe, listener_info, listeners, listeners_local, and listeners_stageless transfer the provider's successful Value directly to script code. The five create/delete/restart operations are documented only as effects; OPFOR discards their provider result and returns $null. Record schemas, ordering, remote-listener resolution, and missing-listener behavior are not fully specified by the public reference and remain provider-owned.

Implementations may be called concurrently and should observe ctx. They may retain request Values, but must not retain ctx after HandleAggressorListener returns.

type AggressorListenerProviderFunc

type AggressorListenerProviderFunc = opforimpl.AggressorListenerProviderFunc

AggressorListenerProviderFunc adapts a function to AggressorListenerProvider.

type AggressorListenerRequest

type AggressorListenerRequest = opforimpl.AggressorListenerRequest

AggressorListenerRequest is one resolved request against importer-owned listener state. Name retains the exact normalized function spelling. RuntimeID, Script, and Span provide call-site provenance without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

Arguments is an exact positional snapshot with these documented shapes:

  • listener_create: name, payload, host, port, then optional beacon hosts
  • listener_create_ext: name, payload, and options hash
  • listener_delete/listener_restart: listener name
  • listener_describe/listener_info: listener name and an optional target/key
  • listener_pivot_create: Beacon ID, name, payload, host, and port
  • listeners/listeners_local/listeners_stageless: no positions

The top-level slice is detached from Invocation. Values are resolved once and retain binary provenance and compound identity. Length distinguishes an omitted optional argument from explicit $null.

type AggressorPEOperation

type AggressorPEOperation = opforimpl.AggressorPEOperation

AggressorPEOperation identifies one Cobalt-owned PE inspection or transformation operation. String values are the exact documented Aggressor function names so they remain stable in importer logs and adapters.

type AggressorPEProvider

type AggressorPEProvider = opforimpl.AggressorPEProvider

AggressorPEProvider supplies Cobalt-owned PE parsing and transformations. OPFOR calls HandleAggressorPE synchronously exactly once for each valid invocation when a provider is configured. A successful returned Value is transferred directly to script code without coercion, validation, cloning, or serialization. OPFOR validates only the documented arity and does not parse, modify, or otherwise infer the PE algorithm on this route. pe_set_export_name is the one exception to exact-arity validation: its current argument table lists one content argument while both executable examples supply content and an export name. OPFOR accepts the evidence union of one or two arguments; HasArgument(1) preserves which form was used for the provider rather than inventing a missing name.

A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host after a provider may have done work. Implementations may be called concurrently and should observe ctx. They may retain request Values subject to the capability lifetime above, but must not retain ctx after HandleAggressorPE returns.

type AggressorPEProviderFunc

type AggressorPEProviderFunc = opforimpl.AggressorPEProviderFunc

AggressorPEProviderFunc adapts a function to AggressorPEProvider.

type AggressorPERequest

type AggressorPERequest = opforimpl.AggressorPERequest

AggressorPERequest is one resolved Cobalt-owned PE request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime.

Arguments is an exact positional snapshot resolved once before provider dispatch. The slice is detached from Invocation, while its Values retain ordinary binary, compound, function, and object identity and provenance. Providers which retain a request therefore retain any capabilities reachable through those Values and should snapshot or detach them when appropriate.

type AggressorPayloadOperation

type AggressorPayloadOperation = opforimpl.AggressorPayloadOperation

AggressorPayloadOperation identifies one documented payload, artifact, or stager operation. String values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorPayloadProvider

type AggressorPayloadProvider = opforimpl.AggressorPayloadProvider

AggressorPayloadProvider supplies Cobalt-owned payload, artifact, and stager generation. OPFOR never generates these payloads itself. The method is called synchronously exactly once for each valid invocation when a provider is configured. A returned error is authoritative and is never retried through Host because generation or signing may already have caused an external effect.

Successful provider Values are transferred directly to script code without coercion, validation, cloning, or serialization, except that -hasbootstraphint is normalized through Sleep truthiness to Bool. The public reference describes all operations in this provider as returning a value; OPFOR consequently preserves the provider result for each of them. Compound results remain provider-owned references, so providers should return detached graphs when script mutation must not affect backing state.

Implementations may be called concurrently and should observe ctx. They may retain request Values subject to the capability lifetime above, but must not retain ctx after HandleAggressorPayload returns.

type AggressorPayloadProviderFunc

type AggressorPayloadProviderFunc = opforimpl.AggressorPayloadProviderFunc

AggressorPayloadProviderFunc adapts a function to AggressorPayloadProvider.

type AggressorPayloadRequest

type AggressorPayloadRequest = opforimpl.AggressorPayloadRequest

AggressorPayloadRequest is one resolved importer-owned payload operation. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

Arguments is an exact positional snapshot resolved once before the provider call. Its documented shapes are:

  • -hasbootstraphint: payload bytes
  • all_payloads: destination folder, sign flag, system-call method, then optional HTTP library, DNS communication mode, and profile override
  • artifact: listener, artifact type, then the optional deprecated value and architecture (the reference's example supplies only the first two)
  • artifact_general: shellcode, artifact type, architecture
  • artifact_sign: artifact bytes
  • artifact_stager: listener, artifact type, architecture, then an optional Payload Store information map
  • payload: listener, architecture, exit method, system-call method, then optional HTTP library, DNS communication mode, and profile override
  • payload_bootstrap_hint: payload bytes and function name
  • payload_local: parent Beacon ID, listener, architecture, exit method, system-call method, then an optional HTTP library
  • powershell: listener, local-host flag, then an optional architecture; omission is preserved because the public reference's example omits it
  • shellcode: listener, remote-target flag, architecture
  • stager: listener and architecture
  • stager_bind_pipe: listener
  • stager_bind_tcp: listener, architecture, and port

The slice is detached from Invocation, but Values are neither replaced nor cloned. Its length therefore distinguishes omission from an explicitly supplied $null, and compound/object/function Values retain their ordinary reference identity. The all_payloads typed route applies Sleep string coercion only while checking the function reference's exact system-call, HTTP-library, and DNS-mode enumerations; the provider still receives the original Values. Providers that retain a request also retain any capabilities reachable through those Values.

type AggressorPayloadStoreOperation

type AggressorPayloadStoreOperation = opforimpl.AggressorPayloadStoreOperation

AggressorPayloadStoreOperation identifies one documented Payload Store query or mutation. String values are the exact Aggressor function names.

type AggressorPayloadStoreProvider

type AggressorPayloadStoreProvider = opforimpl.AggressorPayloadStoreProvider

AggressorPayloadStoreProvider supplies Cobalt-owned Payload Store state. HandleAggressorPayloadStore is called synchronously exactly once for every valid invocation when configured. Errors are authoritative and never retry through Host because add/remove may already have changed external state.

Successful add, fetch, list, and metadata results are transferred directly to the script without coercion, cloning, validation, or serialization. Remove is documented solely as an effect; OPFOR discards the provider result and returns $null. Entry schemas, ordering, duplicate-name behavior, missing entries, persistence, and freshness remain importer-owned.

Implementations may be called concurrently and should observe ctx. They may retain request Values but must not retain ctx after the method returns.

type AggressorPayloadStoreProviderFunc

type AggressorPayloadStoreProviderFunc = opforimpl.AggressorPayloadStoreProviderFunc

AggressorPayloadStoreProviderFunc adapts a function to AggressorPayloadStoreProvider.

type AggressorPayloadStoreRequest

type AggressorPayloadStoreRequest = opforimpl.AggressorPayloadStoreRequest

AggressorPayloadStoreRequest is one resolved request against the importer's Cobalt Payload Store. RuntimeID, Script, and Span identify the call site.

Arguments contains an exact positional snapshot:

  • payloadstore_add: name, payload type, artifact type, architecture, payload bytes, then an optional information hash
  • payloadstore_fetch/payloadstore_metadata/payloadstore_remove: ID or name
  • payloadstore_list: no positions

The slice is detached from Invocation, while every Value is resolved once without coercion or cloning. Optional-position presence and compound identity are therefore preserved exactly.

type AggressorPopupComposer

type AggressorPopupComposer = opforimpl.AggressorPopupComposer

AggressorPopupComposer is the restricted script capability attached to a show_popup or menubar request. Compose invokes, in registration order, the exact set of popup registrations selected when the request ran. A show_popup composer supplies that request's component as every popup binding's $1; a menubar composer invokes each popup without positional arguments. It exposes neither the Runtime nor arbitrary binding lookup, arguments, or retargeting.

A composer may be retained and invoked after HandleAggressorClientUI returns. It remains jointly owned by the show_popup caller and every selected popup binding. Compose returns ErrAggressorPopupStale without intentionally invoking a partial set when that captured generation has been cleared or unloaded. Compose may synchronously reenter HandleAggressorClientUI for a separator declared by a selected popup, so providers must not hold a non-reentrant lock while calling it. The supplied context controls the callback invocation and must not be retained after Compose returns.

type AggressorPreferenceOperation

type AggressorPreferenceOperation = opforimpl.AggressorPreferenceOperation

AggressorPreferenceOperation identifies one documented Cobalt preference query or mutation. The string values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorPreferenceProvider

type AggressorPreferenceProvider = opforimpl.AggressorPreferenceProvider

AggressorPreferenceProvider supplies the importer-owned Cobalt preference store. HandleAggressorPreference is called synchronously exactly once for every valid invocation when a provider is installed. A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host because a preference mutation may already have taken effect.

For pref_get and pref_get_list, OPFOR transfers the successful returned Value directly to script code without coercion, validation, cloning, or serialization. This preserves an array returned by pref_get_list as the provider's exact array identity. For pref_set and pref_set_list, the public reference documents only a side effect; OPFOR discards the provider result and returns $null.

Missing-key behavior for pref_get_list, preference persistence, concurrent update ordering, and whether returned arrays are live store views are not defined by the public reference and remain provider-owned. Implementations may be called concurrently and should observe ctx. They may retain request Values subject to the capability lifetime above, but must not retain ctx after HandleAggressorPreference returns.

type AggressorPreferenceProviderFunc

type AggressorPreferenceProviderFunc = opforimpl.AggressorPreferenceProviderFunc

AggressorPreferenceProviderFunc adapts a function to AggressorPreferenceProvider.

type AggressorPreferenceRequest

type AggressorPreferenceRequest = opforimpl.AggressorPreferenceRequest

AggressorPreferenceRequest is one resolved request for Cobalt's preference store. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime.

PreferenceName is the exact resolved first argument. DefaultValue is the exact resolved second argument for pref_get and $null for the other three operations. PreferenceValue is the exact resolved second argument for pref_set and pref_set_list and $null for both query operations. No field is coerced or cloned. In particular, the pref_set_list array retains its normal reference identity, so a provider retaining the request also retains that mutable capability.

The current public function reference specifies these shapes:

  • pref_get: preference name and default value
  • pref_get_list: preference name
  • pref_set: preference name and preference value
  • pref_set_list: preference name and an array of preference values

The reference does not specify whether names and scalar values are coerced before Cobalt's store sees them. OPFOR therefore transfers their resolved Values unchanged. It enforces only the documented arities and the explicit array requirement for pref_set_list.

type AggressorProcessInjectionOperation

type AggressorProcessInjectionOperation = opforimpl.AggressorProcessInjectionOperation

AggressorProcessInjectionOperation identifies one documented process- injection selection or inventory operation. String values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorProcessInjectionProvider

type AggressorProcessInjectionProvider = opforimpl.AggressorProcessInjectionProvider

AggressorProcessInjectionProvider supplies Cobalt's built-in and user-defined process-injection inventories and active selections. OPFOR calls HandleAggressorProcessInjection synchronously exactly once for each valid invocation when a provider is configured.

Successful query results are transferred directly to script code without coercion, validation, or cloning. The public reference describes strings for active selections, arrays for available-name queries, maps for user-defined inventory queries, and $null when no user-defined selection is active. OPFOR deliberately leaves those concrete result policies to the importer. Set and clear operations are documented only as effects, so their provider result is discarded and the script receives $null.

A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host because a selection mutation may already have taken effect. Implementations may be called concurrently and should observe ctx. They may retain SelectionName subject to its ordinary Value capability lifetime, but must not retain ctx after this method returns.

type AggressorProcessInjectionProviderFunc

type AggressorProcessInjectionProviderFunc = opforimpl.AggressorProcessInjectionProviderFunc

AggressorProcessInjectionProviderFunc adapts a function to AggressorProcessInjectionProvider.

type AggressorProcessInjectionRequest

type AggressorProcessInjectionRequest = opforimpl.AggressorProcessInjectionRequest

AggressorProcessInjectionRequest is one resolved request for Cobalt's process-injection configuration. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

SelectionName is populated only for pi_explicit_set, pi_spawn_set, pi_user_explicit_set, and pi_user_spawn_set. It is resolved exactly once and transferred without coercion or cloning. Although the public reference describes a string name, it does not document Cobalt's coercion behavior; importers may therefore enforce their own accepted representation.

type AggressorProfileOperation

type AggressorProfileOperation = opforimpl.AggressorProfileOperation

AggressorProfileOperation identifies one operation backed by Team Server configuration or the active Malleable C2 profile. String values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorProfileProvider

type AggressorProfileProvider = opforimpl.AggressorProfileProvider

AggressorProfileProvider supplies the connected Team Server kill date and Malleable C2 payload transformations. OPFOR calls HandleAggressorProfile synchronously exactly once for each valid invocation when a provider is configured. Its successful returned Value is transferred directly to script code without coercion, validation, or cloning.

A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host because a provider may already have done work. Implementations may be called concurrently and should observe ctx. A provider may retain request Values subject to the capability lifetime above, but must not retain ctx after HandleAggressorProfile returns.

type AggressorProfileProviderFunc

type AggressorProfileProviderFunc = opforimpl.AggressorProfileProviderFunc

AggressorProfileProviderFunc adapts a function to AggressorProfileProvider.

type AggressorProfileRequest

type AggressorProfileRequest = opforimpl.AggressorProfileRequest

AggressorProfileRequest is one resolved Team Server/profile request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime.

Payload is populated for setup_strings and setup_transformations. Architecture is additionally populated for setup_transformations. Values are resolved exactly once before the provider call. Scalars are immutable, while compound, binary, function, and object Values retain their ordinary identity and provenance. A provider which retains a request therefore also retains capabilities reachable through those Values and should snapshot or detach them when that lifetime is undesirable.

type AggressorPromptID

type AggressorPromptID = opforimpl.AggressorPromptID

AggressorPromptID identifies one prompt within its originating Runtime.

type AggressorPromptKind

type AggressorPromptKind = opforimpl.AggressorPromptKind

AggressorPromptKind identifies one documented prompt_* UI contract.

type AggressorPromptPresentation

type AggressorPromptPresentation = opforimpl.AggressorPromptPresentation

AggressorPromptPresentation is one resolved prompt request. Confirm sets Text and Title; text sets Text and Default; directory/file-open set Title, Default, and Multiple; file-save sets Default. Multiple retains the exact third argument of directory/file-open prompts and AllowMultiple is its Sleep truth value. Default retains its Value identity. Fields absent for a Kind are $null/false/empty and their Has* flag is false.

type AggressorPromptProvider

type AggressorPromptProvider = opforimpl.AggressorPromptProvider

AggressorPromptProvider presents prompt_* requests. It may answer synchronously or retain responder. A provider error is authoritative for the prompt_* call and does not fall back to Host, but cannot undo an Accept or Dismiss which already won; providers should normally return nil after a successful response. Implementations may be called concurrently and must not retain ctx after this method returns.

type AggressorPromptProviderFunc

type AggressorPromptProviderFunc = opforimpl.AggressorPromptProviderFunc

AggressorPromptProviderFunc adapts a function to AggressorPromptProvider.

type AggressorPromptResponder

type AggressorPromptResponder = opforimpl.AggressorPromptResponder

AggressorPromptResponder is the one-shot capability paired with a prompt. OPFOR provisionally makes Confirm accept zero Values because the public reference does not specify its callback arity. Text, directory-open, file-open, and file-save accept exactly one Value, which becomes callback $1 without coercion. A compatible multi-selection provider should encode its selection as the documented comma-separated scalar; OPFOR deliberately does not manufacture or validate that representation. Dismiss closes the prompt without invoking the callback. A validated Accept consumes the responder even when its callback returns an error. Done has the same terminal lifecycle contract as AggressorDialogResponder.Done. Accept uses the same synchronous shared-budget versus retained fresh-budget policy as Activate and checks its caller context before responder state.

type AggressorSessionQuery

type AggressorSessionQuery = opforimpl.AggressorSessionQuery

AggressorSessionQuery is one resolved read-only Beacon/session metadata request. Name is the exact normalized Aggressor name, including whether a script used bdata/beacon_data or binfo/beacon_info. Kind is the canonical operation shared by aliases.

RuntimeID is the nonzero process-local identity of the originating runtime; that field alone does not expose or retain a *Runtime. Script and Span identify the call site. SessionID and Key are resolved Value snapshots observed exactly once before the provider is called. They are $null for operations whose documented ABI omits them. Scalars are immutable, while compound Values deliberately retain their mutable reference identity; the documented metadata functions accept scalar IDs and do not cause OPFOR to expand an array-valued SessionID. A provider which retains the whole query also retains any capability-bearing function, object, or nested compound graph supplied in those Value fields; snapshot their scalar coercions instead when that lifetime is undesirable.

type AggressorSessionQueryKind

type AggressorSessionQueryKind = opforimpl.AggressorSessionQueryKind

AggressorSessionQueryKind identifies one canonical Beacon/session metadata query. Legacy and current aliases share a Kind while Name retains the exact Aggressor function spelling used by the script.

type AggressorSessionQueryProvider

type AggressorSessionQueryProvider = opforimpl.AggressorSessionQueryProvider

AggressorSessionQueryProvider supplies the Cobalt-owned data for the native Beacon/session metadata wrappers. QueryAggressorSession is called once for a successful wrapper invocation. Returning an error rejects that invocation with a $null result; OPFOR never retries it through Host.

The documented return shapes are an array for beacons and beacon_ids, a hash for bdata/beacon_data, and a string for binfo/beacon_info and barch. OPFOR returns those provider Values without coercion or validation, except that it normalizes the five predicate results through Sleep truthiness and maps a null or empty barch result to the documented x86 fallback. A provider owns compatibility for missing IDs/keys and other Cobalt-specific edge cases.

A compound Value returned by the provider is transferred directly to the script and may be mutated or retained there. Providers must therefore return a fresh, detached array/hash graph whenever their backing data must remain isolated. Implementations may be called concurrently and should observe ctx.

type AggressorSessionQueryProviderFunc

type AggressorSessionQueryProviderFunc = opforimpl.AggressorSessionQueryProviderFunc

AggressorSessionQueryProviderFunc adapts a function to AggressorSessionQueryProvider.

type AggressorSiteKind

type AggressorSiteKind = opforimpl.AggressorSiteKind

AggressorSiteKind identifies one Team Server site-delivery operation. The string values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorSiteProvider

type AggressorSiteProvider = opforimpl.AggressorSiteProvider

AggressorSiteProvider supplies Team Server site-delivery queries and effects. HandleAggressorSite is called synchronously exactly once for each valid invocation when a provider is installed. LocalIP is a read-only query whose documented result is the Team Server IP. List is a read-only query whose documented result is an array of site dictionaries. Host creates or replaces hosted content and its documented result is the hosted URL. Kill removes hosted content; the current official entry has no Returns section, so OPFOR models it as an effect whose successful script result is $null.

OPFOR transfers successful LocalIP, List, and Host provider Values directly to the script without coercion, validation, or cloning. A successful Kill provider Value is discarded and the wrapper returns $null. A returned error rejects the invocation with a $null result and is authoritative: OPFOR never retries through Host, because Host or Kill may already have performed an effect. Compound query/host results remain provider-owned references, so providers should return detached graphs when script mutation must not affect backing state.

Implementations may be called concurrently and should observe ctx. The configured provider is Runtime-owned and may be shared with inherited child runtimes. The call itself is lifecycle-neutral: OPFOR does not retain the request or context beyond the synchronous call, although an importer may retain request Values subject to the capability lifetime described above. A provider must not retain ctx after HandleAggressorSite returns.

type AggressorSiteProviderFunc

type AggressorSiteProviderFunc = opforimpl.AggressorSiteProviderFunc

AggressorSiteProviderFunc adapts a function to AggressorSiteProvider.

type AggressorSiteRequest

type AggressorSiteRequest = opforimpl.AggressorSiteRequest

AggressorSiteRequest is one resolved Team Server site-delivery request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime. Bindings is the opaque callback capability for that exact Runtime; retaining it retains the Runtime but does not expose its evaluator or binding registry.

Host, Port, URI, Content, MIMEType, Description, and SSL are populated only where the corresponding Aggressor contract supplies them. Every Value is resolved exactly once before the provider call. Scalars are immutable, while binary provenance and compound/object/function reference identity are retained. A provider which retains a request therefore also retains any capabilities reachable through those Values and should snapshot or detach them when that lifetime is undesirable.

site_host accepts both the six-argument form used by the pinned official 3.7 examples and the current seven-argument contract. HasSSL distinguishes an omitted seventh argument from an explicitly supplied $null. SSL retains the exact supplied Value and SSLTruth records its Sleep truth value; both are $null/false when the argument is omitted.

type AggressorTeamServerRPCCallback

type AggressorTeamServerRPCCallback = opforimpl.AggressorTeamServerRPCCallback

AggressorTeamServerRPCCallback is the response capability supplied by the second argument to call(...). Its zero value is safe and represents an explicit $null callback.

A valid callback is multi-shot. Respond always invokes the script callback with exactly two positional arguments: the original Command Value followed by the supplied response Value. It honors ctx and the creating Script's lifecycle.

type AggressorTeamServerRPCProvider

type AggressorTeamServerRPCProvider = opforimpl.AggressorTeamServerRPCProvider

AggressorTeamServerRPCProvider dispatches typed call(...) requests. OPFOR calls CallAggressorTeamServerRPC synchronously exactly once for each valid invocation when a provider is configured. A nil error means the request was accepted; the native wrapper then returns $null. Returning an error rejects the invocation and is authoritative: OPFOR never retries through Host, because doing so could duplicate a Team Server effect.

Implementations may be called concurrently and should observe ctx. A provider may retain Request Values and Callback subject to the documented capability lifetimes, but must not retain ctx after this method returns.

type AggressorTeamServerRPCProviderFunc

type AggressorTeamServerRPCProviderFunc = opforimpl.AggressorTeamServerRPCProviderFunc

AggressorTeamServerRPCProviderFunc adapts a function to AggressorTeamServerRPCProvider.

type AggressorTeamServerRPCRequest

type AggressorTeamServerRPCRequest = opforimpl.AggressorTeamServerRPCRequest

AggressorTeamServerRPCRequest is one resolved call(...) request to the Cobalt Strike Team Server. Name is the exact normalized Aggressor function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime.

Command is the first call argument. Arguments contains the third and later arguments in source order; the second argument is represented by Callback. The wrapper resolves every source argument exactly once and detaches the top-level Arguments slice, so no pass-by-name Cell or Invocation crosses the typed boundary. Values are otherwise unmodified: binary provenance and compound/object/function reference identity are retained. Providers which retain a request also retain capabilities reachable through those Values and should snapshot or detach them when that lifetime is undesirable.

Callback is invalid when the script supplied $null. A valid callback is a retained, script-owned, multi-shot response capability. It rejects responses after the creating Script generation retires, its Script unloads, or its Runtime closes.

type AggressorVPNOperation

type AggressorVPNOperation = opforimpl.AggressorVPNOperation

AggressorVPNOperation identifies one Covert VPN interface operation owned by the connected Team Server. String values are the exact Aggressor function names so they remain stable in importer logs and adapters.

type AggressorVPNProvider

type AggressorVPNProvider = opforimpl.AggressorVPNProvider

AggressorVPNProvider supplies Team Server Covert VPN interface inventory, metadata, creation, and deletion. OPFOR calls HandleAggressorVPN synchronously exactly once for each valid invocation when a provider is configured. vpn_interface_info and vpn_interfaces transfer the returned Value directly to script code; vpn_tap_create and vpn_tap_delete discard the result and return $null because their documented contract is side-effect only.

A returned error rejects the invocation with $null and is authoritative: OPFOR never retries through Host after a possible Team Server effect. Implementations may be called concurrently and should observe ctx. A provider may retain request Values subject to the capability lifetime above, but must not retain ctx after HandleAggressorVPN returns.

type AggressorVPNProviderFunc

type AggressorVPNProviderFunc = opforimpl.AggressorVPNProviderFunc

AggressorVPNProviderFunc adapts a function to AggressorVPNProvider.

type AggressorVPNRequest

type AggressorVPNRequest = opforimpl.AggressorVPNRequest

AggressorVPNRequest is one resolved Covert VPN request. Name is the exact normalized function spelling used by the script. RuntimeID is the nonzero process-local identity of the originating Runtime; Script and Span identify the call site without exposing a *Runtime.

Interface is populated for interface-info, create, and delete requests. An interface-info request optionally populates Key and HasKey. A create request additionally populates MACAddress, Reserved, Port, and Channel. Values are resolved exactly once. Scalars are immutable, while compound, object, binary, and function Values retain their ordinary identity and provenance. Providers which retain a request therefore retain any capabilities reachable through those Values and should snapshot or detach them when appropriate.

type Argument

type Argument = opforimpl.Argument

Argument preserves the distinctions between ordinary, named, and pass-by-name Sleep arguments. When Reference is non-nil (including an ordinary bare variable argument), Resolve observes the referenced cell's current value and Set mutates the caller's scalar.

Reference is an intentionally low-level capability for trusted importer code. Retaining it after the Host call also retains direct mutation access; unlike Invocation.Callback, a raw *Cell is not revoked when its Script unloads. Importers which do not need pass-by-name mutation should snapshot with Resolve instead of retaining Reference.

type Array

type Array = opforimpl.Array

Array is Sleep's mutable, reference-identity array container.

func NewArray

func NewArray(values ...Value) *Array

NewArray returns a mutable array containing values in argument order.

func NewReadOnlyArray

func NewReadOnlyArray(values ...Value) *Array

NewReadOnlyArray returns an array whose elements can be inspected and iterated but whose structure and indexed values cannot be changed.

type BOFPackByteOrder

type BOFPackByteOrder = opforimpl.BOFPackByteOrder

BOFPackByteOrder selects the byte order used by bof_pack for field-length headers and numeric values. It does not affect the UTF-16LE code units in Z payloads or add an outer argument-buffer length prefix.

type BeaconStringEncoder

type BeaconStringEncoder = opforimpl.BeaconStringEncoder

BeaconStringEncoder converts a Sleep string for the documented bof_pack z format. BeaconID identifies the target session whose configured character set an importer may consult. Text retains OPFOR's Value representation so an adapter can distinguish binary provenance when its policy requires it.

The encoder returns only the encoded text bytes. OPFOR treats the first NUL byte as the C-string terminator, then appends the canonical NUL and writes the field length in the runtime-selected byte order. The pure-Go default is UTF-8. Calls are synchronous and may occur concurrently. Implementations should observe ctx and must not retain it after returning. OPFOR copies the returned byte contents into the BOF argument buffer before EncodeBeaconString returns to script code and does not retain the returned slice.

type BeaconStringEncoderFunc

type BeaconStringEncoderFunc = opforimpl.BeaconStringEncoderFunc

BeaconStringEncoderFunc adapts a function to BeaconStringEncoder.

type Binding

type Binding = opforimpl.Binding

Binding describes a script-owned function, event, command, alias, hook, or UI registration. Callback becomes invalid when the owning script unloads.

type BindingInvocation

type BindingInvocation = opforimpl.BindingInvocation

BindingInvocation describes the parent composition invocation in which a nested popup, menu, or item was registered. Parent forms a snapshot chain for nested menus; Arguments are copied when the invocation begins.

type BindingKind

type BindingKind = opforimpl.BindingKind

BindingKind identifies an Aggressor/Sleep environment registration.

type BindingLifetime

type BindingLifetime = opforimpl.BindingLifetime

BindingLifetime controls how long an event registration remains active. The zero value is persistent so existing importers and bindings retain their previous lifecycle unless they explicitly opt in to one-shot behavior.

type BindingObserver

type BindingObserver = opforimpl.BindingObserver

BindingObserver optionally receives registration lifecycle notifications. Notifications are synchronous but may occur concurrently for independent script executions, so implementations must provide their own synchronization, should observe ctx, and must not retain ctx after returning. A Runtime's internal registries remain authoritative even when no observer is configured.

Registered runs after the binding is published. Returning an error removes that binding and rejects its declaration; OPFOR does not send a compensating Unregistered notification for that rollback. Unregistered runs after the authoritative removal. Its error is reported by the operation performing teardown but cannot restore the binding.

Binding slices and parent metadata are detached snapshots which may be retained or mutated by the observer. Compound Values preserve reference identity, while Callback and Predicate remain script-owned capabilities and reject invocation after their owning execution generation retires or their Script unloads.

type BindingSelector

type BindingSelector = opforimpl.BindingSelector

BindingSelector retains one declaration selector in source order. Raw is the exact source spelling. Evaluated reports whether Value was evaluated by Sleep at registration time; filter parameters and predicate conditions are deliberately not evaluated while binding.

type Callable

type Callable = opforimpl.Callable

Callable is a function value that can be invoked by OPFOR or by an importer. Script closures and Go-native callbacks both implement this interface.

Invoke is synchronous and may be called concurrently by independent script executions. Implementations should observe ctx and must not retain it after returning; asynchronous work should use a context whose lifetime is owned by its caller. The argument slice is borrowed for the duration of Invoke. Values may be copied, but arrays, hashes, functions, and objects preserve reference identity and therefore remain shared with the caller. A returned error is authoritative and is propagated by OPFOR.

FunctionValue does not add a script lifecycle guard to an arbitrary Callable. Importers that retain a script callback should obtain it through Invocation.Callback or Invocation.RetainCallback so calls after unload are rejected with ErrScriptUnloaded.

type CallableFunc

type CallableFunc = opforimpl.CallableFunc

CallableFunc adapts a function to Callable.

Example
package main

import (
	"context"
	"fmt"

	"github.com/sliverarmory/opfor"
)

func main() {
	callback := opfor.CallableFunc(func(_ context.Context, values ...opfor.Value) (opfor.Value, error) {
		return opfor.String("hello " + values[0].String()), nil
	})
	runtime, err := opfor.New(opfor.WithInitialGlobals(map[string]opfor.Value{
		"greeter": opfor.FunctionValue(callback),
	}))
	if err != nil {
		panic(err)
	}
	defer runtime.Close(context.Background())

	result, err := runtime.Eval(context.Background(), "callback.sl", `[$greeter: "operator"]`)
	if err != nil {
		panic(err)
	}
	fmt.Println(result.String())
}
Output:
hello operator

type Cell

type Cell = opforimpl.Cell

Cell is a mutable scalar slot. It is exported for host adapters that need to honor Sleep pass-by-name arguments while keeping mutation synchronized.

func NewCell

func NewCell(value Value) *Cell

NewCell returns a mutable cell initialized to value.

type Clock

type Clock = opforimpl.Clock

Clock supplies wall-clock time to portable time/date functions. A configured Clock is Runtime-owned, is shared with source-backed ScriptLoader children, and may be called concurrently; implementations must provide any required synchronization.

type ClockFunc

type ClockFunc = opforimpl.ClockFunc

ClockFunc adapts a function to Clock.

type CompileError

type CompileError = opforimpl.CompileError

CompileError groups all lexer, parser, and compiler diagnostics produced for one source. Callers can use errors.As to inspect Diagnostics.

type CompileOption

type CompileOption = opforimpl.CompileOption

CompileOption configures source compilation. It is a closed functional-option type; external packages should use the exported With* constructors.

func WithCompatibilityWarnings

func WithCompatibilityWarnings() CompileOption

WithCompatibilityWarnings reports accepted omitted commas and semicolons as warnings while retaining compatibility-mode parsing.

func WithCompileEnvironment

func WithCompileEnvironment(keyword string, kind EnvironmentKind) CompileOption

WithCompileEnvironment registers an importer-defined environment keyword for one standalone Compile call. Importers that own a Runtime will normally use WithEnvironment with Runtime.Compile instead.

func WithStrictSyntax

func WithStrictSyntax() CompileOption

WithStrictSyntax requires documented comma and semicolon separators instead of accepting the reference runtime's legacy omissions.

type ConsoleInvocation

type ConsoleInvocation = opforimpl.ConsoleInvocation

ConsoleInvocation describes one user-entered command line dispatched to a command, alias, or ssh_alias binding. RawInput is the complete line as typed, including Name.

ParsedArguments optionally supplies importer-parsed positional arguments, excluding Name. Nil preserves RawInput parsing, including quote and command name validation and the legacy treatment of empty RawInput as Name with no arguments. A non-nil slice is used exactly as supplied; in particular, an empty slice means no arguments, whitespace, empty strings, and literal double quotes are preserved without reparsing RawInput, and RawInput is passed to $0 byte-for-byte even when empty.

Command callbacks receive the unmodified RawInput in $0 and parsed arguments in $1 onward. Alias and ssh_alias callbacks additionally receive SessionID in $1, with parsed arguments beginning at $2. In both cases, @_ contains only the positional values and does not contain $0.

type Diagnostic

type Diagnostic = source.Diagnostic

Diagnostic describes a problem associated with a source span.

type EnvironmentKind

type EnvironmentKind = opforimpl.EnvironmentKind

EnvironmentKind selects one of Sleep's three environment bridge ABIs. Importer-defined predicate environments must be registered before compilation because their parenthesized condition would otherwise parse as an ordinary function call followed by a block.

type FileSourceResolver

type FileSourceResolver = opforimpl.FileSourceResolver

FileSourceResolver implements Sleep's ordinary file include form and its two-argument directory/JAR form. Relative paths are rooted at the resolver's base directory; it does not mutate the process working directory.

func NewFileSourceResolver

func NewFileSourceResolver(baseDirectory string) (*FileSourceResolver, error)

NewFileSourceResolver constructs a filesystem resolver. An empty base uses the process working directory at construction time. JAR and ZIP containers are read with Go's archive/zip package and do not require Java or CGO.

type Hash

type Hash = opforimpl.Hash

Hash is Sleep's string-keyed dictionary container. Ordinary hashes reproduce Sleep 2.1's deterministic Java 7 HashMap traversal; ordered hashes preserve insertion order. NewReadOnlyHash models Sleep's MapWrapper boundary.

func NewAccessOrderedHash

func NewAccessOrderedHash() *Hash

NewAccessOrderedHash creates Sleep's access-ordered hash variant (ohasha). Reading or replacing an existing entry moves it to the end of iteration order. Script-level miss and removal policies are installed separately.

func NewHash

func NewHash() *Hash

NewHash creates an ordinary hash with Sleep-compatible key traversal order.

func NewOrderedHash

func NewOrderedHash() *Hash

NewOrderedHash creates Sleep's insertion-ordered hash variant (ohash).

func NewReadOnlyHash

func NewReadOnlyHash(values map[string]Value) *Hash

NewReadOnlyHash returns a deterministic detached map wrapper. Keys and values can be inspected and iterated, while indexed writes affect only a detached scalar and structural removals are rejected. Input values are copied into the new hash in lexical key order.

type Host

type Host = opforimpl.Host

Host receives calls for Aggressor functions that are not implemented by the portable runtime. It is the primary importer boundary for Cobalt, UI, data-model, session-tasking, payload, network, and other application-defined effects. Installed portable functions, including file and process builtins, do not cross this boundary.

Call is synchronous and may run concurrently for independent executions. Implementations should observe ctx and must not retain it after returning. An Invocation may be retained subject to its documented trusted-capability ownership. OPFOR transfers a successful returned Value directly to script code, so compound results remain shared with the importer. A returned error is authoritative and is not retried through another Host.

type HostFunc

type HostFunc = opforimpl.HostFunc

HostFunc adapts a function to Host.

type IncludeCycleError

type IncludeCycleError = opforimpl.IncludeCycleError

IncludeCycleError reports the source chain that attempted to recurse.

type IncludeCyclePolicy

type IncludeCyclePolicy = opforimpl.IncludeCyclePolicy

IncludeCyclePolicy controls how include handles a source that is already in the active include chain.

type Invocation

type Invocation = opforimpl.Invocation

Invocation describes one script-to-host or script-to-native function call. Runtime is the trusted originating Runtime and Arguments may contain live pass-by-name Cell capabilities as documented by Argument. Retaining either after the call therefore retains the corresponding capability; use Values and Callback when a detached top-level value snapshot or lifecycle-bound function is sufficient. Compound Values retain their ordinary reference identity.

type Iterator

type Iterator = opforimpl.Iterator

Iterator adapts an importer-owned opaque object to Sleep's java.util.Iterator boundary. Next returns the next scalar and whether one was present. Returning present=false exhausts the iterator. The runtime supplies the active execution context so blocking implementations remain cancelable.

Values implementing Iterator may be wrapped with ObjectValue and used by foreach as well as iterator-consuming builtins such as map, reduce, and sum.

type IteratorFunc

type IteratorFunc = opforimpl.IteratorFunc

IteratorFunc adapts a function to a read-only Iterator.

type Kind

type Kind = opforimpl.Kind

Kind identifies the value category stored in a Sleep scalar.

type LimitError

type LimitError = opforimpl.LimitError

LimitError describes a runtime resource quota violation. Resource is one of the exported LimitResource* constants.

type Limits

type Limits = opforimpl.Limits

Limits configures resource bounds for one Runtime family. Zero disables an individual bound. Instruction accounting resets for each top-level execution or callback; the other counters are monotonic and shared by root scripts, forks, and source-backed ScriptLoader child runtimes for the family's lifetime. Monotonic accounting deliberately does not refund on unload or close because importers may still retain values and handles.

type LoadableBridge

type LoadableBridge = opforimpl.LoadableBridge

LoadableBridge is a pure-Go counterpart to sleep.interfaces.Loadable. A resolved bridge instance is cached for one source/class pair in one Script. ScriptLoaded is called for every matching use() invocation. ScriptUnloaded is paired with every begun ScriptLoaded call, in reverse order, when the owning portable ScriptLoader generation retires or the Script terminally unloads. Repeated use() calls may invoke ScriptLoaded concurrently, including for the same bridge and Script. ScriptUnloaded callbacks run only after active calls in their generation finish and are delivered sequentially. Implementations must be concurrency-safe and should observe ctx, but must not retain ctx after either callback returns.

ScriptLoaded may install script-scoped functions with Script.RegisterFunction. Those functions are automatically revoked when the creating generation retires or the Script unloads. During logical ScriptLoader cleanup the supplied *Script remains active because its raw Sleep state survives; the generation-owned functions and opaque callbacks do not. A retained raw *Script is trusted authority, not a restricted generation capability.

type LoadableBridgeFuncs

type LoadableBridgeFuncs = opforimpl.LoadableBridgeFuncs

LoadableBridgeFuncs adapts optional functions to LoadableBridge. A nil function is a no-op.

type LoadableProvider

type LoadableProvider = opforimpl.LoadableProvider

LoadableProvider resolves Java Loadable class identities to pure-Go bridge instances. ResolveLoadable is called at most once concurrently for a given source/class pair in one Script; failures are not cached. A successful bridge is script-local even when the same Provider instance serves several scripts. Different identities and scripts may be resolved concurrently. The call is synchronous; implementations should observe ctx and must not retain it after returning. The detached LoadableRequest may be retained.

UnsupportedError explicitly declines one identity and continues to OPFOR's canonical fixture/Host fallback. Other provider errors become Sleep's checkError() soft-error state, matching use(). Context cancellation and runtime/script closure remain hard execution errors.

type LoadableProviderFunc

type LoadableProviderFunc = opforimpl.LoadableProviderFunc

LoadableProviderFunc adapts a function to LoadableProvider.

type LoadableRequest

type LoadableRequest = opforimpl.LoadableRequest

LoadableRequest identifies one Java Loadable class requested through Sleep's use() function. ClassName is always resolved from a string or class literal. Source is the original JAR/directory spelling supplied by the script, while ResolvedSource is the filesystem path checked by OPFOR. Both source fields are empty for class-only use(^Bridge) calls.

type MutableIterator

type MutableIterator = opforimpl.MutableIterator

MutableIterator is an Iterator whose current element can be removed by Sleep's zero-argument remove() while a foreach loop is active. Remove must follow the same state rules as java.util.Iterator.remove.

type NativeFunc

type NativeFunc = opforimpl.NativeFunc

NativeFunc implements a Sleep function in Go. Calls are synchronous, may occur concurrently for independent script executions, and receive the active execution context. Implementations should observe ctx and must not retain it after returning; retain an Invocation callback and invoke it with a new caller-owned context for asynchronous work. Returned compound Values are shared with script code rather than cloned. Returned errors propagate unless a directly returned ErrUnsafeArrayView, ErrReadOnlyArray, or ErrReadOnlyHash is translated into Sleep's corresponding container warning behavior.

type ObjectHost

type ObjectHost = opforimpl.ObjectHost

ObjectHost implements Java-style construction, method/property dispatch, and type checks for pure-Go embeddings. Object calls are synchronous and may occur concurrently. Implementations should observe ctx and must not retain it after returning. Returned compound Values remain shared with script code. A returned UnsupportedError explicitly declines the request and permits OPFOR's portable object fallback; every other error is authoritative.

type ObjectHostFunc

type ObjectHostFunc = opforimpl.ObjectHostFunc

ObjectHostFunc adapts a function to ObjectHost.

type ObjectInvocation

type ObjectInvocation = opforimpl.ObjectInvocation

ObjectInvocation describes Java-style syntax delegated to an importer. The target is either an opaque object value or a class name, depending on Op. Runtime and any Argument.Reference values are trusted capabilities with the same retention rules as Invocation; Values and Callback provide the corresponding snapshot and lifecycle-bound helpers. Target and compound argument Values preserve reference identity.

type ObjectOperation

type ObjectOperation = opforimpl.ObjectOperation

ObjectOperation identifies a Sleep bracket-object request.

type Option

type Option = opforimpl.Option

Option configures a Runtime. It is a closed functional-option type: external packages should use the exported With* constructors rather than attempting to construct custom options against OPFOR's private runtime configuration.

func WithAggressorArtifactProvider

func WithAggressorArtifactProvider(provider AggressorArtifactProvider) Option

WithAggressorArtifactProvider installs the typed importer boundary for artifact_payload and artifact_stageless. Importer-defined WithFunction callbacks retain precedence over the native wrappers.

func WithAggressorBOFExtractor

func WithAggressorBOFExtractor(extractor AggressorBOFExtractor) Option

WithAggressorBOFExtractor installs the typed importer boundary for bof_extract. With no extractor, the native wrapper forwards the original reference-bearing Invocation to Host. Extractor errors are authoritative and never fall back to Host. Importer-defined WithFunction callbacks retain precedence over the native wrapper.

func WithAggressorBeaconActionProvider

func WithAggressorBeaconActionProvider(provider AggressorBeaconActionProvider) Option

WithAggressorBeaconActionProvider installs the typed importer boundary for the supported Beacon operational actions. Provider success is side-effect only; native wrappers return $null. Provider errors are authoritative and never fall back to Host. Importer-defined WithFunction callbacks retain precedence over the native wrappers.

func WithAggressorBeaconExecutionProvider

func WithAggressorBeaconExecutionProvider(provider AggressorBeaconExecutionProvider) Option

WithAggressorBeaconExecutionProvider installs the typed importer boundary for beacon_execute_job, beacon_execute_postex_job, beacon_inline_execute, beacon_inline_execute_pe, beacon_host_imported_script, beacon_host_script, and get_postex_kit_callback_id. Provider errors are authoritative and never fall back to Host. Importer-defined WithFunction callbacks retain precedence over all native wrappers.

func WithAggressorBeaconTechniqueCatalog

func WithAggressorBeaconTechniqueCatalog(kind AggressorBeaconTechniqueKind, catalog AggressorBeaconTechniqueCatalog) Option

WithAggressorBeaconTechniqueCatalog seeds an importer-owned base catalog for one technique kind. Script registrations layer over this immutable base and unloading a script reveals the preceding script or base entry. Supplying the option again for the same kind replaces the earlier base catalog.

The catalog is validated and defensively copied while New applies the option. Names must be non-empty and unique using exact case-sensitive comparison. Remote-exploit architectures must be exactly "x86" or "x64"; architecture is rejected for every other kind.

func WithAggressorBeaconTranscriptSink

func WithAggressorBeaconTranscriptSink(sink AggressorBeaconTranscriptSink) Option

WithAggressorBeaconTranscriptSink replaces the stock stdout presentation for berror, blog, blog2, binput, btask, btaskcompleted, bjoblog, and bjoberror. The sink is an importer integration boundary, not a serializer; OPFOR does not persist records or task a Beacon through this option.

func WithAggressorBreakpointProvider

func WithAggressorBreakpointProvider(provider AggressorBreakpointProvider) Option

WithAggressorBreakpointProvider installs the synchronous importer boundary for brk(). A nil or typed-nil provider is rejected. WithFunction("brk", ...) retains precedence regardless of option order.

func WithAggressorClientServiceProvider

func WithAggressorClientServiceProvider(provider AggressorClientServiceProvider) Option

WithAggressorClientServiceProvider installs the typed importer boundary for getAggressorClient, get_cs_version, mynick, users, action, elog, say, privmsg, custom_event, custom_event_private, closeClient, and sync_download. WithFunction overrides retain precedence over the native wrappers.

func WithAggressorClientUIProvider

func WithAggressorClientUIProvider(provider AggressorClientUIProvider) Option

WithAggressorClientUIProvider installs the typed importer boundary for client-owned tabs, visualizations, popups, menubar registration, navigation, clipboard, URLs, message presentation, documented open* windows, and client-side browser/menu component helpers. OPFOR never constructs Swing widgets. WithFunction overrides retain precedence over the native wrappers.

func WithAggressorCodeTransformProvider

func WithAggressorCodeTransformProvider(provider AggressorCodeTransformProvider) Option

WithAggressorCodeTransformProvider installs the typed importer boundary for encode, powershell_compress, and transform_vbs. A script-defined POWERSHELL_COMPRESS hook takes precedence over the provider for powershell_compress. Provider errors are authoritative and never fall back to Host. WithFunction overrides retain precedence over every native wrapper.

func WithAggressorCommandCatalog

func WithAggressorCommandCatalog(kind AggressorCommandKind, catalog AggressorCommandCatalog) Option

WithAggressorCommandCatalog seeds an importer-owned base help catalog for one console kind. Script registrations layer over this immutable base and unloading a script reveals the preceding script or base entry. Supplying the option again for the same kind replaces the earlier base catalog.

The catalog is validated and defensively copied while New applies the option. Command and group names must be non-empty, entries must be unique, group IDs may not contain ',' or '@', and command group references must identify a group in the same catalog.

func WithAggressorDataModelQueryProvider

func WithAggressorDataModelQueryProvider(provider AggressorDataModelQueryProvider) Option

WithAggressorDataModelQueryProvider installs the read-only importer boundary for data_keys, data_query, and pivots. Importer-defined WithFunction callbacks retain precedence over the native wrappers.

func WithAggressorDataStoreProvider

func WithAggressorDataStoreProvider(provider AggressorDataStoreProvider) Option

WithAggressorDataStoreProvider installs the typed importer boundary for the documented Cobalt application data-store functions. Provider errors are authoritative and never fall back to Host. Importer-defined WithFunction callbacks retain precedence over the native wrappers.

func WithAggressorDialogProvider

func WithAggressorDialogProvider(provider AggressorDialogProvider) Option

WithAggressorDialogProvider installs the typed importer boundary for the complete dialog, dbutton_*, and drow_* function family. WithFunction overrides retain precedence over native wrappers.

func WithAggressorEventDispatcher

func WithAggressorEventDispatcher(dispatcher AggressorEventDispatcher) Option

WithAggressorEventDispatcher replaces dispatch_event's scheduler. The dispatcher may invoke the retained callback synchronously or queue it for a UI/event loop. The supplied context preserves the importer's cancellation and deadline without being canceled merely because dispatch_event returns, and always hides OPFOR-private evaluator and lifecycle state. A callback invocation which begins before DispatchAggressorEvent returns shares the caller's instruction meter; a later queued invocation begins with a fresh top-level meter. The stock dispatcher alone runs synchronously with the live evaluator context so exit and other fiber-local control flow retain their normal semantics.

func WithAggressorListenerProvider

func WithAggressorListenerProvider(provider AggressorListenerProvider) Option

WithAggressorListenerProvider installs the typed importer boundary for the ten documented listener functions. Provider errors are authoritative and importer-defined WithFunction callbacks retain precedence.

func WithAggressorPEProvider

func WithAggressorPEProvider(provider AggressorPEProvider) Option

WithAggressorPEProvider installs the typed importer boundary for the documentation-complete Cobalt-owned PE helpers. WithFunction overrides retain precedence over these native wrappers.

func WithAggressorPayloadProvider

func WithAggressorPayloadProvider(provider AggressorPayloadProvider) Option

WithAggressorPayloadProvider installs the typed importer boundary for the documented payload, legacy artifact, and stager functions. The separate AggressorArtifactProvider remains the boundary for artifact_payload and artifact_stageless. Provider errors are authoritative; importer-defined WithFunction callbacks retain precedence over every native wrapper.

func WithAggressorPayloadStoreProvider

func WithAggressorPayloadStoreProvider(provider AggressorPayloadStoreProvider) Option

WithAggressorPayloadStoreProvider installs the typed importer boundary for the five documented payloadstore_* functions. Provider errors are authoritative and importer-defined WithFunction callbacks retain precedence.

func WithAggressorPreferenceProvider

func WithAggressorPreferenceProvider(provider AggressorPreferenceProvider) Option

WithAggressorPreferenceProvider installs the typed importer boundary for pref_get, pref_get_list, pref_set, and pref_set_list. Provider errors are authoritative and never fall back to Host. Importer-defined WithFunction callbacks retain precedence over the native wrappers.

func WithAggressorProcessInjectionProvider

func WithAggressorProcessInjectionProvider(provider AggressorProcessInjectionProvider) Option

WithAggressorProcessInjectionProvider installs the typed importer boundary for the documented pi_explicit_*, pi_spawn_*, pi_user_explicit_*, and pi_user_spawn_* functions. Provider errors are authoritative and never fall back to Host. WithFunction overrides retain precedence over the native wrappers.

func WithAggressorProfileProvider

func WithAggressorProfileProvider(provider AggressorProfileProvider) Option

WithAggressorProfileProvider installs the typed importer boundary for killdate, setup_strings, and setup_transformations. WithFunction overrides retain precedence over the native wrappers.

func WithAggressorPromptProvider

func WithAggressorPromptProvider(provider AggressorPromptProvider) Option

WithAggressorPromptProvider installs the typed importer boundary for all five documented prompt_* functions. WithFunction overrides retain precedence over native wrappers.

func WithAggressorSessionQueryProvider

func WithAggressorSessionQueryProvider(provider AggressorSessionQueryProvider) Option

WithAggressorSessionQueryProvider installs the read-only importer boundary for beacons, beacon_ids, bdata/beacon_data, binfo/beacon_info, barch, and the five documented session predicates. Importer-defined WithFunction callbacks retain precedence over the native wrappers.

func WithAggressorSiteProvider

func WithAggressorSiteProvider(provider AggressorSiteProvider) Option

WithAggressorSiteProvider installs the typed importer boundary for localip, site_host, site_kill, and sites. Provider errors are authoritative and never fall back to Host. Importer-defined WithFunction callbacks retain precedence over the native wrappers.

func WithAggressorTeamServerRPCProvider

func WithAggressorTeamServerRPCProvider(provider AggressorTeamServerRPCProvider) Option

WithAggressorTeamServerRPCProvider installs the typed importer boundary for call. Provider errors are authoritative and never fall back to Host. Importer-defined WithFunction callbacks retain precedence over the native wrapper.

func WithAggressorVPNProvider

func WithAggressorVPNProvider(provider AggressorVPNProvider) Option

WithAggressorVPNProvider installs the typed importer boundary for vpn_interface_info, vpn_interfaces, vpn_tap_create, and vpn_tap_delete. WithFunction overrides retain precedence over the native wrappers.

func WithBOFPackByteOrder

func WithBOFPackByteOrder(order BOFPackByteOrder) Option

WithBOFPackByteOrder selects bof_pack's field-header and numeric byte order. The default is BOFPackBigEndian. OPFOR never adds an outer buffer-length prefix; importers which require one remain responsible for adding it.

func WithBeaconStringEncoder

func WithBeaconStringEncoder(encoder BeaconStringEncoder) Option

WithBeaconStringEncoder replaces bof_pack's z-string encoder. This is the importer boundary for per-session character sets; Z remains UTF-16LE as required by the documented BOF ABI.

func WithBindingObserver

func WithBindingObserver(observer BindingObserver) Option

WithBindingObserver installs lifecycle notifications for declarations such as events, hooks, commands, aliases, and menus. Runtime registries remain authoritative when no observer is configured.

func WithClock

func WithClock(clock Clock) Option

WithClock replaces the wall clock used by portable time and date functions, including ticks, formatDate, parseDate, dstamp, and tstamp. Timestamp formatting uses the location returned by Clock.Now.

func WithDebugFlags

func WithDebugFlags(flags int32) Option

WithDebugFlags sets the initial Sleep debug bitmask for each newly loaded script. The reference runtime defaults to 1; scripts may subsequently change their own flags with debug(...). Fork children inherit their parent's current value rather than this default.

func WithEnvironment

func WithEnvironment(keyword string, kind EnvironmentKind) Option

WithEnvironment registers an importer-defined Sleep environment keyword and bridge form. Use Runtime.Compile or Runtime.CompileString so the registration is visible while parsing predicate and filter declarations.

func WithFunction

func WithFunction(name string, function NativeFunc) Option

WithFunction installs or replaces a Go-native function while constructing a Runtime. A leading ampersand is accepted. Importer functions take precedence over portable defaults with the same normalized name.

func WithHost

func WithHost(host Host) Option

WithHost installs the fallback for function calls that are not resolved to an importer-defined or portable native function. Aggressor implementations normally use this boundary for Cobalt-specific functions and predicates.

func WithIncludeCyclePolicy

func WithIncludeCyclePolicy(policy IncludeCyclePolicy) Option

WithIncludeCyclePolicy selects safe cycle rejection or Sleep-compatible recursive includes. Importers that enable IncludeCycleAllow should also set an instruction limit or cancelable execution context.

func WithInitialGlobals

func WithInitialGlobals(globals map[string]Value) Option

WithInitialGlobals installs importer-owned values into every independently loaded script before ScriptLifecycleObserver.ScriptLoaded and before the script's top-level body. The persistent Runtime.Eval session receives them once when it is first created. A name without a sigil is normalized to a scalar name (for example, "client" becomes "$client"). Names beginning with $, @, or % retain that sigil.

Scalar values are copied. Arrays, hashes, functions, and objects retain their reference identity, so reusing one Value intentionally shares its backing value across loaded scripts. Use ScriptLoaded to install a fresh container per script when sharing is not desired. The input map is copied before New returns and later map changes have no effect.

$__SCRIPT__, $__SCRIPT_NAME__, and @ARGV are reserved because the runtime defines them for each load. Duplicate normalized names and malformed names make New fail instead of silently choosing one value.

func WithInstructionLimit

func WithInstructionLimit(limit uint64) Option

WithInstructionLimit bounds the number of VM instructions consumed by one top-level execution or callback, including nested Sleep function calls. A limit of zero disables the quota. It is compatibility sugar for changing Limits.MaxInstructionsPerExecution without modifying other configured limits. Context cancellation remains independent.

func WithLimits

func WithLimits(limits Limits) Option

WithLimits replaces the complete resource-limit configuration. Zero fields are unlimited. Options are applied in order; a later WithInstructionLimit changes only MaxInstructionsPerExecution.

func WithLoadableProvider

func WithLoadableProvider(provider LoadableProvider) Option

WithLoadableProvider installs the typed importer boundary for Sleep use(). WithFunction("use", ...) retains precedence over this native wrapper. The provider follows source-backed portable ScriptLoader child runtimes.

func WithObjectHost

func WithObjectHost(host ObjectHost) Option

WithObjectHost installs the importer boundary for Java-style object syntax. The importer receives first refusal; when it returns UnsupportedError, OPFOR may handle its small portable java.lang scalar subset.

func WithScriptLifecycleObserver

func WithScriptLifecycleObserver(observer ScriptLifecycleObserver) Option

WithScriptLifecycleObserver installs per-script load and unload callbacks. Callback errors are returned by the operation that crossed the lifecycle boundary. The observer is inherited by source-backed portable ScriptLoader runtimes.

func WithScriptLoaderCache

func WithScriptLoaderCache(cache *ScriptLoaderCache) Option

WithScriptLoaderCache enables the explicit sharing capability used when a Sleep script calls ScriptLoader.setGlobalCache(true). The same cache may be supplied to multiple runtimes; without this option, enabling the upstream process-global cache remains an explicit unsupported operation.

func WithSleepClasspath

func WithSleepClasspath(classPath string) Option

WithSleepClasspath configures the semicolon- or colon-separated source and container search path used by include(...) and import ... from:. The option configures OPFOR's runtime-owned default FileSourceResolver and is intentionally incompatible with WithSourceResolver: importer-provided resolvers remain entirely importer-owned and may expose different lookup semantics.

func WithSourceResolver

func WithSourceResolver(resolver SourceResolver) Option

WithSourceResolver replaces the filesystem resolver used by include.

func WithStderr

func WithStderr(writer io.Writer) Option

WithStderr replaces the destination used by warn, compatibility warnings, runtime diagnostics, and call tracing.

func WithStdin

func WithStdin(reader io.Reader) Option

WithStdin replaces the input used by the portable console handle and as the standard input of commands started by Sleep process functions. OPFOR never closes this borrowed reader. A reader may additionally implement ReadContext(context.Context, []byte) (int, error) so Close and Script.Unload can cancel an in-flight asynchronous Sleep read. Without that method, an already-blocked Read cannot be interrupted in pure Go: teardown returns ErrReadCancellationUnsupported, and the pending Read may later consume and discard one result before its goroutine actually exits.

func WithStdout

func WithStdout(writer io.Writer) Option

WithStdout replaces the default destination used by print, println, and the portable console handle. Explicit Sleep I/O handles retain their own writer.

func WithTaintFunction

func WithTaintFunction(name string, function NativeFunc, policy TaintPolicy) Option

WithTaintFunction installs a native function and its taint classification.

func WithTaintMode

func WithTaintMode(enabled bool) Option

WithTaintMode enables or disables Sleep 2.1 compatible taint tracking for this Runtime. It is disabled by default and is isolated per Runtime.

func WithTaintPolicy

func WithTaintPolicy(name string, policy TaintPolicy) Option

WithTaintPolicy classifies a native or Host-resolved function. The name may include Sleep's leading ampersand. It may be combined with WithFunction or used for a function supplied by Host.

func WithVariableProvider

func WithVariableProvider(provider VariableProvider) Option

WithVariableProvider installs the typed variable-container boundary. The provider controls globals for ordinary scripts and supplies the local and internal factories used by closures, pushl, forks, and portable ScriptLoader child runtimes. WithInitialGlobals and runtime-reserved globals are installed into the provider container before top-level execution.

type PortableUtilityArgumentError

type PortableUtilityArgumentError = opforimpl.PortableUtilityArgumentError

PortableUtilityArgumentError identifies an argument that cannot be handled by one of OPFOR's pure-Go Aggressor utility functions. These errors describe OPFOR's independently specified safe boundaries; they do not claim the undocumented failure behavior of a licensed Cobalt Strike runtime.

type Position

type Position = source.Position

Position identifies a point in a Source. Offset is a zero-based byte offset; Line and Column are one-based.

type PredicateEvaluator

type PredicateEvaluator = opforimpl.PredicateEvaluator

PredicateEvaluator is a script-owned compiled predicate. Arguments become the predicate evaluation's $1... values and @_. Evaluators reject calls once their owning script unloads.

type PredicateEvaluatorFunc

type PredicateEvaluatorFunc = opforimpl.PredicateEvaluatorFunc

PredicateEvaluatorFunc adapts a function to PredicateEvaluator.

type ProfileStatisticSnapshot

type ProfileStatisticSnapshot = opforimpl.ProfileStatisticSnapshot

ProfileStatisticSnapshot is one detached profiler counter. Ticks are exclusive elapsed milliseconds, matching Sleep's ProfilerStatistic ticks; Calls is the number of completed calls recorded for FunctionName.

The JSON field names are part of OPFOR's controller-facing compatibility surface and are shared by the opfor serve profile response.

type Program

type Program = opforimpl.Program

Program is immutable compiled Sleep/Aggressor code. A Program may be loaded by multiple independent runtimes.

func Compile

func Compile(source Source, options ...CompileOption) (*Program, error)

Compile parses and compiles a named source unit.

func CompileString

func CompileString(name string, code string, options ...CompileOption) (*Program, error)

CompileString is a convenience wrapper around Compile.

type Runtime

type Runtime = opforimpl.Runtime

Runtime is an isolated OPFOR execution environment. A Runtime owns globals, loaded scripts, callbacks, and host registrations. Its registries and value containers are safe for concurrent external dispatch. A suspended closure resumes at most once; independent callbacks may execute concurrently.

func New

func New(options ...Option) (*Runtime, error)

New creates an OPFOR runtime. Console output defaults to os.Stdout, warnings and diagnostics to os.Stderr, and input to os.Stdin. The portable Sleep standard library includes live filesystem and process functions; Host is an extension boundary, not a sandbox for those builtins.

type RuntimeError

type RuntimeError = opforimpl.RuntimeError

RuntimeError attaches source and script context to a runtime failure.

type RuntimeID

type RuntimeID = opforimpl.RuntimeID

RuntimeID is a nonzero, process-local Runtime identity. IDs are allocated monotonically and are useful for distinguishing provenance from parent and ScriptLoader child runtimes whose Script IDs may overlap. They are not stable across process restarts and must not be used as durable identifiers.

type Script

type Script = opforimpl.Script

Script is one loaded program and its persistent globals and registrations. A Script remains usable until Unload is called.

type ScriptID

type ScriptID = opforimpl.ScriptID

ScriptID uniquely identifies one loaded script within a Runtime.

type ScriptLifecycleFuncs

type ScriptLifecycleFuncs = opforimpl.ScriptLifecycleFuncs

ScriptLifecycleFuncs adapts optional functions to ScriptLifecycleObserver. A nil function is a no-op.

type ScriptLifecycleObserver

type ScriptLifecycleObserver = opforimpl.ScriptLifecycleObserver

ScriptLifecycleObserver receives the load and unload boundary of each independently loaded script. ScriptLoaded runs after initial and runtime-owned globals are installed, but before the top-level body executes. It may inspect or mutate globals through Script.Get and Script.Set.

Once ScriptLoaded begins, ScriptUnloaded is called exactly once, including when ScriptLoaded itself fails, the top-level body fails, Execute completes, Script.Unload is called, or Runtime.Close unloads the script. Observers may be called concurrently for independent scripts and must be concurrency-safe. Runtime.Eval owns one persistent script: its first evaluation starts the lifecycle, later evaluations reuse it, and Runtime.Close ends it. ScriptUnloaded sees an inactive Script after runtime-owned resources and registrations have been revoked. Its globals remain readable for final-state inspection, while Script.Set and callback invocation return ErrScriptUnloaded. As with ordinary Go references, importer-retained mutable Values and raw Argument.Reference cells remain trusted capabilities and can still change their backing data; lifecycle revocation does not make shared Go objects immutable.

Sleep fork instances are not independent loads: they receive neither fresh initial globals nor lifecycle notifications. This matches Sleep 2.1, whose fork path creates an internal ScriptInstance without running ScriptLoader bridges. Source-backed portable ScriptLoader children are independent loads and inherit the parent runtime's observer.

type ScriptLoaderCache

type ScriptLoaderCache = opforimpl.ScriptLoaderCache

ScriptLoaderCache is an explicit, concurrency-safe shared compilation capability for Sleep ScriptLoader.setGlobalCache. Runtimes remain isolated unless an importer deliberately supplies the same cache to each of them. Cached Programs are immutable; loading one still creates independent script globals, callbacks, and lifecycle state.

func NewScriptLoaderCache

func NewScriptLoaderCache() *ScriptLoaderCache

NewScriptLoaderCache constructs an empty shared ScriptLoader compilation cache. Supplying it to more than one Runtime is the opt-in sharing boundary.

type ScriptProfileSnapshot

type ScriptProfileSnapshot = opforimpl.ScriptProfileSnapshot

ScriptProfileSnapshot is a detached, deterministically ordered profile for one exact loaded script. Mutating Statistics does not affect runtime state.

type Severity

type Severity = source.Severity

Severity is the severity of a source diagnostic.

type Source

type Source = source.Source

Source is a named unit of Sleep or Aggressor Script source code.

Data is interpreted as UTF-8 by the lexer. Positions use byte offsets and one-based line and column numbers.

func NewSource

func NewSource(name string, data []byte) Source

NewSource constructs a named source unit without copying data.

type SourceRequest

type SourceRequest = opforimpl.SourceRequest

SourceRequest describes a source requested by Sleep's include function. Name is the file or archive member named by the script. Container is empty for include("file.sl") and contains the first argument for the two-argument include("container", "member.sl") form. IncludingSource and Span identify the call site without exposing interpreter internals to an embedder.

type SourceResolver

type SourceResolver = opforimpl.SourceResolver

SourceResolver loads source for include. Implementations may resolve files, embedded assets, databases, archives, or application-owned virtual modules. ResolveSource is synchronous and may be called concurrently by independent script callbacks. Implementations should observe ctx and must not retain it after returning.

OPFOR copies Source.Data while compiling and does not retain the resolver's backing slice in a Program. That copy or ScriptLoader decoding occurs after ResolveSource returns, however, so the resolver must treat returned Data as immutable after return rather than immediately reusing or mutating its backing storage.

type SourceResolverFunc

type SourceResolverFunc = opforimpl.SourceResolverFunc

SourceResolverFunc adapts a function to SourceResolver.

type Span

type Span = source.Span

Span identifies an end-exclusive range in a Source.

type TaintPolicy

type TaintPolicy = opforimpl.TaintPolicy

TaintPolicy classifies a bridge using Sleep 2.1's taint contract. Functions are permeable unless explicitly classified: tainted input taints a scalar result. Sources always taint their result, sanitizers remove the top-level scalar marker, and sensitive functions reject tainted input.

type UnsupportedError

type UnsupportedError = opforimpl.UnsupportedError

UnsupportedError identifies a syntactically valid operation for which the active importer supplied no implementation.

type Value

type Value = opforimpl.Value

Value is OPFOR's host-facing representation of a Sleep scalar. Its zero value is the Sleep $null value. Scalar values copy by value; arrays, hashes, functions, and objects preserve reference identity.

func ArrayValue

func ArrayValue(v *Array) Value

ArrayValue wraps an array reference. A nil array becomes $null.

func BinaryString

func BinaryString(data []byte) Value

BinaryString returns a Sleep string whose code units are the unsigned values of data's bytes. The byte provenance is retained through concatenation, interpolation, slicing, and other string operations.

func Bool

func Bool(v bool) Value

Bool returns Sleep's canonical boolean representation: integer 1 for true and $null for false.

func Double

func Double(v float64) Value

Double returns a Sleep double-precision value.

func FunctionValue

func FunctionValue(v Callable) Value

FunctionValue wraps a callable reference. A nil callable becomes $null.

func HashValue

func HashValue(v *Hash) Value

HashValue wraps a hash reference. A nil hash becomes $null.

func Int

func Int(v int32) Value

Int returns a Sleep 32-bit integer value.

func Long

func Long(v int64) Value

Long returns a Sleep 64-bit integer value.

func Null

func Null() Value

Null returns Sleep's $null value.

func ObjectValue

func ObjectValue(v any) Value

ObjectValue wraps an opaque host object. A nil object becomes $null.

func String

func String(v string) Value

String returns a textual Sleep string. Valid UTF-8 is mapped to the same UTF-16 code units a Java String would contain. Invalid UTF-8 bytes retain the historical OPFOR byte-string behavior; new code with binary data should use BinaryString so valid UTF-8 byte sequences remain distinguishable from text.

type VariableAccess

type VariableAccess = opforimpl.VariableAccess

VariableAccess describes one normalized Sleep variable operation. Name always includes its $, @, or % sigil. RuntimeID, Script, and Span identify the originating execution without exposing a *Runtime or *Script.

type VariableContainer

type VariableContainer = opforimpl.VariableContainer

VariableContainer is the Go equivalent of Sleep's sleep.interfaces.Variable bridge. OPFOR deliberately passes *Cell rather than copying Values: an existing cell returned by GetScalar remains the exact assignment/reference target used by the interpreter.

ScalarExists is queried before GetScalar. If it returns true, GetScalar must return a non-nil *Cell. PutScalar must store the exact supplied *Cell; its return value is the previously stored cell, matching Sleep's putScalar ABI, and OPFOR otherwise ignores it. RemoveScalar removes only this container's binding.

CreateLocalVariableContainer and CreateInternalVariableContainer are invoked on the Script's global container, not on the currently active local or closure container. They must return fresh usable containers unless sharing is an intentional importer policy. A nil container without an error is a provider contract violation.

Calls are synchronous and errors are authoritative; variable operations never retry through Host or a native function. Implementations may be called concurrently and should observe ctx. They must not retain ctx, but may retain requests and cells subject to the normal capability lifetime of those cells.

type VariableContainerKind

type VariableContainerKind = opforimpl.VariableContainerKind

VariableContainerKind identifies the role of a VariableContainer. Sleep asks the installed global container to create local containers for closure invocations and pushl frames, and internal containers for closure state and fork globals.

type VariableContainerRequest

type VariableContainerRequest = opforimpl.VariableContainerRequest

VariableContainerRequest describes one container creation. RuntimeID is the nonzero identity of the Runtime which will use the container. Script is the identity of the ordinary, fork, or ScriptLoader-child Script which owns it. Span is the source operation which first required the container; it is empty for a script root created before top-level execution.

type VariableProvider

type VariableProvider = opforimpl.VariableProvider

VariableProvider creates the global VariableContainer for each ordinary loaded Script. A provider instance is shared with portable ScriptLoader child runtimes; requests retain the child's RuntimeID and Script identity.

CreateGlobalVariableContainer is called synchronously once before the Script is published or any initial/reserved globals are installed. A returned error aborts the load and is authoritative. Implementations may be called concurrently and should observe ctx, but must not retain it after returning.

type VariableProviderError

type VariableProviderError = opforimpl.VariableProviderError

VariableProviderError adds the exact operation and provenance to an error returned by VariableProvider or VariableContainer. Unwrap preserves errors.Is/errors.As checks against the importer's original error.

type VariableProviderFunc

type VariableProviderFunc = opforimpl.VariableProviderFunc

VariableProviderFunc adapts a function to VariableProvider.

type VariableProviderOperation

type VariableProviderOperation = opforimpl.VariableProviderOperation

VariableProviderOperation identifies an importer call for error reporting.

Directories

Path Synopsis
Package aggressor provides the documented Aggressor Script compatibility catalog and importer adapters for OPFOR's public host interfaces.
Package aggressor provides the documented Aggressor Script compatibility catalog and importer adapters for OPFOR's public host interfaces.
cmd
opfor command
Package conformance provides a versioned, Team-Server-free compatibility suite for OPFOR importer adapters.
Package conformance provides a versioned, Team-Server-free compatibility suite for OPFOR importer adapters.
internal
ast
Package ast defines the syntax tree shared by the parser and evaluator.
Package ast defines the syntax tree shared by the parser and evaluator.
bytecode
Package bytecode defines OPFOR's resumable control-flow instruction stream.
Package bytecode defines OPFOR's resumable control-flow instruction stream.
cli
Package cli implements the opfor command-line interface.
Package cli implements the opfor command-line interface.
cmd/apifacade command
Command apifacade generates the public opfor package facade.
Command apifacade generates the public opfor package facade.
cmd/releasepack command
Command releasepack builds deterministic OPFOR release archives.
Command releasepack builds deterministic OPFOR release archives.
cmd/sleepcompare command
Command sleepcompare measures equivalent Sleep workloads in OPFOR and the official Sleep 2.1 Java interpreter.
Command sleepcompare measures equivalent Sleep workloads in OPFOR and the official Sleep 2.1 Java interpreter.
compiler
Package compiler lowers parsed Sleep/Aggressor statements into resumable OPFOR bytecode.
Package compiler lowers parsed Sleep/Aggressor statements into resumable OPFOR bytecode.
envspec
Package envspec defines the built-in Sleep and Aggressor environment declaration metadata shared by the lexer, parser, and runtime.
Package envspec defines the built-in Sleep and Aggressor environment declaration metadata shared by the lexer, parser, and runtime.
javaser
Package javaser implements a bounded, inert reader and writer for version 5 Java Object Serialization streams.
Package javaser implements a bounded, inert reader and writer for version 5 Java Object Serialization streams.
lexer
Package lexer tokenizes Sleep and Aggressor Script source code.
Package lexer tokenizes Sleep and Aggressor Script source code.
opfor
Package opfor implements an embeddable, pure-Go Sleep and Aggressor Script runtime.
Package opfor implements an embeddable, pure-Go Sleep and Aggressor Script runtime.
parser
Package parser parses Sleep and Aggressor Script tokens into an AST.
Package parser parses Sleep and Aggressor Script tokens into an AST.
regexp2
Package regexp2 is a regexp package that has an interface similar to Go's framework regexp engine but uses a more feature full regex engine behind the scenes.
Package regexp2 is a regexp package that has an interface similar to Go's framework regexp engine but uses a more feature full regex engine behind the scenes.
Package source defines OPFOR's public source-location and diagnostic types.
Package source defines OPFOR's public source-location and diagnostic types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL