@saflib/workflows
@saflib/workflows
Classes
Class | Description |
---|---|
Workflow | Abstract superclass for XStateWorkflow. Can probably be removed since SimpleWorkflows are gone. |
XStateWorkflow | Abstract superclass for XStateWorkflows. |
Interfaces
Interface | Description |
---|---|
ChecklistItem | Simple checklist object. Machines should append one to the list for each state. If a state invokes another machine, add its checklist output as subitems to create a recursively generated checklist tree. |
CLIArgument | Required argument for the workflow, in a format the CLI tool (commander) can use. |
ComposerFunctionOptions | Options for all composer functions. These functions return an object which can be spread into an XState "states" object, for easily composing a workflow machine from common steps. |
LogParams | Params for the log action. |
RunNpmCommandFactoryOptions | Options for the runNpmCommandComposer function. |
RunTestsComposerOptions | Options for the runTestsComposer function. |
TemplateWorkflowContext | There are at least two machines which work on templates: creating and updating. These share some common context properties in addition to WorkflowContext properties. |
UpdateTemplateFileComposerOptions | Options for the updateTemplateComposer function. |
WorkflowContext | Context shared across all workflow machines. |
WorkflowInput | Inputs every workflow machine receives. |
WorkflowMeta | Wrapper around a ConcreteWorkflow class. Honestly might not be necessary and could likely be removed. |
WorkflowOutput | Outputs every workflow machine returns. |
XStateMachineStates | State objects which can be passed into XStateMachine Actor Definitions. These are typed simply here because I'll be damned if I can figure out how to use the XState library's provided generics. |
Type Aliases
Type Alias | Description |
---|---|
ConcreteWorkflow | Some subclass of Workflow which implements all abstract methods and properties. |
Variables
Variable | Description |
---|---|
workflowActions | Common actions for workflow machines. |
workflowActors | Common actors for workflow machines. |
Functions
Function | Description |
---|---|
contextFromInput | Helper function to create initial WorkflowContext from WorkflowInput . |
copyTemplateStateComposer | Composer for copying template files to a target directory. Also replaces every instance "template-file", "template_file", "TemplateFile", and "templateFile" with the name of the thing being created, passed in via the CLI or other interface. To use this composer, the machine context must extend TemplateWorkflowContext. |
getPackageName | Utility function to get the package name from the root URL. |
logError | Action builder for logging error messages. |
logInfo | Action builder for logging info messages. |
outputFromContext | Helper function to create WorkflowOutput from WorkflowContext . |
promptAgentComposer | Composer for prompting the agent. During normal execution, once a prompt is printed, the workflow will stop so it can be continued later. |
runNpmCommandComposer | Composer for running npm commands. |
runTestsComposer | Composer for running tests. Takes a specific file path to test. |
runWorkflowCli | Uses Commander.js to run a CLI for running workflows. |
updateTemplateComposer | Composer for updating files copied by states from copyTemplateStateComposer. Use this to provide specific instructions on how to update each file. In addition to prompting the agent to make changes, this will block the agent from continuing until all "todo" strings are gone from the file. |