@saflib/workflows
@saflib/workflows
Interfaces
| Interface | Description |
|---|---|
| AgentConfig | When in "run" mode, specify which agent to use. |
| CdStepInput | Input for the CdStepMachine. |
| CommandStepInput | Input for the CommandStepMachine. |
| CopyStepInput | Input for the CopyStepMachine. |
| ParsePackageNameInput | Argument for the parsePackageName function. |
| ParsePackageNameOutput | Return value for the parsePackageName function. |
| ParsePathInput | Argument for the parsePath function. |
| ParsePathOutput | Return value for the parsePath function. |
| PromptStepInput | Input for the PromptStepMachine. |
| RunWorkflowOptions | Argument for the runWorkflow function. |
| RunWorkflowResult | Return value of the runWorkflow function. |
| UpdateStepInput | Input for the UpdateStepMachine. |
| WorkflowArgument | Required argument for the workflow, in a format the CLI tool (or other program) can use. |
| WorkflowCliOptions | Options for configuring the workflow CLI |
| WorkflowDefinition | An interface that includes everything that makes up a workflow. |
| WorkflowLogger | Logger interface for workflow operations |
| WorkflowLoggerOptions | Options for creating a workflow logger |
Type Aliases
| Type Alias | Description |
|---|---|
| AgentCLI | The agent to use for the workflow. |
| Old name | |
| Old name | |
| GetSourceUrlFunction | Function type for getting source URLs from absolute file paths. |
| WorkflowExecutionMode | The mode to run the workflow in. |
| WorkflowStep | A step in a workflow with an actor and its corresponding input. |
Variables
| Variable | Description |
|---|---|
| CdStepMachine | Updates the current working directory for subsequent steps, such as "copy", "update", and "command". |
| CommandStepMachine | Runs a shell command as part of a workflow. Stops the workflow if the command fails. |
| CopyStepMachine | Copies all templateFiles to the given directory, performing string replacements for directories, file names, and file contents. |
| PromptStepMachine | Prompts the agent or user to do an arbitrary task. |
| UpdateStepMachine | Prompts the agent to update one of the templateFiles that was copied over by the CopyStepMachine. |
Functions
| Function | Description |
|---|---|
| checklistToString | Convenience function to convert a checklist to a string. |
| defineWorkflow | Helper, identity function to infer types. |
| getPackageName | Reads the package.json for the given cwd and returns the package name. |
| makeLineReplace | Creates a line-replace function which will handle template interpolation, given a context. |
| makeWorkflowMachine | Takes a WorkflowsDefinition, as well as its Context and Input types, and creates an XState machine. |
| parsePackageName | Takes a package name and returns a breakdown into conventional parts for templating. |
| parsePath | Takes a target path to a file and breaks it down into conventional parts for templating. |
| runWorkflow | Convenience function to take a WorkflowDefinition, run it in the specified mode, and return the output. Can be used to run a given workflow in checklist mode for a unit test. This is also used internally by the CLI tool. |
| runWorkflowCli | Given a list of workflow classes, runs a CLI for running workflows. |
| step | Helper function for defining a step in a workflow, enforcing types properly. |