pub struct Job {
pub name: String,
pub description: String,
pub args: Vec<Arg>,
pub requires: Vec<Requirement>,
pub agent_allow: bool,
/* private fields */
}Expand description
One job: a named script with its metadata. The script, its interpreter
language, its Opts: flags, and its extra environment are internal mechanics;
a consumer deals in the name, description, declared args, dependencies, and the
agent gate, and runs the job through run, run_captured, or
run_agent.
Fields§
§name: StringThe heading text (the job name).
description: StringProse in the job body that is not a recognized Key: value line.
args: Vec<Arg>Args: declares positional arguments in just’s syntax. A bare name is
required, name='default' is optional, and a trailing *name is variadic
(it collects the rest, space-joined). Each one is substituted as
{{ name }} in the script and also exported as $name. Note that
{{ name }} is raw text substitution, spliced in before the interpreter
parses the script, so {{ name }} is NOT injection-safe for untrusted values
in any language. The safe form is to read the value from the environment,
never to template it: "$name" in a shell, os.environ["name"] in Python,
process.env.name in Node, and so on. Reserve {{ }} for developer-authored
templates. An agent-run job that raw-templates an arg is refused by
run_agent.
requires: Vec<Requirement>Requires: names the jobs this one depends on. The run* entry points
resolve the transitive order (deps first, cycle and typo detected) and run
each in turn, stopping on the first non-success step.
agent_allow: boolAgent: allow opts a job in to being listed and run by an MCP or agent
surface. The flag alone enforces nothing: run_agent is the gate that
checks it (and agent_jobs the listing that filters on it), so a plain
run or run_captured ignores it. It stays public as advisory data an
embedder can read.
Implementations§
Source§impl Job
impl Job
Sourcepub fn script(&self) -> &str
pub fn script(&self) -> &str
The script body, verbatim: the contents of the first fenced block under the heading, before any argument substitution.
Public so a consumer can show a task before running it. Knowing what a task will do should not require running it, and for a tool whose job is executing shell that is the difference between a considered decision and a leap of faith.