JavaScript Runtime
Look up every published runtime symbol and shared schema from the installed package JavaScript runtime contract on a stable static docs route.
Symbol metadata glossary
Symbol cards show kind, mutability, nullability, and binding lifecycle as glossary-backed pills when the package contract publishes those fields. The definitions below explain the published meanings — including Value versus function kind — without inventing extra enum values.- Kind
- Kind classifies what the published symbol is. A Value is a bound data binding such as args or meta. A function is a callable runtime helper such as log. Namespace and method kinds appear only when the contract publishes those shapes.
- Mutability
- Mutability describes whether the bound object may change after bind. Mutable object means the binding exposes an object authors can update. Fixed binding means the binding identity stays fixed for the published lifetime.
- Nullability
- Nullability describes whether the binding may be null. Non-null means the published contract treats the binding as always present when that field is published.
- Binding lifecycle
- Binding lifecycle describes how the binding relates to the workflow run. Snapshot at bind captures the value when the binding is established. Live namespace stays connected to the live namespace surface for the published lifetime.
How the JavaScript runtime works
At script start the host binds Value symbols such as javascript.args and javascript.meta from the workflow request. The script body then chains published helpers — phase, log, workflow.checkpoint, agent.run, workflow.artifact, and workflow.final — to record progress, dispatch child work, attach artifacts, and terminate. The example below composes only published call patterns from the package contract.Record a phase
Call phase with a published string label so the host can track progress before heavier work starts.
Emit a log record
Call log with a message string and an optional JSON-compatible detail object for workflow-scoped logging.
Persist a checkpoint
Call workflow.checkpoint with a closed spec object (label plus optional JSON-compatible state) so a later resume can restore progress.
Dispatch a child agent
Await agent.run with a closed spec that includes a required prompt and optional label and preset fields from the published agent-run schema.
Register an artifact
Call workflow.artifact with kind and label metadata, and optional JSON-compatible content, to attach durable output to the run.
Finish the workflow
Call workflow.final with an optional JSON-compatible value to terminate the script and return a final result.
phase("draft");
log("checkpoint", { step: 1 });
workflow.checkpoint({ label: "draft", state: { step: 1 } });
await agent.run({
prompt: "Summarize findings",
label: "summarize",
preset: "operator",
});
workflow.artifact({ kind: "log", label: "step", content: { step: 1 } });
workflow.final({ ok: true, result: { count: 1 } });Runtime Inventory
Scan the published JavaScript symbols and shared schemas below. Filter by symbol path, schema id, description, or lifecycle when those facets are present. Open a card for available metadata and shared-schema links, and copy its stable anchor when you need a deep link.21 published JavaScript runtime items from the package contract.
Symbols
Mutable invocation argument value bound from workflow request args JSON at script start. The binding is a non-null object snapshot; property reads and writes affect only the in-script view and do not change the original request payload.
- Symbol path
- args
- Symbol id
- javascript.args
Examples
{ "subject": "release", "count": 2, "prefix": "echo" }Mutable invocation metadata object bound from workflow request metadata at script start. The binding is a non-null object snapshot with string-valued entries; when name is absent the runtime supplies the default simple-final label.
- Symbol path
- meta
- Symbol id
- javascript.meta
Examples
{ "name": "simple-final", "description": "Example workflow metadata" }Synchronously emits one workflow-scoped log record. The first argument must be a non-empty string message; an optional second argument supplies JSON-compatible structured fields.
- Symbol path
- log
- Symbol id
- javascript.log
Shared schemas
- javascript.schema.json_compatible#/sharedSchemas/javascript.schema.json_compatible/schema
Examples
log("checkpoint", { step: 1 })Root agent namespace for the installed agent.run child-dispatch helper.
- Symbol path
- agent
- Symbol id
- javascript.agent
Examples
agent.run({ prompt: "Summarize findings", label: "summarize" })Dispatches one child agent run from a closed spec object with a required prompt and optional model or preset fields. Returns a promise that resolves to the child result object after policy checks and child_dispatch emission.
- Symbol path
- agent.run
- Symbol id
- javascript.agent.run
Shared schemas
- javascript.schema.agent_run_spec#/sharedSchemas/javascript.schema.agent_run_spec/schema
Examples
await agent.run({ prompt: "Summarize findings", label: "summarize", preset: "operator" })Runs an array of agent run specs or item functions concurrently and returns a promise that resolves to an array of child results. Each function item is invoked with undefined this.
- Symbol path
- parallel
- Symbol id
- javascript.parallel
Examples
await parallel([{ prompt: "first" }, { prompt: "second", label: "two" }])Maps each items entry through a required worker function and optional next stage callback, running stages sequentially per item. Returns a promise that resolves to a pipeline result array.
- Symbol path
- pipeline
- Symbol id
- javascript.pipeline
Examples
await pipeline([1, 2], (item) => item * 2, (prior, item) => prior + item)
Synchronously records one named workflow phase transition for progress tracking. The name must be a non-empty string.
- Symbol path
- phase
- Symbol id
- javascript.phase
Examples
phase("draft")Root workflow namespace for installed checkpoint, artifact, budget, final, log, and resumeState helpers.
- Symbol path
- workflow
- Symbol id
- javascript.workflow
Examples
workflow.artifact({ kind: "log", label: "step" })Registers one workflow artifact with kind and label metadata. Optional content must be JSON-compatible and is subject to maxArtifactBytes policy.
- Symbol path
- workflow.artifact
- Symbol id
- javascript.workflow.artifact
Shared schemas
- javascript.schema.artifact_spec#/sharedSchemas/javascript.schema.artifact_spec/schema
Examples
workflow.artifact({ kind: "log", label: "step", content: { step: 1 } })Returns the current workflow budget counters and emits one budget record. The helper does not accept arguments.
- Symbol path
- workflow.budget
- Symbol id
- javascript.workflow.budget
Shared schemas
- javascript.schema.budget_snapshot#/sharedSchemas/javascript.schema.budget_snapshot/schema
Examples
workflow.budget()
Persists one labeled checkpoint with optional JSON-compatible state for later resume through workflow.resumeState().
- Symbol path
- workflow.checkpoint
- Symbol id
- javascript.workflow.checkpoint
Shared schemas
- javascript.schema.checkpoint_spec#/sharedSchemas/javascript.schema.checkpoint_spec/schema
Examples
workflow.checkpoint({ label: "draft", state: { step: 1 } })Terminates the workflow with an optional final value. When both workflow.final and a returned value are present, workflow.final wins for terminal result selection.
- Symbol path
- workflow.final
- Symbol id
- javascript.workflow.final
Examples
workflow.final({ ok: true, result: { count: 1 } })Synchronously emits one workflow-scoped log record. The first argument must be a string message; an optional second argument supplies JSON-compatible structured fields.
- Symbol path
- workflow.log
- Symbol id
- javascript.workflow.log
Shared schemas
- javascript.schema.json_compatible#/sharedSchemas/javascript.schema.json_compatible/schema
Examples
workflow.log("checkpoint", { step: 1 })Reads checkpoint state restored for a resumed workflow session, or undefined when no resume state is bound.
- Symbol path
- workflow.resumeState
- Symbol id
- javascript.workflow.resume-state
Shared schemas
- javascript.schema.checkpoint_spec#/sharedSchemas/javascript.schema.checkpoint_spec/schema
Examples
workflow.resumeState()