{"modulePath":"github.com/the-dev-tools/dev-tools/apps/cli","version":"v0.0.0-20261108121446-820be1ff163d","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package runner\n\n## Functions\n\n```go\nfunc ApplyRequestOptions(nodes map[idwrap.IDWrap]node.FlowNode, services RunnerServices)\n```\nApplyRequestOptions sets each request node's stream: and follow\\_redirects: options from its HTTP request's settings.\n\n```go\nfunc RunFlow(ctx context.Context, flowPtr *mflow.Flow, services RunnerServices, reporters *reporter.ReporterGroup) (model.FlowRunResult, error)\n```\n\n```go\nfunc RunMultipleFlows(ctx context.Context, fileData []byte, allFlows []mflow.Flow, services RunnerServices, logger *slog.Logger, reporters *reporter.ReporterGroup) error\n```\nRunMultipleFlows executes multiple flows based on the run field configuration. Flows run sequentially in dependency order (a topological sort of the run: block, ties broken by original list order) rather than run: block declaration order. A flow whose dependency failed, or was itself skipped, is reported as skipped instead of attempted; flows with no such gate still run even if an unrelated earlier flow failed.\n\n## Types\n\n```go\ntype Checks struct {\n\tEvaluator *aicheck.Evaluator\n\t// contains filtered or unexported fields\n}\n```\nChecks evaluates the AI checks (expect: blocks) of a command's flows after each flow runs.\n\n```go\nfunc NewChecks(bundle *ioworkspace.WorkspaceBundle, opts ChecksOptions) (*Checks, error)\n```\nNewChecks compiles the bundle's expect: blocks per flow. It returns nil when the file has none.\n\n```go\nfunc (c *Checks) Close() error\n```\nClose saves the judge cache.\n\n```go\nfunc (c *Checks) Notices() []string\n```\nNotices are the lines printed once per command: why judge checks were skipped, and that failed checks only report.\n\n```go\ntype ChecksOptions struct {\n\t// Dir resolves expect: schema paths (the flow file's directory).\n\tDir string\n\t// CachePath is the judge cache file; \"\" keeps verdicts in memory only.\n\tCachePath string\n\t// Env is where judge API keys are read from.\n\tEnv map[string]string\n\t// HTTP is the judge's client; nil uses a client with a 60 s timeout.\n\tHTTP *http.Client\n}\n```\nChecksOptions configure NewChecks.\n\n```go\ntype Cleanup struct {\n\t// contains filtered or unexported fields\n}\n```\nCleanup is a flow's built cleanup: block, ready to run after the flow's normal steps. A nil \\*Cleanup (the flow has no cleanup block) runs nothing.\n\n```go\nfunc BuildCleanup(ctx context.Context, flow mflow.Flow, services RunnerServices, deps CleanupBuildDeps) (*Cleanup, error)\n```\nBuildCleanup builds the node implementations of flow's cleanup block. It returns nil when the flow has none.\n\n```go\nfunc (c *Cleanup) DisplayNames() []string\n```\nDisplayNames are the cleanup step names as reporters show them.\n\n```go\nfunc (c *Cleanup) Nodes() map[idwrap.IDWrap]node.FlowNode\n```\nNodes returns the cleanup step nodes by ID.\n\n```go\nfunc (c *Cleanup) Run(ctx context.Context, varMap map[string]any, emit func(reporter.NodeStatusEvent)) ([]model.NodeRunResult, error)\n```\nRun executes the cleanup steps one at a time, in order, against the flow's final variable map (which it extends with the cleanup steps' own outputs). Every step is attempted: a failure does not stop the steps after it. A step is skipped instead when a step it reads produced no output, or a cleanup step it depends on did not succeed.\n\nIt returns one result per step and, if any step failed, an error naming the first failure. Cleanup stops early only when ctx is cancelled (Ctrl-C).\n\n```go\nfunc (c *Cleanup) Size() int\n```\nSize is the number of cleanup steps.\n\n```go\ntype CleanupBuildDeps struct {\n\tTimeout     time.Duration\n\tHTTPClient  httpclient.HttpClient\n\tRespChan    chan nrequest.NodeRequestSideResp\n\tGQLRespChan chan ngraphql.NodeGraphQLSideResp\n}\n```\nCleanupBuildDeps are the per-run resources cleanup nodes share with the flow's normal nodes.\n\n```go\ntype JSRunner struct {\n\t// contains filtered or unexported fields\n}\n```\nJSRunner manages the lifecycle of the Node.js worker process\n\n```go\nfunc NewJSRunner() (*JSRunner, error)\n```\nNewJSRunner checks if Node.js is available and returns a runner instance\n\n```go\nfunc (r *JSRunner) Client() node_js_executorv1connect.NodeJsExecutorServiceClient\n```\nClient returns the RPC client for the JS executor\n\n```go\nfunc (r *JSRunner) Start(ctx context.Context) error\n```\nStart starts the JS worker process and returns as soon as it answers an RPC, polling every jsWorkerPollInterval for up to jsWorkerStartupTimeout.\n\n```go\nfunc (r *JSRunner) Stop()\n```\nStop stops the JS worker process and cleans up\n\n```go\ntype RunnerServices struct {\n\tNodeService         sflow.NodeService\n\tEdgeService         sflow.EdgeService\n\tFlowVariableService sflow.FlowVariableService\n\tBuilder             *flowbuilder.Builder\n\tJSClient            node_js_executorv1connect.NodeJsExecutorServiceClient\n\t// Cleanups holds each flow's cleanup: block, keyed by owning flow ID. The\n\t// hidden cleanup flows must have been imported (ImportFlowCleanups).\n\tCleanups map[idwrap.IDWrap]ioworkspace.FlowCleanup\n\t// Streams holds request steps' stream: settings, by HTTP request ID.\n\tStreams map[idwrap.IDWrap]mhttp.HTTPStream\n\t// NoRedirects holds the HTTP requests of steps with follow_redirects: false.\n\tNoRedirects map[idwrap.IDWrap]bool\n\t// Checks evaluates the flows' AI checks after each run; nil when the file has none.\n\tChecks *Checks\n}\n```\n\n","path":"github.com/the-dev-tools/dev-tools/apps/cli/internal/runner","name":"runner","synopsis":"","isRedistributable":true}
