Skip to main content

Module agent_resources

Module agent_resources 

Source

Structs§

AgentIdentity
Who an agent is, for the work-queue and cron sources, which are keyed by identity rather than block.
AgentResources
Everything one agent owns, at one moment.
BackgroundTaskEntry
A run_in_background Bash command the agent declared (bashwrap).
ProcessEntry
One process the agent started (the CLI or a descendant), from its block’s process tracker.
ShellEntry
A srv-spawned Shell() session the agent started.

Functions§

claims_held_by 🔒
The agent’s claimed work items (R7).
container_of
The container a container agent’s block runs in (agentMode = container), named from its agentId as the launch path names it.
container_shared
Is container used by a live controller other than block_id’s (the same agent open in a second pane)? Store reads: call off the async workers.
cron_targets
Does a cron job aimed at (target, target_uid) deliver to the agent? By UID when the job has one, else by name (case-insensitive, like agent addressing).
crons_targeting 🔒
Names of the cron jobs targeting the agent (R8).
force_kill_tree
Kill pid and every descendant at once (SIGKILL on Unix, TerminateProcess on Windows), leaves first, after re-checking that pid is still the process started at started_at_ms (0 = unknown, judged by PID alone). One OS snapshot. Returns how many processes it signalled.
holds_claim
Does a claim held by (claimed_by, claimed_by_uid) belong to the agent? Same holder rule as the store’s release (HOLDER_BY_UID): by UID when both sides have one, else by name.
live_background_pids
The PIDs of tasks that are still that task (spec §8, PID reuse).
same_start 🔒
recorded 0 means the start time wasn’t known; the OS reports seconds.
snapshot
The process-side inventory of block_id: in-memory reads plus two local-store (SQLite) reads, so call it off the async workers (spawn_blocking), as the teardown does.
start_times
Start time (Unix ms, at the OS’s one-second resolution) of each of pids that is running now; a PID that isn’t running is absent. One targeted OS query.
survivors
The processes of a snapshot that are still running: the same PID with the same start time. A PID the OS has since reused for another process is not a survivor (spec §8).