Skip to main content

@flow-state-dev/fsdev

Interfaces​

BlockExecResult​

Structured output shape for fsdev block.

Properties​

block​
block: object;
kind​
kind: BlockKind;
name​
name: string;
error?​
error?: object;
message​
message: string;
stack?​
stack?: string;
execution​
execution: object;
durationMs​
durationMs: number;
output​
output: unknown;
schemaValidation​
schemaValidation: object;
input​
input: object;
input.errors?​
errors?: string[];
input.passed​
passed: boolean;
output​
output: object;
output.errors?​
errors?: string[];
output.passed​
passed: boolean;
success​
success: boolean;

ChatCommandOptions​

Properties​

config?​
config?: string | boolean;

fsdev config selection (string path, false for --no-config, or absent).

dotenv?​
dotenv?: string[];
flowDir?​
flowDir?: string[];
logLevel?​
logLevel?: RuntimeLoggerLevel;
model?​
model?: string;
org?​
org?: string;

--org: run every turn in this organization; the app's resolver is not asked.

quiet?​
quiet?: boolean;
session?​
session?: string;
user?​
user?: string;

ChatRenderer​

Methods​

onEvent()​
onEvent(event): void;

Consume one engine stream event (same type fsdev run maps).

Parameters​
event​

RequestStreamEventWithId

Returns​

void

onSystem()​
onSystem(line): void;

A harness/system line (hints, errors, built-in output).

Parameters​
line​

string

Returns​

void

onTurnEnd()​
onTurnEnd(result): void;

A turn settled.

Parameters​
result​
aborted​

boolean

durationMs​

number

success​

boolean

Returns​

void

onTurnStart()​
onTurnStart(target): void;

A turn is starting against target.

Parameters​
target​

FlowActionTarget

Returns​

void


DevCommandOptions​

Options for executeDevCommand: the fsdev dev flags, plus programmatic extras.

Properties​

allowUnauthenticated?​
allowUnauthenticated?: boolean;

--allow-unauthenticated: bind a network host even if a flow has no authentication.

app?​
app?: string;

--app <package|dir>: serve this app's built pages at the root, the DevTool beside them. The path of the package's module file also names the package, wherever cwd is.

config?​
config?: string | boolean;

fsdev config selection. A string is an explicit --config <path>; false is --no-config; true/absent means search for fsdev.config.* in cwd.

cwd?​
cwd?: string;

Override the working directory (defaults to process.cwd()). For tests.

dotenv?​
dotenv?: string[];

Explicit --dotenv <path> entries to load before the cwd .env.local walk-up.

flowDir?​
flowDir?: string[];
host?​
host?: string;

--host <host>: the host to bind. Default 127.0.0.1.

model?​
model?: string;
open?​
open?: boolean;
pageMeta?​
pageMeta?: Record<string, string>;

Extra <meta name content> tags for every HTML page served at the root of the port. Programmatic only, for a command that wraps fsdev dev. Written on any host, so never a secret.

port?​
port?: string;
store?​
store?: LocalStoreKind;

--store: the local store without an app config (default SQLite).

watch?​
watch?: boolean;

--watch: restart when a file the config loaded changes, and reload open pages; serve an app's source through Vite when it has one. Loopback only. The process's own entry (process.argv[1]) is re-run with the same arguments under node --watch, so a command that wraps this one restarts as itself and passes the same options again.


DevServer​

The running dev server, as executeDevCommand returns it.

Properties​

devtoolUrl​
readonly devtoolUrl: string | undefined;

The DevTool's address when it runs on a port of its own beside an app; else undefined.

url​
readonly url: string;

Address of the pages at the root of the port (the DevTool, or the --app pages).

Methods​

close()​
close(): Promise<void>;

Close the servers and dispose the runtime, without exiting the process. Also removes the SIGINT/SIGTERM handlers the command installed. Idempotent.

Returns​

Promise<void>


DiscoverFlowsOptions​

Properties​

cwd?​
cwd?: string;

Working directory to search from (defaults to process.cwd()).

flowDirs?​
flowDirs?: string[];

Explicit directories to search for flows (overrides default discovery).

onImportFailed?​
onImportFailed?: (failure) => void;

Invoked once per module that throws during import. Discovery continues with remaining modules. Default: failures are ignored (the library never writes to stderr), so programmatic callers see no behavior change.

Parameters​
failure​

FlowImportFailure

Returns​

void


FlowActionTarget​

A flow action, addressed by flow instance id + action name.

Properties​

actionName​
actionName: string;
flowKind​
flowKind: string;

The instance's global id (a singleton's kind).


FlowImportFailure​

A flow module that was discovered but threw during import.

Properties​

cause​
cause: unknown;

The original thrown value.

filePath​
filePath: string;

Absolute path of the module that failed to import.

message​
message: string;

Normalized "Name: message" for Error throws; String(err) otherwise.


FlowRunResult​

Structured final result for fsdev run.

Properties​

error?​
error?: object;
message​
message: string;
stack?​
stack?: string;
execution​
execution: object;
durationMs​
durationMs: number;
itemCount​
itemCount: number;
flow​
flow: object;
action​
action: string;
kind​
kind: string;
output​
output: unknown;
success​
success: boolean;
suspended?​
suspended?: RunSuspension;

Set when the run ended waiting for a person; the exit code is 0.


FsdevGenerator​

The generator a package exports on ./fsdev-gen.

A refusal of what the root holds is thrown as an error carrying a problems array; the command exits 1 on it. Any other throw is read as a setup problem and exits 3.

Properties​

defaultRoot​
defaultRoot: string;

The root, relative to the working directory, when --root is not given.

Methods​

generate()​
generate(root): Promise<GeneratedModule>;

Read root (absolute) and render the module. Must not write.

Parameters​
root​

string

Returns​

Promise<GeneratedModule>


GenCommandOptions​

Options fsdev gen accepts.

Properties​

check?​
check?: boolean;

Compare against the committed file instead of writing it, and exit non-zero on a difference.

root?​
root?: string;

The directory the generator reads. Defaults to the generator's own.


GeneratedModule​

What a generator hands back from one run.

Properties​

content​
content: string;

The module's full text.

entries​
entries: string[];

One line per registration, printed as found.

file​
file: string;

The file to write, relative to the root.

paths​
paths: string[];

Every discovered path, listed when --check finds the file stale.

searched​
searched: string[];

The folders looked in, printed before the entries.

summary​
summary: string;

A one-line count of what was found.


GenResult​

What one fsdev gen run did, for a caller that wants it without the process exiting.

Extends​

Properties​

entries​
entries: string[];

One line per registration, printed as found.

Inherited from​

GeneratedModule.entries

file​
file: string;

Absolute path of the generated module.

generator​
generator: string;

The package whose generator ran.

paths​
paths: string[];

Every discovered path, listed when --check finds the file stale.

Inherited from​

GeneratedModule.paths

searched​
searched: string[];

The folders looked in, printed before the entries.

Inherited from​

GeneratedModule.searched

summary​
summary: string;

A one-line count of what was found.

Inherited from​

GeneratedModule.summary

upToDate​
upToDate: boolean;

True when the file on disk already matched — always true for a write that changed nothing.


LoadConfigOptions​

Inputs for loadFsdevConfig.

Properties​

configPath?​
configPath?: string;

Explicit path from --config. Bypasses the search; a missing file at this path is a CliError rather than a fall-through to discovery.

cwd​
cwd: string;

Directory to search for the config file (config search is cwd-only).


LoadedConfig​

Result of a successful config load.

Properties​

flowState​
flowState: FlowState;

The app's FlowState, default-exported from the config module.

path​
path: string;

Absolute path of the loaded file, for diagnostics.


NextStepsValues​

Values a shipper fills in. The mounted-route three are absent on a second-process host.

Extended by​

Properties​

devScript?​
devScript?: string;

The host's own dev script name — from detection, or from what the template wrote.

devUrl?​
devUrl?: string;

Where that script actually serves. Never an assumed localhost:3000.

mountPath?​
mountPath?: string;

The path the mount answers on, basePath included. Never the bare /api/flows.


RenderNextStepsOptions​

Everything renderNextSteps needs.

Extends​

Properties​

devScript?​
devScript?: string;

The host's own dev script name — from detection, or from what the template wrote.

Inherited from​

NextStepsValues.devScript

devUrl?​
devUrl?: string;

Where that script actually serves. Never an assumed localhost:3000.

Inherited from​

NextStepsValues.devUrl

mountPath?​
mountPath?: string;

The path the mount answers on, basePath included. Never the bare /api/flows.

Inherited from​

NextStepsValues.mountPath

packageManager​
packageManager: NextStepsPackageManager;
topology​
topology: NextStepsTopology;

WorktreesCommandOptions​

Options for executeWorktreesCommand.

Properties​

base?​
base?: string;

With preview: the branch it is cut from. Default main.

boot?​
boot?: string;

With preview: a module whose PREVIEW_BOOTS export lists the apps to boot on the merged tree.

checks?​
checks?: string;

With preview: each branch's checks, ;-separated.

deleteBranch?​
deleteBranch?: boolean;

With remove, delete its branch too.

dryRun?​
dryRun?: boolean;

With removeMerged, say what would be removed and remove nothing.

force?​
force?: boolean;

With deleteBranch, delete a branch holding the only copy of a commit.

gh?​
gh?: string;

The gh to ask GitHub with. Default gh on PATH.

json?​
json?: boolean;

Print the listing as JSON.

optIn?​
optIn?: string[];

With preview: branches that change a lockfile and come in anyway (the app is stopped).

preview?​
preview?: boolean;

Build the preview in the primary checkout instead of listing.

primary?​
primary?: string;

With preview: the repository's primary checkout. Default: the one of the repository this runs in.

remove?​
remove?: string;

Remove the worktree at this directory instead of listing.

removeMerged?​
removeMerged?: boolean;

Remove every worktree whose work has merged, keeping its branch.

repo?​
repo?: string[];

Repositories on this machine to ask, beside those the root's pins name.

status?​
status?: boolean;

With preview: report the last build against the branches now, and change nothing.

user?​
user?: string;

With preview: whose preview, preview/<user>. Default: this account's name.

Type Aliases​

FlowEvent​

type FlowEvent =
| {
item: OutputItem;
type: "item_added";
}
| {
itemId: string;
patch: Record<string, unknown>;
type: "item_updated";
}
| {
item: OutputItem;
type: "item_done";
}
| {
delta: string;
itemId: string;
type: "content_delta";
}
| {
changeType: string;
resourcePath: string;
scope: string;
type: "state_change";
}
| {
durationMs: number;
items: number;
output: unknown;
type: "flow_complete";
}
| object & RunSuspension
| {
code?: string;
message: string;
type: "error";
};

NDJSON event types emitted to stdout during flow execution.


NextStepsPackageManager​

type NextStepsPackageManager = "npm" | "pnpm" | "yarn";

The package managers the block can render commands for. Anything else refuses before a run starts.


NextStepsTopology​

type NextStepsTopology = "mounted-route" | "second-process";

The two host topologies FSD arrives in. The key set is closed; a third is a cross-cutting question.


ParsedInput​

type ParsedInput =
| {
kind: "empty";
}
| {
kind: "chat";
text: string;
}
| {
args: string;
kind: "command";
name: string;
raw: string;
};

The classification of a single typed line.

Variables​

CANONICAL_NEXT_STEPS​

const CANONICAL_NEXT_STEPS: "Next steps\n\n{{#mounted-route}}\n {{run}}{{runSep}} {{devScript}}\n your app, now serving FSD at {{mountPath}}\n → {{devUrl}}\n\n {{exec}}{{execSep}} fsdev dev --port {{devPort}}\n the FSD DevTool, in a second process\n → http://localhost:{{devPort}}\n\n {{exec}}{{execSep}} fsdev run hello send --input '{\"userId\":\"u1\",\"message\":\"hi\"}'\n run the demo flow from your terminal\n{{/mounted-route}}\n{{#second-process}}\n {{exec}}{{execSep}} fsdev dev --port {{devPort}}\n the FSD API and the DevTool, in one process beside your own server\n → http://localhost:{{devPort}}\n\n {{exec}}{{execSep}} fsdev serve --host 127.0.0.1 --port {{servePort}}\n the same API without the DevTool\n → http://127.0.0.1:{{servePort}}\n Keep the --host 127.0.0.1. It binds the listener to loopback, so nothing\n off this machine can reach it.\n\n {{exec}}{{execSep}} fsdev run hello send --input '{\"userId\":\"u1\",\"message\":\"hi\"}'\n run the demo flow from your terminal\n\n Your own server is untouched and starts exactly the way it did before.\n{{/second-process}}\n\nWorth knowing before you build on this\n\n The ports above are defaults, picked to be unlikely to clash with what you\n already run. Nothing here can know they are free. If one is taken, pass a\n different --port.\n\n The demo flow is closed over HTTP. A request to it has to carry\n Authorization: Bearer $FSD_DEMO_TOKEN, and that value is in .env.local.\n A request without it is refused, and no model call is made. Only the demo\n flow is affected — everything else this project serves is unchanged.\n\n fsdev run never authenticates. It executes in-process as a local, trusted\n path and does not look at the token at all, which is why the command above\n works without one. That is what the CLI does, not a gap in the HTTP route.\n\n Sessions are kept on disk by the development file store. It expects one\n process at a time: two FSD servers over the same data directory can each\n accept the same write, so do not drive one session from both at once.\n\n A shared secret is not authentication, and a development file store is not\n a database. Replace both before this project serves anyone but you.\n\n AGENTS.md now tells your coding assistant how to write FSD flows here.\n" = "Next steps\n\n{{#mounted-route}}\n {{run}}{{runSep}} {{devScript}}\n your app, now serving FSD at {{mountPath}}\n \u2192 {{devUrl}}\n\n {{exec}}{{execSep}} fsdev dev --port {{devPort}}\n the FSD DevTool, in a second process\n \u2192 http://localhost:{{devPort}}\n\n {{exec}}{{execSep}} fsdev run hello send --input '{\"userId\":\"u1\",\"message\":\"hi\"}'\n run the demo flow from your terminal\n{{/mounted-route}}\n{{#second-process}}\n {{exec}}{{execSep}} fsdev dev --port {{devPort}}\n the FSD API and the DevTool, in one process beside your own server\n \u2192 http://localhost:{{devPort}}\n\n {{exec}}{{execSep}} fsdev serve --host 127.0.0.1 --port {{servePort}}\n the same API without the DevTool\n \u2192 http://127.0.0.1:{{servePort}}\n Keep the --host 127.0.0.1. It binds the listener to loopback, so nothing\n off this machine can reach it.\n\n {{exec}}{{execSep}} fsdev run hello send --input '{\"userId\":\"u1\",\"message\":\"hi\"}'\n run the demo flow from your terminal\n\n Your own server is untouched and starts exactly the way it did before.\n{{/second-process}}\n\nWorth knowing before you build on this\n\n The ports above are defaults, picked to be unlikely to clash with what you\n already run. Nothing here can know they are free. If one is taken, pass a\n different --port.\n\n The demo flow is closed over HTTP. A request to it has to carry\n Authorization: Bearer $FSD_DEMO_TOKEN, and that value is in .env.local.\n A request without it is refused, and no model call is made. Only the demo\n flow is affected \u2014 everything else this project serves is unchanged.\n\n fsdev run never authenticates. It executes in-process as a local, trusted\n path and does not look at the token at all, which is why the command above\n works without one. That is what the CLI does, not a gap in the HTTP route.\n\n Sessions are kept on disk by the development file store. It expects one\n process at a time: two FSD servers over the same data directory can each\n accept the same write, so do not drive one session from both at once.\n\n A shared secret is not authentication, and a development file store is not\n a database. Replace both before this project serves anyone but you.\n\n AGENTS.md now tells your coding assistant how to write FSD flows here.\n";

The canonical block. One text, two conditional branches, six value placeholders.

Edit this and every shipper's embedded copy fails its own comparison until it is updated, which is the point: the steps, what each process is for, the ports they land on, and the caveats are the invariant content. Only the commands vary.


DEVTOOL_URL_META​

const DEVTOOL_URL_META: "fsdev-devtool-url" = "fsdev-devtool-url";

Name of the meta tag that carries the DevTool's address to an app's pages.


EXIT_CONFIG_ERROR​

const EXIT_CONFIG_ERROR: 3 = 3;

EXIT_DISCOVERY_ERROR​

const EXIT_DISCOVERY_ERROR: 4 = 4;

EXIT_EXECUTION_ERROR​

const EXIT_EXECUTION_ERROR: 1 = 1;

EXIT_INTERNAL_ERROR​

const EXIT_INTERNAL_ERROR: 10 = 10;

EXIT_INVALID_ARGS​

const EXIT_INVALID_ARGS: 2 = 2;

EXIT_SCAFFOLD_ERROR​

const EXIT_SCAFFOLD_ERROR: 5 = 5;

EXIT_SUCCESS​

const EXIT_SUCCESS: 0 = 0;

Exit code constants for the fsdev CLI.

CodeMeaningError Codes
0Success—
1Execution errorEXECUTION_ERROR, EXECUTION_TIMEOUT
2Input/validationINPUT_PARSE_ERROR, SEED_VALIDATION_FAILED, ACTION_NOT_FOUND
3Config errorCONFIG_NOT_FOUND, CONFIG_INVALID
4Discovery errorFLOW_NOT_FOUND, BLOCK_NOT_FOUND, DISCOVERY_FAILED
5Scaffold errorSCAFFOLD_CONFLICT, SCAFFOLD_INVALID_TYPE
10Internal errorUnexpected / unhandled errors

GENERATOR_SUBPATH​

const GENERATOR_SUBPATH: "fsdev-gen" = "fsdev-gen";

The subpath a package exports its generator on.


program​

const program: Command;

Public API surface for @flow-state-dev/fsdev. Re-exports shared infrastructure for use by downstream commands and tools.

Functions​

assertCanonicalNextSteps()​

function assertCanonicalNextSteps(embedded, label?): void;

Throw unless embedded is the canonical block. The only comparison surface — a shipper asserts, it never inspects a verdict, so there is one thing to call and one way to fail.

The assertion is exported rather than run here over every shipper's copy on purpose: a check written here cannot tell not yet from never. Demanding a copy that has not shipped yet fails; tolerating its absence passes forever. So each shipper invokes this from its own test suite, and the assertion lands exactly when the copy does.

Parameters​

embedded​

string

label?​

string

how to name the copy in the failure message (e.g. the file it was read from)

Returns​

void


declaredDevtoolConfig()​

function declaredDevtoolConfig(flowState): DevToolConnectionConfig | undefined;

The devtool block a FlowState declares, or undefined when it declares neither a user nor a bearer.

An empty or blank-only block is normalized to undefined, so a host that passes the result to serve() leaves the static page byte-identical to production. serve() injects what this returns on a loopback host only.

Parameters​

flowState​

FlowState

The app's FlowState. Reads its sync meta getter only, so no store is initialized.

Returns​

DevToolConnectionConfig | undefined


discoverFlows()​

function discoverFlows(cwdOrOptions?): Promise<FlowInstance[]>;

Discovers all flow instances from conventional directories.

Search order:

  1. If flowDirs is provided, search only those directories.
  2. Otherwise, search src/flows/ and flows/ at the root.
  3. Then scan monorepo subdirectories: packages/, examples/, apps/, labs/ looking for src/flows/ and flows/ within each.

Deduplicates flows by instance id (first discovered wins): two instances of one kind with distinct ids are both kept, and are two addresses.

Parameters​

cwdOrOptions?​

string | DiscoverFlowsOptions

Returns​

Promise<FlowInstance[]>


executeChatCommand()​

function executeChatCommand(
flowKind,
actionName,
options
): Promise<void>;

Core execution logic for fsdev chat, separated for testability.

Parameters​

flowKind​

string | undefined

actionName​

string | undefined

options​

ChatCommandInternalOptions

Returns​

Promise<void>


executeDevCommand()​

function executeDevCommand(options): Promise<DevServer>;

Core execution logic for fsdev dev, separated for testability. Resolves once the server listens, with a handle to stop it; SIGINT/SIGTERM stop it and exit.

With watch, the process supervises instead: it resolves once a child runs the server under node --watch (see dev-watch.ts), and the child, which runs this same function, serves.

Parameters​

options​

DevCommandOptions

Returns​

Promise<DevServer>


executeGenCommand()​

function executeGenCommand(options): Promise<GenResult>;

Run the app's generator and render the module, returning what happened.

Writes nothing when check is set. Exported so a caller can drive the command without a process exit.

Parameters​

options​

GenCommandOptions

Where to look, and whether to write.

Returns​

Promise<GenResult>

The rendered file's path, what was found, and whether disk matched.

Throws​

CliError (exit 3) as resolveGenerator.

Throws​

Whatever the generator throws, including its refusals.


executeServeCommand()​

function executeServeCommand(options): Promise<void>;

Core execution logic for fsdev serve, separated for testability.

Parameters​

options​

ServeCommandOptions

Returns​

Promise<void>


executeWorktreesCommand()​

function executeWorktreesCommand(rootArg, options): Promise<number>;

Run the command. Returns the exit code.

Parameters​

rootArg​

string

options​

WorktreesCommandOptions

Returns​

Promise<number>


formatOutput()​

function formatOutput(data, format?): string;

Formats data for CLI output. Currently supports JSON only. Future formats (table, compact) can be added here.

Parameters​

data​

unknown

format?​

"json"

Returns​

string


getSearchedDirs()​

function getSearchedDirs(cwdOrOptions?): string[];

Returns the list of directories that were searched, for use in error messages.

Parameters​

cwdOrOptions?​

string | DiscoverFlowsOptions

Returns​

string[]


isBlockDefinition()​

function isBlockDefinition(value): value is BlockDefinition<ZodTypeAny, ZodTypeAny, any, any>;

Structural check for a BlockDefinition. We don't use instanceof because blocks are created by factory functions across packages. Probes for the substrate dispatch entry (run) rather than the public API.

Parameters​

value​

unknown

Returns​

value is BlockDefinition<ZodTypeAny, ZodTypeAny, any, any>


isFlowInstance()​

function isFlowInstance(value): value is FlowInstance;

Structural check for a FlowInstance. Uses duck-typing because flow instances are created by defineFlow() across packages.

Parameters​

value​

unknown

Returns​

value is FlowInstance


loadFsdevConfig()​

function loadFsdevConfig(options): Promise<LoadedConfig | undefined>;

Load the app's fsdev.config.* and return its FlowState, or undefined when no config file exists (and none was named via --config). Throws CliError(EXIT_CONFIG_ERROR) for every failure once a file is found or explicitly named: missing --config target, a module that can't be loaded or throws at import (including a synchronous FlowStateConfigError from createFlowState), or a default export that is not a FlowState.

Parameters​

options​

LoadConfigOptions

Returns​

Promise<LoadedConfig | undefined>


locateConfig()​

function locateConfig(options): string | undefined;

Locate the config file. An explicit configPath is resolved against cwd and must exist; otherwise the conventional filenames are probed in cwd in precedence order. Returns undefined when no config exists and none was named (callers fall back to legacy discovery + defaults).

Parameters​

options​

LoadConfigOptions

Returns​

string | undefined


parseInputArg()​

function parseInputArg(options): unknown;

Resolves block input from mutually-exclusive CLI flags.

Parameters​

options​

ParseInputOptions

Returns​

unknown

The parsed input value, or undefined if neither flag was provided

Throws​

CliError with EXIT_INVALID_ARGS if both flags are provided, JSON is invalid, or file can't be read


registerChatCommand()​

function registerChatCommand(program): void;

Registers the chat subcommand on the given commander program.

Parameters​

program​

Command

Returns​

void


registerDevCommand()​

function registerDevCommand(program): void;

Registers the dev subcommand on the given commander program.

Parameters​

program​

Command

Returns​

void


registerGenCommand()​

function registerGenCommand(program): void;

Parameters​

program​

Command

Returns​

void


registerServeCommand()​

function registerServeCommand(program): void;

Registers the serve subcommand on the given commander program.

Parameters​

program​

Command

Returns​

void


registerUiCommand()​

function registerUiCommand(program): void;

Parameters​

program​

Command

Returns​

void


registerWorktreesCommand()​

function registerWorktreesCommand(program): void;

Register fsdev worktrees.

Parameters​

program​

Command

Returns​

void


renderNextSteps()​

function renderNextSteps(options): string;

Render the block for one topology and one package manager.

Throws when a value the rendered branch needs was not supplied, rather than emitting a {{devScript}} a developer would then type. The branch that is not rendered is dropped whole, so a second-process host never needs devScript, devUrl or mountPath — those facts are ones that topology never prints.

Parameters​

options​

RenderNextStepsOptions

Returns​

string


resolveBlock()​

function resolveBlock(specifier): Promise<BlockDefinition<ZodTypeAny, ZodTypeAny, any, any>>;

Loads a block from a file path specifier and validates its shape.

Parameters​

specifier​

string

File path (absolute or relative to cwd) to a module with a default-exported BlockDefinition

Returns​

Promise<BlockDefinition<ZodTypeAny, ZodTypeAny, any, any>>

The validated BlockDefinition

Throws​

CliError with EXIT_INVALID_ARGS if the file doesn't exist, has no default export, or the export isn't a BlockDefinition


resolveFlow()​

function resolveFlow(specifier): Promise<FlowInstance>;

Resolves a single flow file path to a FlowInstance. Used when a specific file is provided instead of relying on discovery.

Parameters​

specifier​

string

Returns​

Promise<FlowInstance>


resolveGenerator()​

function resolveGenerator(cwd): Promise<{
generator: FsdevGenerator;
name: string;
}>;

The one generator the app's dependencies supply, and the package it came from. Resolved from the app's package.json, as the app itself would.

Parameters​

cwd​

string

Returns​

Promise<{ generator: FsdevGenerator; name: string; }>

Throws​

CliError (exit 3) when there is no package.json, when no dependency supplies a generator, when more than one does, or when one exports something that is not a generator.