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()
function createRunDirectory(metadata): Promise<string>;Create a working directory that survives retries and pauses in this run.
Parameters
| Parameter | Type |
|---|---|
metadata | RunMetadata |
Returns
Promise<string>
removeRunDirectory()
function removeRunDirectory(metadata): Promise<void>;Remove this run's working directory after its work is finished, never while paused.
Parameters
| Parameter | Type |
|---|---|
metadata | RunMetadata |
Returns
Promise<void>
Recorded resources
registerResource()
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
| Parameter | Type |
|---|---|
resource | RunResource |
Returns
Promise<RunResource>
Release
releaseRunResources()
function releaseRunResources(metadata, explicit?): Promise<ReleaseReport>;Release this run's resources on its success path and return what was removed or kept.
Parameters
| Parameter | Type | Description |
|---|---|---|
metadata | NamedRunMetadata | - |
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()
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
| Parameter | Type |
|---|---|
runId | string |
Returns
string | undefined