LevelingOptions#

Options for Project#level, and the level option of Project#evaluate and Project#suggestAssignments. They set which part of the plan leveling acts on and how it may move tasks. Every field is optional: {} levels the whole project with default settings.

interface LevelingOptions {
  scope?: { resources?: Id[]; tasks?: Id[]; from?: DateValue; to?: DateValue };
  basis?: "hour" | "day";
  order?: "id" | "standard" | "priority";
  withinSlackOnly?: boolean;
  clearFirst?: boolean;
  allowSplits?: boolean;
  step?: "minimal" | "skip";
}

Fields#

Field Type Default Description
scope object whole project Limits the run to some resources, tasks or dates. See scope.
basis "hour" | "day" from config.duration_unit Bucket size for detecting overallocation. Without it, the basis is "day" when config.duration_unit is "day", and "hour" when it's "hour" or "minute".
order "id" | "standard" | "priority" "standard" Which contender gives way first. "id": the task later in input order moves. "standard": dependencies, slack, dates, priority and constraints, checked in that order. "priority": lower priority moves first, then the "standard" rules apply.
withinSlackOnly boolean false true caps each delay at the task's total slack.
clearFirst boolean true true sets leveling_delay: 0 and pauses: [] on in-scope tasks before leveling. false keeps existing delays and pauses and levels on top of them.
allowSplits boolean true true lets leveling write pauses. false allows whole-task delays (leveling_delay) only.
step "minimal" | "skip" "minimal" How far one move goes. "minimal": just past the overallocated bucket. "skip": past the whole overallocated window of the resource.

The full rules behind order, step and withinSlackOnly are in Leveling Resources.

scope#

Field Type Default Description
resources Id[] every resource Resources whose overallocation triggers a move.
tasks Id[] every task Tasks leveling may delay or split; it writes no leveling_delay or pauses on other tasks. Also sets which tasks clearFirst clears.
from DateValue start of the plan Only buckets that start at or after from trigger a move.
to DateValue end of the plan Only buckets that start before to trigger a move.

from and to limit where leveling looks for overallocation, not where moved tasks land: a task can end up past to. Overallocation outside the scope stays in the result's overallocations with reason: "out-of-scope".

Used by#

Example#

const options = {
  scope: {
    resources: ["dev1"],
    from: "2026-08-10",
    to: "2026-08-24",
  },
  order: "priority",
  withinSlackOnly: true,
  allowSplits: false,
};