Class NaruTaskSpec

java.lang.Object
net.thevpc.naru.api.task.NaruTaskSpec

public class NaruTaskSpec extends Object
  • Constructor Details

    • NaruTaskSpec

      public NaruTaskSpec()
  • Method Details

    • of

      public static NaruTaskSpec of()
    • parentId

      public long parentId()
    • parentId

      public NaruTaskSpec parentId(long parentId)
    • workingDirectory

      public NPath workingDirectory()
    • workingDirectory

      public NaruTaskSpec workingDirectory(NPath workingDirectory)
    • statements

      public List<String> statements()
    • statements

      public NaruTaskSpec statements(String... commands)
    • statements

      public NaruTaskSpec statements(List<String> commands)
    • name

      public String name()
    • name

      public NaruTaskSpec name(String name)
    • promptMode

      public NaruPromptMode promptMode()
      Prompt mode to run the task in. When null the task inherits its parent's mode, falling back to PLANNING for root tasks.

      Declaring it here rather than calling NaruTask.promptMode(..) after newTask(..) matters: a freshly created task is already visible to scheduler workers, so a mode flipped after the fact leaves a window in which the task runs under the inherited mode.

    • promptMode

      public NaruTaskSpec promptMode(NaruPromptMode promptMode)
    • toolTags

      public Set<String> toolTags()
      Tool tags granted to the task. A task can only see a tagged tool if it holds at least one of that tool's tags, so these must be granted explicitly; tags are never inherited from the parent.
    • toolTags

      public NaruTaskSpec toolTags(String... tags)
    • toolTags

      public NaruTaskSpec toolTags(List<String> tags)
    • vars

      public NaruTaskSpec vars(Map<String,Object> vars)
      Replace the initial task variables, replacing anything set earlier.

      This is how a host passes real inputs in. The alternative -- a leading /set --task name = value statement -- forces every value through the script parser, which means stringifying anything that is not a literal and quoting anything containing spaces.

      Parameters:
      vars - the variables, may be null to clear; null keys are ignored
    • var

      public NaruTaskSpec var(String name, Object value)
      Add or replace a single initial task variable, keeping the others.
    • vars

      public Map<String,Object> vars()
      The initial task variables, unmodifiable. Empty rather than null when none were set.
    • resolveName

      public NaruTaskSpec resolveName()
    • resolveNameOr

      public NaruTaskSpec resolveNameOr(String name)