Skip to main content
compileDispatchPlan in core/compiler.mjs turns your reviewed prompt, selected capabilities, and optional task sections into one text prompt plus a manifest. It is host-independent; host is recorded as metadata only.

Marker

Every generated prompt starts with:
Hooks pass through any prompt that contains <!-- DISPATCH_COMPILED_PROMPT, which prevents an approved prompt from being intercepted again.

Sections

In order:
  1. The marker line.
  2. ## Objective, followed by the original prompt (trimmed, any language, unchanged).
  3. One of:
    • Breakdown mode (at least one task): ## Task Breakdown & Assigned Capabilities.
    • Simple mode with capabilities: ## Approved Capabilities & Node Instructions.
    • Simple mode without capabilities: ## Approved Capabilities with the line No extra capabilities selected; proceed with default host tools only.
  4. ## Additional User Constraints, only when globalNotes is not empty.
  5. ## Execution Guardrail, with the line This prompt was explicitly reviewed and approved by the user in EISPATCH. Proceed with execution.

Simple mode capability lines

The section starts with Use the following user-approved capabilities in support of the objective above:. Capabilities are sorted by order (missing values sort last) and listed as:

Breakdown mode task sections

The section starts with Execute the following user-approved task sections in order, applying each section’s assigned capabilities:. Tasks are sorted by order and numbered from 1:
  • - Task focus: appears only when the task prompt differs from the title.
  • A task without capabilities gets - Capabilities: Default host tools only.

Capability label rules

  • KIND is the capability kind in uppercase: MCP, SKILL, PLUGIN, SUBAGENT, or RULE.
  • The label is host-enforced tool scope only when the node has enforceable: true. Otherwise it is advisory guidance.
  • Instruction is omitted when empty.
  • Scoped Tools lists at most 8 tools, followed by (+N more) when there are more.

Manual edits

If manualFinalPrompt is non-empty, compiledPrompt is that text verbatim. generatedPrompt still holds the structured version, and manifest.manuallyEdited is true.

Inputs

string
required
The original objective.
object[]
default:"[]"
Selected capability nodes for simple mode. Fields read: kind, label, enforceable, instruction, tools, order, and capabilityId or id.
object[]
default:"[]"
Task sections. When non-empty, breakdown mode is used and selectedNodes is ignored. Fields read: id, title (defaults to Task N), prompt, order (defaults to 999), and capabilities (nodes with the same fields as above).
string
default:"''"
Additional user constraints.
string
default:"''"
User-edited final text, sent verbatim when non-empty.
string
default:"generic"
Host identifier, stored in the manifest.

Outputs

string
The prompt to approve and dispatch.
string
The structured prompt, even when a manual edit overrides it.
object
object
mode, taskCount, selectedCount, enforceableCount, advisoryCount, manuallyEdited, and charCount (length of compiledPrompt).
The compiler only produces text and metadata. Whether a host restricts tools is decided by the host, not by EISPATCH. In v1.1.0, capabilities are advisory unless a node is explicitly marked enforceable: true.