Skip to content

steps/runtime ​

Run directories, resource records and release operations for factory-owned steps. Workflow code normally calls the generated #jigs/steps wrappers.

A run directory is scratch space owned by one run, kept across waits and retries until released. Every resource a run records shows in jigs status with its state; jigs releases only the kinds it creates itself. The generated release step can release early or return a report; the service applies release policy when runs end.

Run directories ​

createRunDirectory() ​

ts
function createRunDirectory(metadata): Promise<string>;

Create a working directory that survives retries and pauses in this run.

Parameters ​

ParameterType
metadataRunMetadata

Returns ​

Promise<string>


removeRunDirectory() ​

ts
function removeRunDirectory(metadata): Promise<void>;

Remove this run's working directory after its work is finished, never while paused.

Parameters ​

ParameterType
metadataRunMetadata

Returns ​

Promise<void>

Recorded resources ​

registerResource() ​

ts
function registerResource(resource): Promise<RunResource>;

Register one resource on the active run so jigs status shows it.

Repeating kind + identity is idempotent; a new URL for that identity replaces the old one. The record is observation only: it stays live as the run's history and jigs never deletes what it names. The kinds jigs records itself (worktree, run-directory, branch, codex-home, pi-home, claude-plugins) are reserved.

Parameters ​

ParameterType
resourceRunResource

Returns ​

Promise<RunResource>

Release ​

releaseRunResources() ​

ts
function releaseRunResources(metadata, explicit?): Promise<ReleaseReport>;

Release this run's resources on its success path and return what was removed or kept.

Parameters ​

ParameterTypeDescription
metadataNamedRunMetadata-
explicit?{ onFailure: "release" | "keep"; onSuccess: "release" | "keep"; }-
explicit.onFailure?"release" | "keep"What to do with eligible resources after a failed or cancelled run.
explicit.onSuccess?"release" | "keep"What to do with eligible resources after a completed run.

Returns ​

Promise<ReleaseReport>

Remarks ​

Without a policy, uses the workflow's release, then the factory's, then the default of releasing successful runs and keeping failed ones. Kept records are final: automatic release after the run ends only visits records that are still live or failed.

Advanced run context ​

dashboardRunUrl() ​

ts
function dashboardRunUrl(runId): string | undefined;

The run's page on the dashboard this service hosts, or undefined when the service was started without one. Never a standalone workflow web URL: run against a live World it opens a second queue worker and steals the jobs the run is waiting on.

Parameters ​

ParameterType
runIdstring

Returns ​

string | undefined