Documentation
¶
Overview ¶
Package jsworkflow is the goja-backed adapter that compiles a `.js` workflow into an orchestrate.Workflow (ADR-0009). It is the only package that knows JS exists; the engine, the Workflow/Phase port, and the report shape live in internal/orchestrate and are unchanged.
JS contract (defined by change 0014 — no MiMoCode reference existed to copy):
module.exports = {
name: "deep-research", // required: registration key
maxRetries: 2, // optional, defaults to 0
phases: [ // required, non-empty, ordered
{ name: "query", run: (state) => "output" },
{ name: "go", run: (state) => { state.set("k","v"); return "..." } },
],
};
state shim: { last: string, get(key): string|undefined, set(key, value): void } over the engine's *orchestrate.State. A thrown value is a phase error and retries per maxRetries, like a Go phase. The sandbox binds only module, exports, state, and console.log — no require, fs, or net.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiled ¶
type Compiled struct {
// Name is module.exports.name — the registration key.
Name string
// Run is the workflow, runnable through the unchanged engine.
Run orchestrate.Workflow
// contains filtered or unexported fields
}
Compiled is a JS workflow ready to run, with its declared name (the key a caller registers it under) and the orchestrate.Workflow that runs it.